The '''VolumeUnlitMaterial''' component is used to display 3d textures like Xrays, sunbeams, MRIs, CT scans, or any other 3d texture in a volumetric 3d cube that can optionally be sliced. Can also be used for volumetric lighting, but high texture resolutions can be large and cause considerable render lag.
The '''VolumeUnlitMaterial''' component is used to display 3d textures like Xrays, sunbeams, MRIs, CT scans, or any other 3d texture in a volumetric 3d cube that can optionally be sliced. Can also be used for volumetric lighting, but high texture resolutions can be large and cause considerable render lag.
This is a [https://en.wikipedia.org/wiki/Ray_marching raymarched] material, which means that a ray is stepped iteratively closer and closer to the volume in order to determine what is shown or not.
<!--T:2-->
<!--T:2-->
Line 21:
Line 23:
|Exp|Float| What exponent to raise colors to.
|Exp|Float| What exponent to raise colors to.
|AccumulationCutoff|Float| if color goes beyond this brightness, don't render it.
|AccumulationCutoff|Float| if color goes beyond this brightness, don't render it.
|HitThreshold|Float|
|HitThreshold|Float| tells what value to consider a hit. Any value above this is drawn, and any other value below this is culled.
|InputRange|Float| What range duration within 0<->1 do the colors in the 3d image have? Useful for isolating particular ranges for densities in a CT scan.
|InputRange|Float| What range duration within 0<->1 do the colors in the 3d image have? Useful for isolating particular ranges for densities in a CT scan.
|InputOffset|Float| at what point does the range start?
|InputOffset|Float| at what point does the range start?
|UseAlphaChannel|Bool| Whether to use the alpha channel in the pixel data of <code>Volume</code>.
|UseAlphaChannel|Bool| Whether to use the alpha channel in the pixel data of <code>Volume</code>.
|Slices|{{RootFieldType|SyncList`1|[[#SlicePlane|SlicePlane]]}}|TypeAdv14=true| Slice planes that cut the volume along local positions and directions.
|Slices|{{RootFieldType|SyncList`1|[[#SlicePlane|SlicePlane]]}}|TypeAdv14=true| Slice planes that cut the volume along local positions and directions.
|Highlights|{{RootFieldType|SyncList`1|[[#Highlight|Highlight]]}}|TypeAdv15=true| A list of Highlights to use.
|Highlights|{{RootFieldType|SyncList`1|[[#Highlight|Highlight]]}}|TypeAdv15=true| A list of planes with offsets which define a region of the volume to override the color of.
}}
}}
Line 36:
Line 38:
{{Table EnumValues
{{Table EnumValues
|Additive|0| Volumetric adds onto the color of things behind it unclamped.
|Additive|0| is an "add up over all of the times the ray has intersected the volume" statement.
|AdditiveCutoff|1| Volumetric adds onto the color of things behind it clamped.
|AdditiveCutoff|1| is an "add up over all of the times the ray has intersected the volume" statement. Respects alpha cutoff.
|HitThreshold|2|
|HitThreshold|2| a binary "has the ray hit the volume or not?".
}}
}}
Line 49:
Line 51:
== Highlight ==
== Highlight ==
{{Table TypeFields
{{Table TypeFields
|Normal|Float3|
|Normal|Float3| the normal of the plane which defines its orientation in local space.
|Offset|Float|
|Offset|Float| How far from the center of the volume to offset the plane in the inverse of its normal direction. (For some reason it is the negative of the normal) This is done in local space.
|Range|Float|
|Range|Float| The "thickness" of the color to add to the volume. This is done on both sides of the plane evenly.
|Color|ColorX|
|Color|ColorX| The color to override with.
}}
}}
Line 61:
Line 62:
* Khawn2u's RTX world with sunbeams.
* Khawn2u's RTX world with sunbeams.
* displays for imported 3D textures
* displays for imported 3D textures
<gallery width=480px height=480px>
Volumetric_Highlights_Example.webp|This is an originally entirely white volume with a highlight plane which has a normal of <code><0,1,0></code>, with no offset, making it centered in the volume. Its range is <code>0.05</code> which gives it that thickness. If it was <code>0.5</code> this would fill the entire cube, since the volume is size <code><1,1,1></code> and this thickness is applied in both directions.
Volumetric_HitThreshold_Example.png|In the one on the right the threshold is <code>0.34</code>, however the red part of the volume has a value of exactly <code>1/3</code>, meaning that this gets culled, whereas the one on the left the threshold is <code>0.28</code> and the red streak passes the hit test and is drawn.
Volume Unlit Material component as seen in the Scene Inspector
The VolumeUnlitMaterial component is used to display 3d textures like Xrays, sunbeams, MRIs, CT scans, or any other 3d texture in a volumetric 3d cube that can optionally be sliced. Can also be used for volumetric lighting, but high texture resolutions can be large and cause considerable render lag.
This is a raymarched material, which means that a ray is stepped iteratively closer and closer to the volume in order to determine what is shown or not.
If true, integrating this asset (e.g. processing procedural assets) gets higher priority than assets with this flag off. An example is user laser procedural meshes.
How far from the center of the volume to offset the plane in the inverse of its normal direction. (For some reason it is the negative of the normal) This is done in local space.
This is an originally entirely white volume with a highlight plane which has a normal of <0,1,0>, with no offset, making it centered in the volume. Its range is 0.05 which gives it that thickness. If it was 0.5 this would fill the entire cube, since the volume is size <1,1,1> and this thickness is applied in both directions.
In the one on the right the threshold is 0.34, however the red part of the volume has a value of exactly 1/3, meaning that this gets culled, whereas the one on the left the threshold is 0.28 and the red streak passes the hit test and is drawn.