Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.49k stars 173 forks source link

[HL] Matrix uniforms are incorrectly transposed #1429

Closed MoritzBrueckner closed 2 years ago

MoritzBrueckner commented 2 years ago

Describe the bug On HL, matrix uniforms are (incorrectly) transposed when passed to the shader. For example the projectionMatrix uniform used for 2D drawing will result in a broken visual output on HL:

HL

How it should look like:

Screenshot

Note that in the first screenshot I also removed the translation transform from the default project to see whether it was the reason for the problem. It isn't, but if you keep it enabled, the distorted shape will of course look slightly different.

To Reproduce Steps to reproduce the behavior:

  1. Use Kha: Init Project in VSCode to create the default example project
  2. Kha/make windows-hl
  3. Compare with other targets

It doesn't make a difference whether you use D3D11 or OpenGL.

The projection matrix uniform in hxcpp: grafik

The projection matrix uniform in HL: grafik

Execution Environment: