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

Fix for POSITION fragment shader var in 2.1 stable. #7565

Closed
wants to merge 1 commit into from
Closed

Fix for POSITION fragment shader var in 2.1 stable. #7565

wants to merge 1 commit into from

Conversation

kumihoclub
Copy link

@kumihoclub kumihoclub commented Jan 17, 2017

Fix for the issues related to the POSITION var in fragment shaders.

#3226
#7416

@kumihoclub kumihoclub changed the title fix for https://github.com/godotengine/godot/issues/3226 Fix for https://github.com/godotengine/godot/issues/3226 in Stable Jan 17, 2017
@kumihoclub kumihoclub changed the title Fix for https://github.com/godotengine/godot/issues/3226 in Stable Fix for POSITION fragment shader var in 2.1 stable. Jan 17, 2017
@@ -818,7 +818,8 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
//mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="IN_POSITION";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["NORMAL"]="normal";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["TANGENT"]="tangent";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="gl_Position";
//mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="gl_Position";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why keep it as a comment though?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real reason.

@akien-mga akien-mga added this to the 2.1 milestone Jan 18, 2017
@akien-mga
Copy link
Member

CC @RandomShaper, my new shader expert :p

@RandomShaper
Copy link
Member

Calling me an expert is very kind of you. Not too accurate, though. :)

Anyway, I've tested it with 2D and 3D shaders and it works nice.

The only thing I'd say is that z and w are meaningless for 2D so it would be better to have a vec2 POSITION for 2D with only gl_FragCoord.xy mapped to it.

@akien-mga
Copy link
Member

The only thing I'd say is that z and w are meaningless for 2D so it would be better to have a vec2 POSITION for 2D with only gl_FragCoord.xy mapped to it.

Would you maybe make a PR for that, or should we merge the current one as is?

@RandomShaper
Copy link
Member

Working on it.

@RandomShaper
Copy link
Member

Have a look at #7969.

@akien-mga
Copy link
Member

Superseded by #7969.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants