Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using POSITION in frag shader causes GLSL compiler error #3226

Closed
romulox-x opened this issue Jan 4, 2016 · 3 comments
Closed

using POSITION in frag shader causes GLSL compiler error #3226

romulox-x opened this issue Jan 4, 2016 · 3 comments

Comments

@romulox-x
Copy link
Contributor

In a 3D fragment shader, when trying to use the POSITION variable, I get this error:


ERROR: get_current_version: MaterialShaderGLES2: Program LINK FAILED:
Fragment info
-------------
0(846) : error C5052: gl_Position is not accessible in this profile

I believe this is because gl_Position is only meant to be used as the output of the vertex shader, not the input to the fragment shader. In the fragment shader, the position is available in gl_FragCoord.

@reduz
Copy link
Member

reduz commented Jan 10, 2016

will be rewritting most of this for 3.0, so for now not doing much 3D work

@reduz reduz added this to the 3.0 milestone Jan 10, 2016
@x1212
Copy link
Contributor

x1212 commented Jan 17, 2016

replacing the line
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="gl_Position";
with
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="gl_FragCoord";

in drivers/gles2/shader_compiler_gles2.cpp seems to solve that for me

@reduz
Copy link
Member

reduz commented Aug 4, 2017

this was rewritten in 3.0 and seems to work, closing

@reduz reduz closed this as completed Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants