occt-samples-qopenglwidget icon indicating copy to clipboard operation
occt-samples-qopenglwidget copied to clipboard

Light and shadows in viewer

Open yvanblanchard opened this issue 1 year ago • 2 comments

Hello Is it possible to include soft or hard shadows in your occt viewer ? Or maybe indicate the few code lines to add? Thank you

yvanblanchard avatar May 31 '23 21:05 yvanblanchard

You may activate real-time shadows from directional light sources. https://draw.sview.ru/visualization-shadows/

See Graphic3d_CLight::ToCastShadows() property of light source and Graphic3d_RenderingParams::ShadowMapResolution, ShadowMapBias properties to adjust rendering quality within V3d_View/V3d_Viewer.

Note that to see shadows you might want disabling headlight flag or adjusting its direction (otherwise shadows will be directed from the eye).

You may also play with Path Tracing (global illumination + Ray Tracing) options if you want creating a photorealistic screenshot.

gkv311 avatar Jun 01 '23 06:06 gkv311

Screenshot_20230601-092411

gkv311 avatar Jun 01 '23 06:06 gkv311