Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/08/18 in all areas

  1. You know the day is good when you beat one of design problems. GL11.glEnable(GL11.GL_STENCIL_TEST); // Turn on da test GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT); // Flush old data GL11.glStencilMask(0xFF); // Writing = ON GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF); // Always "add" to frame GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE); // Replace on success //Anything rendered here becomes "cut" frame. GL11.glStencilMask(0x00); // Writing = OFF GL11.glStencilFunc(GL11.GL_NOTEQUAL, 0, 0xFF); // Anything that wasn't defined above will not be rendered. //Anything rendered here will be cut if goes beyond frame defined before. GL11.glDisable(GL11.GL_STENCIL_TEST); // Turn this shit off! EDIT: Edited code to more universal.
    1 point
×
×
  • Create New...

Important Information

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