So I was lucky enough to spot the sale on shader forge and I have been keeping my eye on this really nice looking software for a very specific reason, not least of which because of the amazing dissolve effects and so on but because of what I now know is called ‘texture splatting’.
I did some digging and found a tutorial on how to make these effects and that’s all well and good but what I’m looking for is how on earth do I get this transferred to script if it is at all possible?
Now some people may remember awhile back I actually made a thread about this and shader forge was suggested to me as a genuine way of doing it, now I have it, I’m going to re-visit this issue again. The ideal thing I’d like to do is to have whatever shader I choose be put onto a gameobject with a mouse click or any sort of event, I just need to know how to access these shaders through a script and apply them.
An example of this would be Starcraft 2, where you have the zerg creep spreading across the floor.
I just had a total duh moment as you do and realised that what I’m talking about is likely completely separate from shader forge, it just creates the shaders you need easily. So what I would need to do is access the shader itself through unity and load that up then have it instantiate on a mouse position.
In this case, it seems that SetPixels is the appropriate thing, so what I’ll need to do is figure out how to load up a shader, then use SetPixels on the current mouse position which should then hopefully put the nice blending effect straight onto whatever gameobject I’m using.
Let me know if I have the right idea guys, it seems to all check out.
Edit: I think I found the right sort of thing, it wasn’t SetPixels at all, I had no idea SetTexture could be used for loading up shaders as well, so for the painting things onto the terrain at least I just need to make my shader in shader forge.
Looks like I’ve got a whole new topic to learn about.