Jump to content

[1.11.2] Stencil does not work after build


Minebot1708

Recommended Posts

Hello everybody
I wrote a render with a stencil:

       int bit = MinecraftForgeClient.reserveStencilBit();
       int flag = 1 << bit;

       glDisable(GL_TEXTURE_2D);
       glEnable(GL_STENCIL_TEST);
       glStencilFunc(GL_ALWAYS, flag, flag);
       glStencilOp(GL_ZERO, GL_ZERO, GL_REPLACE);
       glStencilMask(flag);
       glColorMask(false, false, false, false);
       glDepthMask(false);
       glClearStencil(0);
       glClear(GL_STENCIL_BUFFER_BIT);

       // Render pattern by tesselator

       glEnable(GL_TEXTURE_2D);
       glStencilFunc(GL_EQUAL, flag, flag);
       glStencilMask(0);
       glColorMask(true, true, true, true);
       glDepthMask(true);

       // Render other primitives by tesselator

       glDisable(GL_STENCIL_TEST);
       MinecraftForgeClient.releaseStencilBit(bit);


In the ClientProxy, in preInit I enabled the stencil:

       if (!Minecraft.getMinecraft().getFramebuffer().isStencilEnabled())
           Minecraft.getMinecraft().getFramebuffer().enableStencil();


if I run the game in the development environment, then everything works fine. But if I build a mod to a jar file and install it on a clean minecraft with forge, then everything is rendered as if this stencil is not present (Nothing is cut off for a template). There are no errors in the logs. Does anyone know why the stencil does not work after build?

UPD: Oops, I'm in the wrong section created a topic

Edited by Minebot1708
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.