Skip to content

The matrix uniform parameter of newly created ShaderMaterial is zero matrix instead of identity matrix #106561

@beicause

Description

@beicause

Tested versions

4.4, 4.5

System information

Godot v4.4.stable.mono - EndeavourOS SMP PREEMPT_DYNAMIC Fri, 09 May 2025 17:36:18 +0000 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 7 4800U with Radeon Graphics (16 threads)

Issue description

mat2/mat3/mat4 uniform parameter of newly created ShaderMaterial is zero matrix instead of identity matrix.

Video_2025-05-18_21-48-38.mp4

Steps to reproduce

  1. Create a ShaderMaterial
  2. Load a shader file with mat2/mat3/mat4 uniform
  3. Then the uniform parameter is actually zero matrix though it's identity matrix in the inspector, unless you reload the scene or modify the uniform parameter

Minimal reproduction project (MRP)

shader-mat-default-value.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions