Component:VolumeUnlitMaterial: Difference between revisions

From Resonite Wiki
Automated: update component fields
add remaining info
 
(9 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=VolumeUnlitMaterialComponent.png
|Image=VolumeUnlitMaterialComponent.png
|Name=Volume Unlit Material
|Name=Volume Unlit Material
}}
}}
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-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|HighPriorityIntegration|Bool|
|HighPriorityIntegration|Bool|{{Asset HighPriorityIntegration Field}}
|_shader|{{RootFieldType|AssetRef`1|[[Type:Shader|Shader]]}}|TypeAdv1=true|
|_shader|{{RootFieldType|AssetRef`1|[[Type:Shader|Shader]]}}|TypeAdv1=true| Internal.
|Mode|DisplayMode|
|Mode|'''[[#DisplayMode|DisplayMode]]'''|TypeAdv2=true| How to display the texture in 3D space.
|BlendMode|BlendMode|
|BlendMode|BlendMode|{{Template:Material_BlendMode_Desc}}
|RenderQueue|Int|
|RenderQueue|Int|{{Template:Material_RenderQueue_Desc}}
|Volume|{{RootFieldType|AssetRef`1|[[Type:Texture3D|Texture3D]]}}|TypeAdv5=true|
|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>.
|Slices|{{RootFieldType|SyncList`1|[[Type:SlicePlane|SlicePlane]]}}|TypeAdv14=true|
|Slices|{{RootFieldType|SyncList`1|[[#SlicePlane|SlicePlane]]}}|TypeAdv14=true| Slice planes that cut the volume along local positions and directions.
|Highlights|{{RootFieldType|SyncList`1|[[Type:Highlight|Highlight]]}}|TypeAdv15=true|
|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.
</gallery>


<!--T:5-->
<!--T:5-->
== Related Components ==
== See Also ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Volume Unlit Material]]
[[Category:Components{{#translation:}}|Volume Unlit Material]]
[[Category:Components:Assets:Materials:Volume{{#translation:}}|Volume Unlit Material]]
[[Category:Components:Assets:Materials:Volume{{#translation:}}|Volume Unlit Material]]
[[Category:Components With Nested Enums{{#translation:}}|Volume Unlit Material]]
[[Category:Materials:Volume{{#translation:}}|Volume Unlit Material]]
[[Category:Materials{{#translation:}}|Volume Unlit Material]]
[[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.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
HighPriorityIntegration Bool 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.
_shader Shader Internal.
Mode DisplayMode How to display the texture in 3D space.
BlendMode BlendMode How to blend this material's colors vs what it rendered on top of.
RenderQueue Int changes at which point a material renders on the render stack
Volume Texture3D The 3D texture this material should display.
StepSize Float How many cell details there should be.
Gain Float How much to gain up the color.
Exp Float What exponent to raise colors to.
AccumulationCutoff Float if color goes beyond this brightness, don't render it.
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.
InputOffset Float at what point does the range start?
UseAlphaChannel Bool Whether to use the alpha channel in the pixel data of Volume.
Slices list of SlicePlane Slice planes that cut the volume along local positions and directions.
Highlights list of Highlight A list of planes with offsets which define a region of the volume to override the color of.

Usage

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


DisplayMode

Values
Name Value Description
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

Fields
Name Type Description
Normal Float3 The normal direction of the slice in local space.
Offset Float The position of the slice in local space.

Highlight

Fields
Name Type Description
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.

Examples

  • Khawn2u's RTX world with sunbeams.
  • displays for imported 3D textures

See Also