MeshMaterialShader Issue When Using Texture in Material

Of course I figured it out like 30 minutes after asking for help.

So when you include a texture in the material, you need to add the following into the shader parameters

SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)

and then set it with something similar to this with PassParameters being the parameters for the shader

FViewUniformShaderParameters ViewUniformShaderParameters;

ViewUniformShaderParameters.GameTime = Params.GameTime;
ViewUniformShaderParameters.RealTime = Params.GameTime;
ViewUniformShaderParameters.Random = Params.Random;
			
PassParameters->View = TUniformBufferRef<FViewUniformShaderParameters>::CreateUniformBufferImmediate(ViewUniformShaderParameters, UniformBuffer_SingleFrame);

The shader no longer crashes the engine but I do have another issue to fix

1 Like