Class ZDepthIdBuffer
java.lang.Object
com.j3d.engine.scene.draw.methods.utils.ZDepthIdBuffer
ZDepthIdBuffer is a high-performance software rasterizer used for object picking.
It renders a scene into an off-screen buffer, storing the UUID of the topmost object
at each pixel, along with its depth. This allows for fast determination of which
objects are visible from the camera's perspective without drawing them to the screen.
The primary optimisations include:
- Integer-based triangle rasterisation using edge functions.
- Incremental depth calculation.
- Efficient collection of unique visible object IDs using a HashSet.
- Author:
- Gemini IntelliJ Plugin
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UUID[][]private final float[][]private final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionZDepthIdBuffer(int width, int height) ZDepthIdBuffer(UUID[][] buffer, float[][] depthBuffer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Processes all layers and returns a list of unique, visible object UUIDs.UUID[][]float[][]voidvoidprivate voidrasterizeObject(GObject obj) voidRasterizes a triangle using an efficient, integer-based edge-function algorithm.
-
Field Details
-
buffer
-
depthBuffer
private final float[][] depthBuffer -
width
private final int width -
height
private final int height
-
-
Constructor Details
-
ZDepthIdBuffer
public ZDepthIdBuffer() -
ZDepthIdBuffer
public ZDepthIdBuffer(int width, int height) -
ZDepthIdBuffer
-
-
Method Details
-
clear
public void clear() -
line
-
point
-
tri
Rasterizes a triangle using an efficient, integer-based edge-function algorithm. This avoids costly floating-point operations per pixel. -
draw
Processes all layers and returns a list of unique, visible object UUIDs. This uses a HashSet for efficient collection of unique IDs. -
rasterizeObject
-
getBuffer
-
getDepthBuffer
public float[][] getDepthBuffer()
-