[GLSL]Calculating the center of the polygon

Started by
1 comment, last by someboddy 15 years, 3 months ago
I need to calculate the center of each polygon I draw for my fading effect. Right now I'm calculating it in the CPU, send it to the vertex shader using an attribute, and than sending it to the fragment shader using a varying. I think my current solution is too cumbersome. Is there a way to calculate the center in the vertex shader itself?
-----------------------------------------Everyboddy need someboddy!
Advertisement
no, you have to use the geometry shader for that if you can.
I see...

Well, if that's the case I'll just keep calculating it in the CPU. No point to implement a geometry shader for just that...
-----------------------------------------Everyboddy need someboddy!

This topic is closed to new replies.

Advertisement