Interface ReadableDepthRenderTarget
- All Known Implementing Classes:
DepthRenderTargetMixin
RenderTarget when the feature is enabled in the config.
This allows access to a depth texture that the render target writes to instead of the usual render buffer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidFreezes the current depth texture for use ingetStillDepthMap().static voidfreezeDepthMap(com.mojang.blaze3d.pipeline.RenderTarget target) static ReadableDepthRenderTargetgetFrom(com.mojang.blaze3d.pipeline.RenderTarget target) intReturns a still of this render target's depth texture.static intgetStillDepthMap(com.mojang.blaze3d.pipeline.RenderTarget target)
-
Method Details
-
getStillDepthMap
@API(status=EXPERIMENTAL) int getStillDepthMap()Returns a still of this render target's depth texture. For most intents and purposes, this is the texture that API consumers should read from.This texture is updated only when
freezeDepthMap()is called. For the main render target, it is updated automatically right beforePostLevelRenderCallback.EVENTis fired. Note that the content of the main render target's depth texture depends on the graphic quality setting. WithGraphicsStatus.FABULOUS, no translucent object will appear on the main depth texture, so consumers may need to also use the depth textures from the various layers used by theLevelRenderer's transparency shader.Because this texture is independent from the render target's actual depth texture, it is safe to use anytime (whereas using the actual depth texture may cause corruption if it is simultaneously written to).
The returned value may be -1 if the render target does not have a depth attachment. This should never be the case for the main render target.
- Returns:
- a still of this render target's depth texture
-
freezeDepthMap
@API(status=EXPERIMENTAL) void freezeDepthMap()Freezes the current depth texture for use ingetStillDepthMap().This is called by default on the
Minecraft.getMainRenderTarget()main render target once every frame, right beforePostLevelRenderCallbackis fired.Calling this method will bind
thisrender target. -
getFrom
-
getStillDepthMap
static int getStillDepthMap(com.mojang.blaze3d.pipeline.RenderTarget target) -
freezeDepthMap
static void freezeDepthMap(com.mojang.blaze3d.pipeline.RenderTarget target)
-