Matrix order in bgfx, bgfx' shaderc and inside the shaders #3627
-
|
I want able to find a clear answer to this, so this is just to reassure my assumption: Bx' simd implementation seems to do matrix multiplication using column multiplication, indicating that bgfx uses the column major convention. Now how is this in the shaderc implementation? I try to figure out if the matrices get transposed somewhere, because I end up with row major order matrices there. Thats said, I use glm for my math (default is column major as well) and put them into bgfx using I just need a short answer, if you'd be so kind, to rule out some unknown pieces! :) Thanks! PS: On that behalve: How does bgfx handle different handedness for the rendering backends? I know that ogl is right,y and vulkan is supposed to be a lefty. Does bgfx change anything here or is it up to the user to write their shaders and math correctly for different APIs, if multiple are in use that have different conventions in use? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
|
You should look at provided examples. |
Beta Was this translation helpful? Give feedback.
You're not using SPIR-V directly in bgfx.
Yep.
I noticed people who are too much into math notation can't understand this. I even had coworker who would argue in lengths about use of
mulin memory row order layout because it was better for SIMDification, so I renamed method to beconcatmatrices, because flippedmulwas so much confusing. People who don't even know math, and doing copy and paste fro…