c++ - VertexShader compile fails on windows, same code works on linux -
i following opengl tutorial here. works on arch linux system, not on windows.
my vertex , fragment shader code in example:
fragment shader code:
#version 330 core in vec2 uv; out vec3 color; uniform sampler2d mytexturesampler; void main(){ color = texture2d( mytexturesampler, uv ).rgb; }
vertex shader code:
#version 330 core layout(location = 0) in vec3 vertexposition_modelspace; layout(location = 1) in vec2 vertexuv; out vec2 uv; uniform mat4 mvp; void main(){ gl_position = mvp * vec4(vertexposition_modelspace,1); uv = vertexuv; }
i following errors on windows:
error: 0:16: 'texture2d' : no matching overloaded function found (using implicit conversion) error: 0:16: 'rgb' : field selection requires structure, vector, or matrix on left hand side error: 0:16: 'assign' : cannot convert 'const float' 'fraguserdata 3-component vector of float'
do have ideas problem might be?
this listed in v330 spec @mrvoid mentioned. of old texture sampling functions (1d/2d/3d) deprecated , instead should use overloaded:
texture(...) function
this function change depending on type of sampler give there no need explicitly define type using in function's name anymore. made mistake on journey gl330.
Comments
Post a Comment