I am doing 2D physical simulations of cellular automata with multi-pass rendering. My GL_NV_fragment_program performs update equations using textures as input data. The update equations are something like:
The easiest way to do this is to render separate geometry for the borders. Render the inner quad with one fragment program, and then render the 4 border edges as lines, using a different fragment program.
Originally posted by zeckensack: Thin quads are IMO better than lines as it’s easier to get ‘watertight’ rendering.
Do you mean that I should use a quad that is one texel wide and however many texels long? Also, I need to handle corners differently that edges. Should I use a quad that is one texel wide and one texel long?
Yes. This might sound terribly inefficient (binding a different shader for a single pixel quad …) but I think in your case the chip will be spending most of its time on rendering the interior anyway.