当前位置: 首页>>代码示例>>Java>>正文


Java Framebuffer.enableStencil方法代码示例

本文整理汇总了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;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:11,代码来源:RendererHelper.java

示例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();
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:8,代码来源:RenderUtils.java

示例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;
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:52,代码来源:SkyBlockRenderer.java


注:本文中的net.minecraft.client.shader.Framebuffer.enableStencil方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。