0

I have a 3D model and while rendering i am using shaders to calculate the vertex color(computationally intensive task), based on some parameters. These parameters change with time. So basically i need to calculate the vertex color based on the present parameters and sum it up with the previously rendered vertex color. I will be dealing with models that have 5-10 million vertices. Can someone please help me with ways to solve this problem.

Sorry for the unclear question. The problem i am facing is how to backup the previous vertex color calculated from the shader. I cannot use blending since the object can be rotated. So basically i need a mechanism to save the vertex color information calculated from shader and use it in the next pass.

rps
  • 221
  • 2
  • 6
  • 1
    You might to specify what you're actually looking for. You just stated a complete task and said "help me". We don't know where your problem is. – Mads Oct 25 '12 at 09:49

1 Answers1

2

I think that Transform Feedback (Stream Out in DirectX) is what you are looking for. Its available in core OpenGL 3.0. This enables you to record attributes calculated in your vertex shader into buffer objects which can then be used in subsequent render passes.

Here is a related question with some starting points: Full setup of Transform Feedback.

There is some information in this blog post as well.

Community
  • 1
  • 1
Plow
  • 4,001
  • 3
  • 20
  • 21