[GLSL]Calculating the center of the polygon
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement