volumetricRaymarchRender3D
Renderer that uses raymarching with volumes instead of SDFs.
Note that this renderer is actively being developed, so it may have some bugs or limitations.
This renderer uses steps that have a constant size, rather than stepping different distances based on how far an SDF says they are from the surface. This makes it more suitable for volumes that are based on fields of density rather than SDFs.
There are two main modes: Solid and Cloud.
Solid mode behaves similarly to regular raymarching, where the rays stop once they hit an area with a density of 1 or more. Then it uses shading similar to a regular raymarchRender3D
. This mode works best with volumes that are based on SDFs.
Cloud mode sends rays through the volume, and at each step, it checks the density of the volume. Rays don’t stop marching until they go through the bounding area. The density and color accumulate as the rays go through the volume to produce the final results.
Parameters
Name | Description | Regular Handling | Read-Only Handling |
---|---|---|---|
March Mode | Raymarching approach to use. | Semi-Baked | Semi-Baked |
| |||
Step Size | The size of each marching step. Smaller steps will produce more accurate results but will be slower. | Runtime | Baked |
Area Mode | How to define the area that the rays will march through. | Semi-Baked | Semi-Baked |
| |||
Area Center | Center of the scene bounding box. | ||
Area Size | Size of the scene bounding box. | ||
Dist Range | Minimum and maximum distances where the rays start and end. | ||
Max Distance | Maximum distance. Rays that don’t hit anything will stop at this distance. This is applied on top of the bounding area, so it can generally be fairly high. | Runtime | Baked |
Resolution | Rendering resolution | ||
Pixel Format | |||
| |||
Enable Normal Output | Enable producing normal vectors. For each point, this will produce a vector pointing in the direction that the nearest surface point is facing. These values can be accessed using a | ||
Enable Object Id Output | Enable object ID output, which produces a TOP with values assigned with the | ||
Enable Debug Output | |||
Enable Custom Output 1 | |||
Enable Custom Output 2 | |||
Enable Depth Output | Enables the depth output buffer. | ||
Enable World Pos Output | Enables the world xyz position output buffer. | ||
Enable Ray Origin Output | Enables the ray origin (camera position) output buffer. | ||
Enable Ray Direction Output | Enables the ray direction output buffer. | ||
Ray Marching | |||
Max Steps | Maximum number of marching steps. If this is too low, the rays may stop before they finish going through the scene area. | Semi-Baked | Semi-Baked |
Refinement Steps | Number of steps to take to refine the final position of the ray. This can help reduce artifacts for solid mode. | Semi-Baked | Semi-Baked |
Enable Normal Smoothing | Enable normal smoothing. This will average the normals of nearby points to produce a smoother result. | Baked | Baked |
Normal Smoothing | Distance to use for normal smoothing. | Runtime | Baked |
Time Reference Operator | |||
Shader Builder Config | |||
Customize Shader Config | |||
Ray Offset Field | |||
Ray Offset Amount | Runtime | Runtime |
Inputs
-
Volume
: (required) Volume that the rays will march through. This must be a Volume and not an SDF.- Coordinate Types:
vec3
- Context Types:
Context
- Return Types:
Volume
- Coordinate Types:
-
Camera
: (optional)- Coordinate Types:
vec2
- Context Types:
CameraContext
- Return Types:
Ray
- Coordinate Types:
-
Light
: (optional)- Coordinate Types:
vec3
- Context Types:
LightContext
- Return Types:
Light
- Coordinate Types:
-
rayOffsetField
: (optional)- From Parameter:
Ray Offset Field
- Coordinate Types:
vec2
- Context Types:
Context
- Return Types:
float
- From Parameter: