Jump to content
  • Advertisement
Sign in to follow this  
tungqoo123

Compiling Shader ERROR: 0:17:'f' : syntax error parse error

This topic is 2863 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 get the follwing error when I tried to compile .vert file.

ERROR: 0:17:'f' : syntax error parse error


The code is shown as follws.

#version 110

uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
uniform mat3 normal_matrix;

attribute vec3 a_Vertex;
attribute vec2 a_TexCoord0;

varying vec4 color;
varying vec2 texCoord0;

void main(void)
{
vec4 pos = modelview_matrix * vec4(a_Vertex, 1.0);

color = vec4(0.8f, 0.8f, 1.0f, 0.95f);
texCoord0 = a_TexCoord0;
gl_Position = projection_matrix * pos;
}


I had worked with it for a long time and still cannot find the solution.
Can someone figure out if there is anything wrong?

Share this post


Link to post
Share on other sites
Advertisement
It does "accept floats". Using version 1.1 (which you are), there was no valid suffix to denote this. Version 1.2 onwards lets you use f or F to denote a float, and version 4 added lf or LF to denote a double.

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!