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

Is theres a way to split render queue for objects via shader???? #86595

Closed
lopkauna opened this issue Dec 29, 2023 · 2 comments
Closed

Is theres a way to split render queue for objects via shader???? #86595

lopkauna opened this issue Dec 29, 2023 · 2 comments

Comments

@lopkauna
Copy link

lopkauna commented Dec 29, 2023

Tested versions

4.2 steam

System information

windows 11

Issue description

I cant find single instance shader method. How i can use shader for 1 node specifically and not like this
Снимок экрана 2023-12-29 053827

Steps to reproduce

just add 2 mesh instances and apply shader with that code for 1 of them

Minimal reproduction project (MRP)

shader_type spatial;
render_mode unshaded;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture;
uniform vec4 outline_color : source_color;
uniform float outline_width = 1.0;

void fragment() {
	vec4 pixelatedtext = texture(SCREEN_TEXTURE, SCREEN_UV);
	vec2 pixel_size = 1.0 / VIEWPORT_SIZE;
	ALBEDO = pixelatedtext.rgb;
	for(int y = -1*int(outline_width); y <= 1*int(outline_width); y++)
	for(int x = -1*int(outline_width); x <= 1*int(outline_width); x++)
	{
		vec4 tex = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(float(x),float(y)) * pixel_size );
		if(tex.a == 0.0)
		{
			ALBEDO = outline_color.rgb;
			ALPHA = 1.0;
		}
	}
	
}
@Calinou
Copy link
Member

Calinou commented Jan 1, 2024

This is not currently supported in Godot, as it currently doesn't have stencil buffer support or a similar render layer system.

Closing in favor of godotengine/godot-proposals#7174 and godotengine/godot-proposals#7916.

@lopkauna

This comment was marked as off-topic.

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

2 participants