Related pages

Shadows

I'm currently trying to add Ray tracing Shadows to my project but am having quite a bit of difficulty in doing so. So far I've been using the provided source demos and the online documentation to enable Shadows but I'm having a hard time figuring out how to actually turn it on or get it working.

At the moment I've used the following to enable anti-aliasing which works as intended but the only things I've found relating to shadows are the RenderParams.IsShadowEnabled = True; and that seems to do nothing.

When you having some questions related to visualization, it is always better sharing some screenshots demonstrating the issue.

To see shadows in the viewer, you also need defining proper light sources.
E.g., headlight might cast shadows in direction from the eye, so that although shadows are rendered, they are just never seen.
Also, perspective projection might be more illustrative than orthographic.

Sorry for the late reply, but I have managed to get a a reasonable screenshot of a board demonstrating the issue.

From the design you can see the light source is coming from the left hand side (Indicated by the red arrow) and is casting shade over components of the board as shown in the two smaller red circles. However as seen in the larger red circle a shadow isn't coming off the component towards the text "J15".

To narrow it down entirely I've used a single Directional Light using specified position coordinates, and I have made sure the view is Prospective not Orthographic. I have also attempted to use a positional light but the light is too dim to be able to see if a shadow would be produced (Can you increase the brightness?) I'm not 100% on the eye situation as I have taken over this project from someone else. So I'm in and out on learning what needs to be done.

Make sure you have evaluated and checked sample "Visualization -> Ray tracing" coming with Draw Harness - it displays a bottle on a desk with enabled shadows.
If sample works on your machine, you can look into script and underlying Draw Harness commands implementation to check what could be missing in your code.

You can also check if Ray Tracing works on your workstation correctly by opening your model in Open CASCADE CAD Assistant (Ray Tracing and its options can be managed in application settings).

Great shout on the CAD Assistant, didn't even think to try that on the designs. So it works flawlessly on the CAD assist, and I've tested the sample Harness and that is working so my code is definitely at fault. I'll keep digging into that and hopefully come back with something