- Home /
How can I merge shader effects inside Unity, not an external program?
Hello,
I am experimenting with cutout shader, after trying to resolve my earlier question. There is still a problem, but I'm closer to finding a solution.
I have such nice "texture". Color with multiply mode, on one layer, and gradient with normal mode on the second. Created in GIMP. Inside Unity I use a normal standard shader, and I'm messing with "alpha cutoff" slider. If someone is interested, can check it out. With an effect like in the picture (4).
The thing is: I want all the effects of a standard shader. Albedo, metallic, normals, heights, and such things. I can't just apply two materials (one with the standard shader, one with cutout), because it makes two draws of a single mesh, and just overwrite each other. I can, however, take each of my textures and apply gradients, what is just plain stupid on a bigger scale.
How can I achieve such effect? Merging one texture, with another, able to be put into the material, and create merging like in GIMP? Or some other way to apply cutout texture, but inside Unity?
Tutorial how to make basic effect is here.
Thank You in advance.
Without meaning to be facetious, the solution is simply for you to learn shader program$$anonymous$$g. I'm not quite sure that's something that can reasonably be expected to be provided to you on a Q+A site like this.
So basically, I have to take a look into Standard shader and add multiplying of my textures into its code (or well... do it in GI$$anonymous$$P hundred times)? There is no way doing such merging in a modular way, like the whole scripting in Unity is done? From what I see most of shaders are "each possibility" rather than "if I want X, I will add shader from X".
About Q+A, a question is provided, and have certain one proper answer, there would be a part of code probably. On other questions we could answer "learn C# coding", and that would be closing questions. I'm asking for other options because shaders, in my opinion, are slightly escaping the idea of components, and are getting bigger and bigger with needs.
I'm not really understanding what you're trying to accomplish. $$anonymous$$y interpretation is that you want a cutout shader with all the features of the standard shader, however the standard shader already does alpha-testing.
Yes. It has, but I can't change cutout texture. I must merge texture and alpha texture in gimp, and then import it into unity. And i have to do it for every alpha and every texture. Ins$$anonymous$$d of just setting one texture and the other in unity editor, and letting shader do the merging work.
Oh, ok, I see what you mean now. This is easy enough to do in a surface shader, just give me a bit of time.