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

NORMAL on ShaderMaterial shader_type canvas_item gets ignored unless you assign a texture on the new GUI "Normal Map" dropdown (ignoring uniform sampler2D set manually) #9263

Closed
rubenjavier opened this issue Jun 19, 2017 · 2 comments
Assignees
Milestone

Comments

@rubenjavier
Copy link

Operating system or device - Godot version:
Linux 64bit Ubuntu 16.04 - Godot 3.0 alpha commit 0288be1

Issue description:
Adding a ShaderMaterial (for manual NormalMapping) to a Sprite using a uniform sampler2D to pass the normal_map gets ignored on the fragment if no texture is assigned also on the new GUI "Normal Map" dropdown

Steps to reproduce:
create a scene with:
.- a Light2D
.- a Sprite with a texture and a Material (ShaderMaterial)

*The Light2D has a texture with alpha (point light from the godot demos)

*The Light2D mode is Add with white color and energy=1

*The new "Normal Map" dropdown texture for the Sprite is kept at null
*The texture for the Sprite is a diffuse texture and the ShaderMaterial code is:

shader_type canvas_item;
render_mode blend_add;
uniform sampler2D normal_tex;
void fragment(){
NORMAL = texture(normal_tex,UV).rgb * vec3(2.0,2.0,1.0) - vec3(1.0,1.0,0.0);
}

*The Shader Param "Normal Tex" is used to set the normal_map image of the diffuse texture

***The "NORMAL" calculation in the fragmet is ignored unless you set a texture on the new "Normal Map" dropdown on the GUI

@Zylann
Copy link
Contributor

Zylann commented Jun 19, 2017

Similar to #7298, but with UV instead of NORMAL. Makes sense for fixed materials, but shader materials are custom by definition, so the fact UV or NORMAL are used in the shader should make the renderer bind these.

@akien-mga akien-mga changed the title [3.0] NORMAL on ShaderMaterial shader_type canvas_item gets ignored unless you assign a texture on the new GUI "Normal Map" dropdown (ignoring uniform sampler2D set manually) NORMAL on ShaderMaterial shader_type canvas_item gets ignored unless you assign a texture on the new GUI "Normal Map" dropdown (ignoring uniform sampler2D set manually) Jan 9, 2018
@akien-mga
Copy link
Member

We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.

@akien-mga akien-mga modified the milestones: 3.0, 3.1 Jan 9, 2018
@reduz reduz self-assigned this Sep 5, 2018
@reduz reduz closed this as completed in e6bc152 Nov 27, 2018
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

5 participants