render_stencil
StencilMap
Stencil buffer target for a view. If a bitmap is assigned to this pointer, the
content of the stencil buffer is copied into this bitmap after rendering, instead
of drawn over the screen. This way postprocessing effects can be applied to the
stencil buffer, such as blurring
stencil shadows. The stencil target texture
is available to shaders through the texture variable
StencilMap.
Type:
BMAP* (lite-c)
texture (shader code)
Remarks:
- The bitmap assigned to render_stencil must have at least the same
size as the screen buffer, i.e. screen_size.x and screen_size.y.
When changing the video resolution, take care that the render_stencil bitmap
does not have a smaller size than the screen buffer. Assign a bitmap that
is large enough for the maximum resolution.
- Assigning a bitmap to render_stencil causes
the stencil buffer content to be drawn into the bitmap regardless if
stencil shadows are used or not. This affects the frame rate, so don't
set this pointer unnecessarily.
-
Set the PROCESS_SCREEN flag for a shader that blends the stencil buffer over the screen buffer. If the view uses a render target or a postprocessing stage, the shader can not blend the stencil buffer over the screen buffer (because there is none); instead the shader must blend the render_stencil over the render_target of the previous view. This is a little more expensive because two samplers are required.
Edition:
A7.07C LC
Example:
See render_target
See also:
VIEW, BMAP, view.bmap, view.stage,
view.material,
render_target,
render_zbuffer, PROCESS_SCREEN
► latest
version online