Say I have a Compute Shader asset "ComputeParts.compute" and a game object "MainObj". MainObj has a member (C#):
ComputeShader computeShader;
Now, how do I assign an instance of ComputeParts.compute to this variable? I cannot seem to attach the shader to the object in the Editor in any way. Obviously, since it's a compute shader, I cannot assign it to the object's material either, as I do with other shaders. The manual just says "define a variable of ComputeShader type, assign a reference to the asset" - but I have no idea how to do that.
↧