• Advertisement
Sign in to follow this  

[GLSL]Calculating the center of the polygon

This topic is 3383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement