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

New uniform variable system in shaders #62924

Closed
Knand1861 opened this issue Jul 11, 2022 · 2 comments
Closed

New uniform variable system in shaders #62924

Knand1861 opened this issue Jul 11, 2022 · 2 comments

Comments

@Knand1861
Copy link

Knand1861 commented Jul 11, 2022

Godot version

4.11 alpha

System information

Windows 11

Issue description

First: I could not figure out the way that I can specify both hint + default value and instance_index();

Second: If I declare a global uniform in the shader script, project crashes on next loading; WORKAROUND: deleting the declaration with notepad before launch and then retyping it again, once loaded. [they work fine during the session (yes, I added global in project settings)]

Third: Instance keyword makes hints disappear and makes GDscript helpless in controlling the value in any way [It defaults to 0, as for float] - delete instance keyword and it works again.

I thought, that stating all these three issues in one place is a way to simplify the process of discussion and fix, if anyone intends to.

Steps to reproduce

shader:

shader_type canvas_item;
instance uniform float opacity :hint_range(0.0, 1.0, 0.1)=0.5;

void fragment(){
	vec4 color = texture(TEXTURE,UV);
	color.a-=opacity;
	COLOR = color;
}

sprite with an area2d and collisionshape:

extends Sprite2D


func _on_area_2d_area_entered(area):
	material.set_shader_param("opacity",1.0)

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Jul 11, 2022

I thought, that stating all these three issues in one place is a way to simplify the process of discussion and fix, if anyone intends to.

Grouping several unrelated issues together makes it harder to track things as they're fixed. Please open one issue per bug, so that they can be tracked and fixed individually.

@Knand1861 Knand1861 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2022
@akien-mga akien-mga added archived and removed bug labels Jul 12, 2022
@Calinou
Copy link
Member

Calinou commented Jul 12, 2022

Superseded by #62941, #62942 and #62943.

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

3 participants