For those who asked to see my latest project example. Here it is, a work in progress that will be available soon.
Note: this is GIF animation, the original graphics is real-time 60 FPS.
Stay tuned.
Cheers.
For those who asked to see my latest project example. Here it is, a work in progress that will be available soon.
Note: this is GIF animation, the original graphics is real-time 60 FPS.
Stay tuned.
Cheers.
// Enable depth test, inverted, front to back. glDepthMask(GL_TRUE); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_GREATER); // Render only back faces. glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); // Clear the buffers. // Note that the most distant shape will overwrite all others. glClearDepth(0.0); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //... Render the shape of the volume, i.e. a cloud. // Enable depth test, back to front. glDepthMask(GL_TRUE); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); // Render only front faces. glEnable(GL_CULL_FACE); glCullFace(GL_BACK); // Clear the buffers. glClearDepth(1.0); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //... Render the same shape of the volume.