Render to Texture (Legacy 3DS MAX)
- Last UpdatedApr 02, 2025
- 2 minute read
Render to Texture
A RenderToTexture is a realtime engine-generated texture that is represented by a dummy object whose user buffer presents a $RenderToTexture structure.
Note: It is not necessary to exclude the meshes that use this texture from the rendering of the same texture (through the parameter szExcludeMesh) because the engine will do it automatically.
Code example
A code example for RenderToTexture.
$RenderToTexture
{
szID = RealTimeTextureA
szTextureDetail = High
szGeometryDetail = Medium
iRefreshFrameRate = 12
c3BkgColor = 0.2 0 0.1
szCameraName = VideoCamera
$Commands
{
szExcludeMesh = MeshConTroppiPoligoni
}
}
Texture dimensions
If the dimensions go beyond the frame buffer resolution, the first power dimension of two that is smaller than the frame buffer will be chosen.
|
Detail Level |
Resolution |
|---|---|
|
lowest |
64×64 |
|
low |
128×128 |
|
medium |
256×256 |
|
high |
512×512 |
|
highest |
1024×1024 |
Parameters
szID
-
Identifier (name) of the texture that will be created.
szTextureDetail
-
Texture size.
-
Default: high
-
Range: [lowest .. highest]
szGeometryDetail
-
Level of detail of the geometry rendered in the texture.
-
Default: medium
-
Valid values: medium, high.
iRefreshFrameRate
-
Indicates how many frames the texture will be updated.
-
If the value is zero (0) or negative, the texture will be updated to each frame.
-
Default: -1
-
Range [-inf..inf]
c3BkgColor
-
Background color.
-
Default: 0.1 0.1 0.1
-
RGB: [0..1]
szCameraName
-
The name of the chamber that will be used to render the texture.
$Commands
-
Structure that contains extra commands for creating and rendering the texture.
$Commands Parameters
szIncludeMesh
-
Includes this mesh in texture rendering; automatically excluding all other scene meshes.
-
In practice, when using this parameter, you must manually specify all the meshes to draw.
-
When using this parameter, its inverse (for example, szExcludeMesh) can not be used.
-
This parameter is optional, and can be repeated multiple times.
szExcludeMesh
-
Excludes this mesh in texture rendering.
-
When using this parameter, its inverse (for example, szIncludeMesh) can not be used.
-
This parameter is optional, and can be repeated multiple times.