I'm having issues with my GLSL version, upon running my program I receive a warning saying:
WARNING: 0:29: Only GLSL version > 110 allows postfix "F" or "f" for float
which is very strange to me, because both of my shaders specify #version 330 core
for example my vertex.vert
#version 330 core
// Input vertex data, different for all executions of this shader.
layout(location = 0) in vec3 squareVertices;
layout(location = 1) in vec4 xyzs; // Position of the center of the particule and size of the square
layout(location = 2) in vec4 color; // Position of the center of the particule and size of the square
// Output data ; will be interpolated for each fragment.
out vec2 UV;
out vec4 particlecolor;
// Values that stay constant for the whole mesh.
uniform vec3 CameraRight_worldspace;
uniform vec3 CameraUp_worldspace;
uniform mat4 VP; // Model-View-Projection matrix, but without the Model (the position is in BillboardPos; the orientation depends on the camera)
void main()
{
float particleSize = xyzs.w; // because we encoded it this way.
vec3 particleCenter_wordspace = xyzs.xyz;
vec3 vertexPosition_worldspace =
particleCenter_wordspace
+ CameraRight_worldspace * squareVertices.x * particleSize
+ CameraUp_worldspace * squareVertices.y * particleSize;
// Output position of the vertex
gl_Position = VP * vec4(vertexPosition_worldspace, 1.0f);
// UV of the vertex. No special space for this one.
UV = squareVertices.xy + vec2(0.5, 0.5);
particlecolor = color;
}
Creating the window in SFML
sf::Window window(sf::VideoMode(800,600), //declare window
"Particle Simulation" //window title
); //default context settings
is something wrong with my shader? Or would it be a problem with how I read my shader in?
Check that the actual OpenGL context is being initialized with the correct version. If you are initializing the context with an older version then it doesn't matter what the shader says it supports.