I’m trying to send some vectors from vertex shader to fragment shader:
ex:
vec3 N = (view*model*vNormal).xyz
and when trying to reach it in fragment shader:
Link errorERROR: Input of fragment shader 'N' not written by vertex shader
any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To pass values between shader stages you must use so called varyings; the keywords are
varyingoroutandin– there was a keyword change between GLSL 1.20 to 1.40 but the basic gist that you need special type qualifiers. See http://www.opengl.org/wiki/GLSL_Type_Qualifiers#Shader_stage_inputs_and_outputs for the details.