First off, let me explain how my rendering works. I’m trying to do a nice voxel engine that renders low resolution models. Think of 32^3 for a dwarf. I’m doing that like this: First, a 3d texture is generated, where each pixel represents a voxel. Then, a VBO is composed of (3n*2) quads, where n is the size in pixels of the texture, in the dwarf’s case 32. This means, 64 quads (front and back) for each axis, x, y and z. Each quad, or slice, in each direction is positioned at that slice’s position in the texture. The quad is then textured according to it’s location. With proper blending, the end result makes it seem as though thousands of seperate voxels are displayed, while only needing 192 quads, or 384 triangles.
Rendering is very fast; however, if I’m rendering a 100 unique models, and I try to zoom in, the frametime decreases drastically. Parsing the results through gDEBugger, and I’ve found that the rastering is the main bottleneck here, which I can understand. I’m not yet using frustum culling, so if I’m zooming in, every one of those 100 models has 384 triangles it needs to shade with texels, and I can see how this slows down the rendering.
My question then is this, is there a way to skip fragments that are occluded? I.e., texels that are on parts of the quad that are obscured because they reside in the model? I’ve tried a few different variations of using the geometry shader, and having it cull triangles when each slice itself is subdivided into 32x32 quads (and each quad is textured to 1 pixel in the 3d texture), but for some reason, whatever I do with the GS, it always slows down the program to an unacceptable level.
Hope my description of the rendering engine is sufficient. Thanks in advance,