Package limn.render3d
Interface RenderPass
public interface RenderPass
The draw interface handed to a render callback (see
Graphics3D.render(target, camera, body)). The target is already bound
with depth testing on and the camera's view/projection set; issue
clear(float, float, float, float) then draw(limn.render3d.GpuMesh, limn.render3d.Material, limn.math.Mat4) calls. Low-level and explicit: you place
every mesh yourself.-
Method Summary
Modifier and TypeMethodDescriptionAdds an analytic light forMaterial.Pbr(up to 8; extras are ignored).Flat ambient/environment term for PBR (linear color; a stand-in for IBL).default RenderPassbloom(float threshold, float intensity, float radius) Adds a bright-pass glow to this pass's result, in linear light, before the display transform: pixels brighter thanthresholdspread by a blur ofradius, andintensityof the result is added back into the target during the pass's own teardown.clear(float r, float g, float b, float a) Clears the color and depth of the target.default voiddebugLines(float[] vertices, int vertexCount, boolean depthTested) Submits immediate debug lines, usually viaDebugDraw.flush(limn.render3d.RenderPass), not directly.voidDrawsmeshwithmaterialat the world transformmodel.default voiddrawShadowOnly(GpuMesh mesh, Mat4 model) Buffersmeshfor the shadow depth pass only: a caster outside the camera frustum must still darken visible receivers, so retained scenes route their camera-culled meshes here when shadows are on.environment(Environment environment, IrradianceSh irradiance) Sets the image-based lighting environment for the PBR pass: diffuse from the bakedirradiance(SH), specular from the environment's analytic sky, plus a skybox background.exposure(float exposure) Exposure multiplier for this pass's output (default 1).Sets the single directional light used byMaterial.SimpleLit(direction points toward the light;ambientin [0,1]).Enables a directional shadow map for the PBR pass: the backend renders scene depth fromdirection(pointing toward the light) into an offscreen depth target fitted to a sphere ofradiusaroundcenter, and shadows the directional lights with PCF.
-
Method Details
-
clear
Clears the color and depth of the target. The color is authored sRGB with straight alpha, like every other authored color; the backend decodes it to linear and premultiplies on write, per the target's color space. -
light
Sets the single directional light used byMaterial.SimpleLit(direction points toward the light;ambientin [0,1]). Ignored by unlit and PBR materials. -
addLight
Adds an analytic light forMaterial.Pbr(up to 8; extras are ignored). Independent oflight(limn.math.Vec3, limn.math.Vec3, float): SimpleLit reads that one, PBR reads these. Colors are linear. -
ambient
Flat ambient/environment term for PBR (linear color; a stand-in for IBL). -
exposure
Exposure multiplier for this pass's output (default 1). Part of the display transform, not of the scene-referred pixels: it is recorded on the target and applied (before the tonemap) when the 2D composite draws it. -
bloom
Adds a bright-pass glow to this pass's result, in linear light, before the display transform: pixels brighter thanthresholdspread by a blur ofradius, andintensityof the result is added back into the target during the pass's own teardown. Bloom is scene-side;exposure(float)is display-side. They compose in that order and do not interact.- Parameters:
threshold- linear scene-referred light above which a pixel contributes; 1 means "brighter than a fully-lit white surface", the useful floorintensity- how much of the blurred result is added; 0 (the default) disables bloom entirely: no allocation, no passradius- the blur's standard deviation in points, the toolkit's logical unit (the backend converts to texels), so a glow keeps its size across display scales and viewport resizes. Below a small minimum the backend refuses to run rather than answer with a glow wider than asked; its half-res chain cannot blur narrower. Default: ignored (headless/test passes).
-
shadow
Enables a directional shadow map for the PBR pass: the backend renders scene depth fromdirection(pointing toward the light) into an offscreen depth target fitted to a sphere ofradiusaroundcenter, and shadows the directional lights with PCF. Call once per pass; last wins. -
environment
Sets the image-based lighting environment for the PBR pass: diffuse from the bakedirradiance(SH), specular from the environment's analytic sky, plus a skybox background. Passnullto disable (flat ambient is used). -
draw
Drawsmeshwithmaterialat the world transformmodel. -
drawShadowOnly
Buffersmeshfor the shadow depth pass only: a caster outside the camera frustum must still darken visible receivers, so retained scenes route their camera-culled meshes here when shadows are on. No color-pass cost. Default: ignored (passes without shadow support). -
debugLines
default void debugLines(float[] vertices, int vertexCount, boolean depthTested) Submits immediate debug lines, usually viaDebugDraw.flush(limn.render3d.RenderPass), not directly.verticesholdsvertexCountworld-space vertices interleaved as [x, y, z, r, g, b, a] (seeDebugDraw.FLOATS_PER_VERTEX), two per line segment; the array is read before the pass's render call returns and may be longer than the used prefix. Debug lines never cast shadows.depthTestedselects occlusion by scene geometry versus drawing on top ("X-ray"). Default: ignored (headless/test passes).
-