Jump to content
  • Advertisement
Sign in to follow this  
Shawn619

GlSL .vert and .frag compile error

This topic is 2124 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 made this very basic .vert and .frag and i dont know why i can't get it to compile in my shader designer.

.vert


void main() {
// Set the position of the current vertex
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}


.frag


void main() {
vec4 color, lessen, res;

color = gl_Color;
lessen = vec4(0.5,0.5,0.5,1.0);

res = (color*lessen);

// Set the output color of our current pixel
gl_FragColor = res;
}


Shader Designer compile errors:

The fragment shader uses varying gl_Color, but geometry shader does not write to it.

Share this post


Link to post
Share on other sites
Advertisement
You are trying to read gl_Color in the fragment shader but you have never written a value to it in the vertex shader.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!