godotengine / godotengine/godot-docs

In shaders, the behavior of accessing matrix values through indices is confusing

Open
#10,298 0 comments 0 reactions 0 assignees View on GitHub
area:manual bug topic:shaders
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
godot4_4
Godot Engine v4.4.dev4.official.36e6207bb - https://godotengine.org
WARNING: Can't obtain the XDG decoration manager. Libdecor will be used for drawing CSDs, if available.
at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3731)
OpenGL API 4.6 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 - Compatibility - Using Device: Intel - Mesa Intel(R) Graphics (RPL-P)

**Issue description:**
in shader ,the mat4 and mat3 access through index is not the same behavior.
mat3 is:
![Image](https://github.com/user-attachments/assets/86959f06-76ca-434b-9fb7-dbb0199cadd4)
but mat4 is:
![Image](https://github.com/user-attachments/assets/e25e2c67-4cc7-455d-bf29-a46c90a5b04c)

so mat3 looks like column major order,but mat4 looks like row major order.
is this designed or a bug?
**URL to the documentation page:**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.