- Home /
Multiple instances of one shader, and merging shaders on model?
Hello. I have a small problem with writing a shader, which is probably more complicated than I think.
I'd like to make "dissipating" of a model. I have found a shader, which renders only a part of a mesh, depending on the distance from it (1 in the picture). I can also scale distance of rendering, so I can achieve a quite nice effect already (2). Here is an example
I have, however, a few ideas, but can't find proper information how can I do it.
I. Multiple instances (3) of such dissipating would be desired. Now the model is "cut" only from one side, to the another. I would like to get multiple spots on his "body", which would grow over time, removing whole model from rendering.
II. Not random noise on the edge (4). As You can see, now it's a straight cut, like from knife. Some sinus or other math function instead would be really nice.
III. And the last one, instead of a mathematical edge, some texture, fire, energy, or other kind of an image.
Additionally there is one other problem. When applying material with my shader, there are two things. Either my material overwrites anything, and model is "flat", no bump maps, no lights, just a plain texture like from year 2000. Or otherwise, my shader is overwritten and have no effect.
IV. How can I merge both behaviours, my dissipating, and basic shader with all lightnings, shadows, noises and bumps?
How can I achieve such shader behaviour? Can I?
Thank You all in advance, for Your time and interest.
I have one idea.
What about projectors? They can display a texture on another model (nice for making highlighting units and many markers), so if there is a possibility of displaying a texture which can make a target invisible, or to change alpha to 0, that would do a job.
Your answer
