In "Global Preferences",I checked the "Use Shadows" box.But in my model,I want certain objects not to use shadows, and certain objects to use shadows.How can I close the shadows on certain objects ?
In "Global Preferences",I checked the "Use Shadows" box.But in my model,I want certain objects not to use shadows, and certain objects to use shadows.How can I close the shadows on certain objects ?
You can also use the fglinfo() command to determine if you are in the draw pass rendering into the shadow map.
if (fglinfo(FGL_INFO_SHADERTYPE, view) == SHADERTYPE_RENDER_SHADOWS)
If you hide the shapes so that they aren't drawn during the shadow map pass, then they will not cast shadows (but they will still be affected by the view's lighting).
Attached is an example model that has an object with an array label pointing at other objects to hide during the shadow draw pass.
Note that the switch_hideshape() code is on a separate object (ShadowController) than the objects that it is hiding. If you try to hide and show an object from its own draw trigger, then it will stay hidden because it will no longer fire its own On Draw trigger after being hidden.
Also, the ShadowController object needs to be below the objects it is controlling in the tree so that its On Draw trigger is fired before they are drawn. So set the rank of the object to be last in your model.
@phil.bobo,@jordan.johnson Both of your methods can all work. Thank you for your help!
You can make an object luminous. Then it won't use lighting or shadows:
treenode object = model().find("Processor1"); assertattribute(object, "drawflags", DATATYPE_NUMBER); rebindobjectattributes(object); set(drawflags(object), get(drawflags(object)) | DRAW_FLAG_LUMINOUS);
11 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved