SetVolumetricShadowsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(create new page)
 
m (correct beta version)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Client function}}  
{{Client function}}  
__NOTOC__
__NOTOC__
{{Added feature/item|1.6.1|1.6.0|22721|
This function used to enable or disable volumetric shadows.
}}


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setVolumetricShadowsEnabled( bool state )
bool setVolumetricShadowsEnabled ( bool state )
</syntaxhighlight>  
</syntaxhighlight>  


Line 16: Line 19:
This example check if volumetric shadows enabled, if not enabled then enable it and set the shadow alpha.
This example check if volumetric shadows enabled, if not enabled then enable it and set the shadow alpha.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
if not( isVolumetricShadowsEnabled () ) then -- check if the volumetric shadows not enabled
if not ( isVolumetricShadowsEnabled () ) then -- check if the volumetric shadows not enabled
     setVolumetricShadowsEnabled( true )
     setVolumetricShadowsEnabled ( true )
     setWorldProperty ( "ShadowStrength", 500 ) -- set shadows alpha
     setWorldProperty ( "ShadowStrength", 500 ) -- set shadows alpha
else
else
Line 25: Line 28:


==See Also==
==See Also==
{{Client world functions}}
{{World functions|client}}

Latest revision as of 16:52, 10 September 2024

BETA: NEW FEATURE (BUILD: 1.6.0 r22721)

This function used to enable or disable volumetric shadows.

Syntax

bool setVolumetricShadowsEnabled ( bool state )

Required arguments

  • state: if set true it will enable the volumetric shadows, false otherwise.

Returns

Always returns true.

Example

This example check if volumetric shadows enabled, if not enabled then enable it and set the shadow alpha.

if not ( isVolumetricShadowsEnabled () ) then -- check if the volumetric shadows not enabled
    setVolumetricShadowsEnabled ( true )
    setWorldProperty ( "ShadowStrength", 500 ) -- set shadows alpha
else
    setWorldProperty ( "ShadowStrength", 500 )
end

See Also