Skip to content

Boolean uniform instances does not assigned properly #56726

@Chaosus

Description

@Chaosus

Godot version

b2ae6f8

System information

Windows 10, GTX 1060

Issue description

Currently, all boolean types (bool, bvec2, bvec3, bvec4) in form of instance uniform seems doesn't assigned before passed to the shader:

boolean_instance_bug

Steps to reproduce

Create a shader like that, assign it to shader material & mesh, and try to change it through inspector or via code:

shader_type spatial;

instance uniform bool test;

void fragment() {
	ALBEDO = vec3(1, 0, 0);
	if(test) {
		ALBEDO = vec3(0, 1, 0);
	}
}

All other types should work fine - so changing it to the int type would work. I have no idea why this happening - it assigns values to the uniform buffer correctly at least at the _fill_std140_variant_ubo_value function.

Minimal reproduction project

InstanceBooleanBug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions