- Home /
Pass Matrix4x4 to ComputeShader?
How can I pass a Matrix4x4 parameter to a ComputeShader?
Materials have the SetMatrix method but ComputeShaders lack this.
I thought maybe SetFloats to pass the Matrix4x4 as a float array like I would do with OpenGL but there doesn't seem to be any straightforward way to get an array from a Matrix4x4.
Using version 5.4b.
Answer by ModLunar · Jun 13, 2018 at 12:04 AM
Ah it's been too long, my bad. Now they luckily do have a SetMatrix method for ComputeShaders, and even SetMatrixArray!
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Making a bubble level (not a game but work tool) 1 Answer
An OS design issue: File types associated with their appropriate programs 1 Answer
Using compute shader, how to take every vertex of a mesh and make a cube spawn and move to each one? 0 Answers