saam_b

08-01-2012, 03:40 AM

Hi all,

I have a static scene where the only thing that changes on each frame is the color of each vertex. I'm using VBO and GLSL for drawing my scene. The color array is calculated on each frame, which is dependent on the rotation of the environment map and some other stuff. So It will be changed for each frame, and I have to recalculate it again and again. I have two questions:

1- How I can transfer this color array to the shader at each frame

2- How can I move the calculation to the shader because it drops the frame rate, and is highly dependent on the number of vertices of the object.

the calculation of the color for each vertex is the sum of multiplication of two arrays of coefficients related to that vertex, one of them is light coefficients and the other is transfer function coefficients. (spherical harmonic lighting) light coefficients will change with the rotation of the environment map, but it is the same for all vertices. but transfer function coefficients varies for each vertex.

thanks if advance for any help :)

I have a static scene where the only thing that changes on each frame is the color of each vertex. I'm using VBO and GLSL for drawing my scene. The color array is calculated on each frame, which is dependent on the rotation of the environment map and some other stuff. So It will be changed for each frame, and I have to recalculate it again and again. I have two questions:

1- How I can transfer this color array to the shader at each frame

2- How can I move the calculation to the shader because it drops the frame rate, and is highly dependent on the number of vertices of the object.

the calculation of the color for each vertex is the sum of multiplication of two arrays of coefficients related to that vertex, one of them is light coefficients and the other is transfer function coefficients. (spherical harmonic lighting) light coefficients will change with the rotation of the environment map, but it is the same for all vertices. but transfer function coefficients varies for each vertex.

thanks if advance for any help :)