bmap
Defines a render target for the view.
The view
and all assigned view entities
then render into the bitmap
rather than on the screen.
This way views
can be rendered on entities, on panels,
into environment maps, or a view rendering chain can be defined
for complex pre- and postprocessing effects, such as shadow mapping.
Type:
BMAP*
or A7.10 char*
Remarks:
- A7.10 LC
In a VIEW definition, the name of an image file, or a bitmap format string (see BMAP) can be given alternatively to a bitmap pointer.
-
The bitmap is automatically converted
to a render target format
and not accessible anymore for pixel operations.
The view's pos_x/pos_y and size_x/size_y parameters
define an offset and target area on the bmap.
A7.10 For rendering into an environment map, set the view pos_x parameter to the pixel position of the beginning of the face you want to render into.
-
After rendering, the global render_target pointer
is set to the bmap, making it available to shaders and
following view stages through the TargetMap texture
parameter. It can be used for combining further effects with the image content.
-
If a view has a following stage without PROCESS_SCREEN flag,
but no
view.bmap assigned, a render target
is
automatically created with the current size of the view.
-
Normally the render target uses the same z buffer as the screen, and thus must not be bigger than the screen resolution;
otherwise create a z buffer through bmap_zbuffer.
If a render target is bigger than the screen resolution and a z buffer was not created, versions before A7.84 reduced the target size to the screen resolution. From A7.84 a z buffer of the right size is automatically created. From A7.86 the old behavior can be restored by setting the compatibility variable at 10 or below.
- Normally 3D hardware can not use the same texture as render source
and render target. Don't render onto a
texture that is visible in the same view.
- For converting the bitmap back to a pixel-accessible format, set
the view.bmap parameter back to NULL to prevent
further rendering, and use the
bmap_to_format function.
-
For rendering into a certain face of a cubic environment map, use the view.pos_x parameter to give the pixel offset of the face.
-
For multiple render targets, use
the target1...target3 parameters.
Edition:
C
Examples (lite-C):
VIEW* viewDepth =
{
bmap = "#256x256x14"; // create a 256x256 floating point render target
flags = SHOW | SHADOW | NOSHADOW;
material = mtlDepth;
}
...
VIEW* remote_camera = { layer = 1; }
...
remote_camera.bmap = bmap_for_entity(monitorsprite,0); // render view on monitorsprite
set(remote_camera,SHOW); // render this view
See also:
VIEW, BMAP, stage, PROCESS_SCREEN
/ PROCESS_TARGET, bmap_for_entity,
bmap_to_format,
bmap_rendertarget, bmap_zbuffer
► latest
version online