I'm thinking of a new way of rendering. My idea is the following:
Setting up a vertex program which only does tranformations
Setting up a fragment program which only does transformations
Drawing all primitives of a scene with an id (for example passing a pointer using the Color)
Caching the calculated vertices of all primitives
Determining which primitives are drawn in the frame buffer (which Colors are in the frame buffer if the primitives are drawn with the pointer as its color)
Setting up a vertex program which does lithing, shadowing, ...
Setting up a fragment program which does lighting, shadowing, bump-mapping, ...
Drawing all primitives which are in the frame buffer (no transformation is needed because the vertices are cached)
What do you think about it? Any comments?
Thanks a lot