本文整理汇总了Java中net.minecraft.client.shader.Framebuffer.enableStencil方法的典型用法代码示例。如果您正苦于以下问题:Java Framebuffer.enableStencil方法的具体用法?Java Framebuffer.enableStencil怎么用?Java Framebuffer.enableStencil使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.shader.Framebuffer
的用法示例。
在下文中一共展示了Framebuffer.enableStencil方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFrameBuffer
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
public static Framebuffer createFrameBuffer(boolean useDepth, boolean useStencil)
{
Framebuffer render = new Framebuffer(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, useDepth);
if(useStencil && canUseStencils())
{
render.enableStencil();
}
frameBuffers.add(render);
return render;
}
示例2: checkEnableStencil
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
/**
* Checks if stencil buffer is supported and attempts to enable it if so.
*/
public static boolean checkEnableStencil() {
Framebuffer fb = Minecraft.getMinecraft().getFramebuffer();
return fb.isStencilEnabled() || fb.enableStencil();
}
示例3: setup
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
public void setup() {
Preconditions.checkState(!isInitialized, "Double initialization");
isInitialized = true;
if (!Config.renderSkyBlocks) {
Log.info("Disabled by config");
return;
}
if (FMLClientHandler.instance().hasOptifine()) {
if (Config.skyBlocksOptifineOverride) {
Log.warn("Optifine detected: skyblocks + shaders may hang your game");
} else {
Log.info("Disabled due to Optifine (use `optifineOverride` config to override)");
return;
}
}
if (!OpenGlHelper.isFramebufferEnabled()) {
Log.info("Framebuffer not enabled");
return;
}
if (!FramebufferBlitter.INSTANCE.isValid()) {
Log.info("Framebuffer blit not enabled");
return;
}
if (!PreWorldRenderHookVisitor.isActive()) {
Log.info("Pre-world render hook not active");
return;
}
final Framebuffer mcFb = Minecraft.getMinecraft().getFramebuffer();
if (!mcFb.isStencilEnabled() && !mcFb.enableStencil()) {
Log.info("Stencil not enabled");
return;
}
final int stencilBit = MinecraftForgeClient.reserveStencilBit();
if (stencilBit < 0) {
Log.info("All stencil bits reserved");
return;
}
PreWorldRenderHookVisitor.setHook(new SkyCapture());
Log.debug("Sky block rendering initialized correctly, stencilBit = %d", stencilBit);
stencilMask = 1 << stencilBit;
isActive = true;
}