Paul.Withers Posted July 5, 2021 Share Posted July 5, 2021 Hello, Is it possible to pass a matrix (mat4) to a shader uniform via the material? For example if i define a parameter in the material like so: <parameter name="transformationMatrix"/> and in the shader its defined as UNIFORM float4x4 transformationMatrix; How do you set that material parameter? I tried setParameterArray() but that doesn't seem to work. Is it possible to set a float4x4 uniform given a material? Any help would be appreciated! Link to comment
sweetluna Posted July 5, 2021 Share Posted July 5, 2021 Hi, You can use setParameterFloat4x4 directly on shader retrieved from material with fetchShader. Just define your matrix in the shader like so: CBUFFER(parameters) UNIFORM float4x4 s_my_matrix; END May RenderDoc/Nsight Graphics/Intel GPA bless you Link to comment
Recommended Posts