I am trying to build a scene in which a bunch of objects sitting on a plane are reflected in it (actually multiple planes may be spaced vertically, but that is not the problem).
Right now, I am rendering the reflected objects, a blended semi-transparent floor, and the real objects. Additionally I’m using stencils to limit the reflected objects to be reflected in floor pixels, and do draw projected shadow polygons pixels exactly once on the floor.
The problem I have is in how I want to texture the floor. All would be well if it were a simple texture projected across the floor, however this is actually a potentially large diagram made out of many overlapping images/decals.
Because of the size of the diagram, it is impractical to pre-render it as a texture (my decals might be 256x256 - which I want for close viewing - and at that size, the fully rendered plane texture dimensions might be 50 times that in either dimension)
The crux of my problem, is that I need to render the whole floor with a non 1.0 alpha. Obviously I have a compositing problem if I want to have opaque decals covering each other on the floor, but the floor itself remaining semi-transparent. I figure I could use a stencil or polygon-offset to draw each floor pixel only once (from back to front), but that then means I can’t have decal textures with meaningful alpha values (which I’d like for text).
I guess my ideal would be to render the floor fully opaque only scene to an off screen buffer, and then composite that into the real scene (or use it as a texture without perspective correction)
Being new to OpenGL, I don’t know if I’m missing something, but it seems like it will be hard to do this whilst drawing the correct stencil and depth buffer pixels while drawing the plane to the real display - ideally i’d like to do perspective correct interpolation on everything but the texture.
Perhaps there is an easier way… I’m hoping!