Jump to content

Is there any way to use Compute Shaders in a mod?


Recommended Posts

I'm trying to use a ComputeShader for some calculations on a mod I'm working on, but I can't seem to find any way to add the file to any resource folder anywhere or to load it into the game at all. Resources.Load won't find the file. Does anyone know how to utilize compute shaders in your code? It's easy to get it to work in unity cause you just make the public ComputeShader and then assign it in the inspector, but I cannot figure out how to do so at runtime.
Thanks for your help!

trying 

ComputeShader shader = Resources.Load<ComputeShader>("ComputeShaderName");

and

UnityEngine.Object[] objects = Resources.LoadAll<ComputeShader>("");

returns an empty array

I've put the computeshader file in all the folders I can think of. I use this same settup in Simple rockets 2, but it just doesn't work in ksp. Thanks!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...