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.
|Volume|{{RootFieldType|AssetRef`1|[[Type:Texture3D|Texture3D]]}}|TypeAdv5=true| The 3D texture this material should display.
|StepSize|Float|
|StepSize|Float| How many cell details there should be.
|Gain|Float|
|Gain|Float| How much to gain up the color.
|Exp|Float|
|Exp|Float| What exponent to raise colors to.
|AccumulationCutoff|Float|
|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|
|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|
|InputOffset|Float| at what point does the range start?
|UseAlphaChannel|Bool|
|UseAlphaChannel|Bool| Whether to use the alpha channel in the pixel data of <code>Volume</code>.
|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.
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
{{stub}}
== DisplayMode ==
{{Table EnumValues
|Additive|0| is an "add up over all of the times the ray has intersected the volume" statement.
|AdditiveCutoff|1| is an "add up over all of the times the ray has intersected the volume" statement. Respects alpha cutoff.
|HitThreshold|2| a binary "has the ray hit the volume or not?".
}}
== SlicePlane ==
{{Table TypeFields
|Normal|Float3| The normal direction of the slice in local space.
|Offset|Float| The position of the slice in local space.
}}
== Highlight ==
{{Table TypeFields
|Normal|Float3| the normal of the plane which defines its orientation in local space.
|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| The "thickness" of the color to add to the volume. This is done on both sides of the plane evenly.
|Color|ColorX| The color to override with.
}}
<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
* Khawn2u's RTX world with sunbeams.
* 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.
[[Category:Components With Nested Types{{#translation:}}|Volume Unlit Material]]
Latest revision as of 21:49, 6 February 2025
Component image
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.