kmSetCheapShadowMode
Sets the cheap shadow mode.
Description:
This function selects the cheap (simple) shadow mode.
The cheap shadow mode is intended to represent the shadow of polygons by lowering their luminance when they approach the modifier volume.
After cheap shadow mode has been set by this function, all the modifier volume are set in cheap shadow mode.
Coexistence with two-parameter polygons in a scene is not allowed.
To terminate cheap shadow mode, enter a negative number as the argument, then call this function.
To turn cheap shadow mode on and off when using KMSTRIPCONTEXT, set the CheapShadow mode effect in nShadowMode. When using KMVERTEXCONTEXT, enable cheap shadow mode by issuing this function before executing kmSetVertexRenderState. Once cheap shadow mode has been turned on, it is not necessary to execute kmSetVertexRenderState when changing only the intensity of shadows.
Similarly to the two-parameter volume, KM_MODIFIER_A is set in the SelectModifier member of the VERTEXCONTEXT for the polygons to be influenced by the cheap shadow mode.
The vertex data used consists of regular one-parameter polygons.
Parameters:
nIntensity(input)
This parameter sets the luminance of a polygon in the modifier volume, using a value from 0 to 255.
The hardware multiplies the base color and offset color for the polygon by the specified value after it is divided by 256.
If the parameter specifies 128, the multiplier is 0.5 (= 128/256).
If a negative value is input, the setting of cheap shadow mode is completed, and the normal 2-parameter polygon becomes valid from the scene.
Return values:
Value | Explanation |
---|---|
KMSTATUS_SUCCESS | Success |
KMSTATUS_INVALID_PARAMETER | Invalid parameter |
kmSetCheapShadowMode