Quantcast
Channel: Questions in topic: "compute shader"
Viewing all articles
Browse latest Browse all 287

How do I generate and compile a compute shader in the editor?

$
0
0
I'm working on an editor extension for a custom GPU particle system. The system generates source code for a compute shader, and I need to turn that source into a ComputeShader instance. Basically, I'm looking for the ComputeShader equivalent of `UnityEngine.ShaderUtils.CreateShaderAsset()`. I know I could save the shader to a ".compute" file and manually refresh AssetDatabase, but there are two problems with this approach: 1. I have to go through the hard drive and then wait for AssetDatabase to catch it, which is slow 2. This shader is ultimately going to be attached to a ScriptableObject in a ".asset" file; it will not have its own file on the disk.

Viewing all articles
Browse latest Browse all 287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>