Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable depth mask when rendering custom blocks #8

Open
deathcap opened this issue Jun 14, 2014 · 1 comment
Open

Disable depth mask when rendering custom blocks #8

deathcap opened this issue Jun 14, 2014 · 1 comment

Comments

@deathcap
Copy link
Member

From mikolalysenko in #2:

When rendering the world you need to do 2 passes:

  • First draw all opaque/transparent voxels without using any blending and with the depthMask enabled.
  • Then disable depthMask (but keep the depthTest on!), turn on blending and draw all transparent faces.

or http://stackoverflow.com/questions/3388294/opengl-question-about-the-usage-of-gldepthmask, similar process:

  1. Turn on the depth mask glDepthMask( GL_TRUE )
  2. Draw all opaque objects, in any order
  3. Turn off the depth mask glDepthMask( GL_FALSE )
  4. Turn on a BLEND_MODE
  5. Draw translucent objects sorted from furthest away to nearest

Currently, voxel-shader draws all opaque/transparent objects first, then translucent objects with blending enabled. However, the meshes are not sorted (voxel/voxel-mesher#9) and the depth mask is not enabled or disabled (this issue, GH-8).

https://www.opengl.org/sdk/docs/man/html/glDepthMask.xhtml

@deathcap
Copy link
Member Author

screen shot 2014-06-14 at 7 35 58 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant