.. _stdlib_shadow_settings_component: ============== ShadowSettings ============== +++++++ Classes +++++++ .. _struct-shadow_settings_component-ShadowSettings: .. das:attribute:: ShadowSettings : NativeComponent This component is used to setup shadows. Shadows implemented with CSM technic(Cascaded Shadow Maps). It is a method of rendering shadows that allows for high-quality shadows with minimal performance impact. It works by rendering the scene from the light's point of view multiple times, each time with a different camera frustum. The resulting shadow map is then used to render shadows in the scene. To see CSM in editor: Top game panel -> display -> Cascade Shadow Maps For more information about CSM see https://learn.microsoft.com/en-us/windows/win32/dxtecharts/cascaded-shadow-maps To use this component, add the following line to your project file:: require engine.core_components.shadow_settings_component // or require engine.core Usage example:: let setting = create_render_settings() // Set up shadows for small scene get_component(renderSettings) $(var shadows : ShadowSettings?) { shadows.shadowStrength = 0.5 // reduce shadow impact shadows.numCascades = 1 // use only one cascade because our scene is too small shadows.maxDist = 25f // set maximal distance for shadows to 25 meters, it is enough for our scene } :Properties: .. _function-shadow_settings_component__dot__rq_active_ShadowSettings: .. das:operator:: ShadowSettings.active() : bool .. _function-shadow_settings_component__dot__rq_active_rq_clone_ShadowSettings_bool: .. das:operator:: ShadowSettings.active =(value: bool) Active flag. If set to true, shadows render enabling. Default is true. :Arguments: * **value** : bool .. _function-shadow_settings_component__dot__rq_shadowStrength_ShadowSettings: .. das:operator:: ShadowSettings.shadowStrength() : float .. _function-shadow_settings_component__dot__rq_shadowStrength_rq_clone_ShadowSettings_float: .. das:operator:: ShadowSettings.shadowStrength =(value: float) Strength of the shadow. If less 1 reduce shadow impact, if equals to 0 result the same as no shadows at all. It isn't physical correct, but can be used for more nice picture. Default is 1.0. :Arguments: * **value** : float .. _function-shadow_settings_component__dot__rq_cascadeDepthHighPrecision_ShadowSettings: .. das:operator:: ShadowSettings.cascadeDepthHighPrecision() : bool .. _function-shadow_settings_component__dot__rq_cascadeDepthHighPrecision_rq_clone_ShadowSettings_bool: .. das:operator:: ShadowSettings.cascadeDepthHighPrecision =(value: bool) Use high precision texture format for shadow render. If set to true increase memory consuming and reduce performance of shadows rendering and sampling. Default is false. :Arguments: * **value** : bool .. _function-shadow_settings_component__dot__rq_numCascades_ShadowSettings: .. das:operator:: ShadowSettings.numCascades() : int .. _function-shadow_settings_component__dot__rq_numCascades_rq_clone_ShadowSettings_int: .. das:operator:: ShadowSettings.numCascades =(value: int) Number of shadow cascades. Each cascade has performance impact. Default is 2. :Arguments: * **value** : int .. _function-shadow_settings_component__dot__rq_cascadeWidth_ShadowSettings: .. das:operator:: ShadowSettings.cascadeWidth() : int .. _function-shadow_settings_component__dot__rq_cascadeWidth_rq_clone_ShadowSettings_int: .. das:operator:: ShadowSettings.cascadeWidth =(value: int) Resolution of each cascade in pixels. Than resolution is higher than more smooth shadows you can see, but it increase timing for shadow rendering. Default is 1024. :Arguments: * **value** : int .. _function-shadow_settings_component__dot__rq_powWeight_ShadowSettings: .. das:operator:: ShadowSettings.powWeight() : float .. _function-shadow_settings_component__dot__rq_powWeight_rq_clone_ShadowSettings_float: .. das:operator:: ShadowSettings.powWeight =(value: float) Tweak this parameter closer to 1 to make near cascades smaller relative to far cascade. Default is 0.5. :Arguments: * **value** : float .. _function-shadow_settings_component__dot__rq_maxDist_ShadowSettings: .. das:operator:: ShadowSettings.maxDist() : float .. _function-shadow_settings_component__dot__rq_maxDist_rq_clone_ShadowSettings_float: .. das:operator:: ShadowSettings.maxDist =(value: float) Maximal distance for shadow. Out this distance will be no shadows. Default is 50 meters. :Arguments: * **value** : float .. _function-shadow_settings_component__dot__rq_shadowStart_ShadowSettings: .. das:operator:: ShadowSettings.shadowStart() : float .. _function-shadow_settings_component__dot__rq_shadowStart_rq_clone_ShadowSettings_float: .. das:operator:: ShadowSettings.shadowStart =(value: float) Offset for shadow rendering. It can increase quality of shadows in case when there is no objects near with camera. Default is 0.0. :Arguments: * **value** : float