Answer the question
In order to leave comments, you need to log in
How can I implement the effect of hitting the shield of a spaceship (Unity3D)?
It is necessary to write the effect, as in the video (1:30-1:37):
www.youtube.com/watch?v=sIGWgVLrCNk
Most likely the majority will be for the shader. I have not dealt with serious shaders, in this case, tell me the necessary references, approaches. Thanks in advance
Answer the question
In order to leave comments, you need to log in
I don’t know how it is in the unit, but in theory, in the simplest case, an untextured ellipsoid and texture projection, it makes no sense to do such an effect with a pure shader. But the projected texture can already be applied. Using the shot vector and its strength, you can determine the radius/diameter of the texture and project it onto the ellipsoid. In general, you need to look in this direction, he did not do this himself.
You can draw an alpha texture for the effect on the CPU and pass it to the shield shader in each frame, draw the effect in opaque places. True, it is not known how fast it will be.
It is possible to encode information about the effect in vertices, in 2nd, 3rd and so on UV channel.
You can pass an array/matrix/texture to the shader with a list of all the hit points on the shield, converted to local (two-dimensional) coordinates of the shield. In this case, for each fragment (pixel) of the shield, the intensity of the effect will be determined as the sum of the terms dependent on the distance (over the surface) to the hit point. Roughly speaking, the closer to the point of impact, the brighter, and this adds up for all hits.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question