Class Volume
- All Implemented Interfaces:
com.badlogic.ashley.core.Component
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]Number of iterations for the ray-marching volume shader, per quality preset.intstatic final Logger.LogbooleanWhether this volume takes part in the depth-only pre-pass. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetIterationCount(int[] iterations) Alias tosetIterations(int[]).voidsetIterationCount(Long iterations) Alias tosetIterations(Long).voidsetIterations(int[] iterations) Sets the iteration count for the ray-marcher on this volume.voidsetIterations(Long iterations) Sets the iteration count for the ray-marcher on this volume.voidsetRaymarchIterations(int[] iterations) Alias tosetIterations(int[]).voidsetRaymarchIterations(Long iterations) Alias tosetIterations(Long).voidsetWriteDepth(Boolean writeDepth) Setter used by the scene JSON loader.
-
Field Details
-
logger
-
vertexShader
-
fragmentShader
-
key
public int key -
writeDepth
public boolean writeDepthWhether this volume takes part in the depth-only pre-pass. Enabled by default.A volume can be a real occluder: its box spans a region of space, and the fragment shader writes the depth of the first sample dense enough to hide what is behind it, so anything drawn after the volume pass (labels, grids, stars, planets) is hidden behind it. Without the write, a ray that crosses dust but no gas emits no colour at all - the dust only attenuates - so everything behind the dust shows through it. Set to false to restore the read-only, always-see-through behaviour.
Which volumes actually occlude is decided per slot, by
MaterialComponent.volumeDepthThreshold: an emissive volume such as gas normally carries no threshold and stays transparent to the depth buffer, while the absorbing one (dust) carries one, so only its dense lanes hide anything. With no threshold set on any slot this flag has no visible effect, and the pre-pass is wasted work. -
iterations
public int[] iterationsNumber of iterations for the ray-marching volume shader, per quality preset.
-
-
Constructor Details
-
Volume
public Volume()
-
-
Method Details
-
setWriteDepth
-
setIterations
Sets the iteration count for the ray-marcher on this volume.- Parameters:
iterations- Single value: same iteration count for all graphics qualities. The JSON loader hands over a scalar integer asLong, so this must take a Long for the reflective lookup to find it.
-
setRaymarchIterations
Alias tosetIterations(Long). -
setIterationCount
Alias tosetIterations(Long). -
setIterations
public void setIterations(int[] iterations) Sets the iteration count for the ray-marcher on this volume.- Parameters:
iterations- Array of integers, one per graphics quality [LOW, NORMAL, HIGH, ULTRA].
-
setRaymarchIterations
public void setRaymarchIterations(int[] iterations) Alias tosetIterations(int[]). -
setIterationCount
public void setIterationCount(int[] iterations) Alias tosetIterations(int[]).
-