Shader Practice 6-Integration
Section1
After a few examples of practice, Im trying to put them togethoer and see if multipuly shaders could work together. The first attempt is that disappear effect and the forcefield. What I want to realize is to make the disappear effect totally cover the forcefild ball inchluding the texture when it's concrete. But just like that previous example, the newly added shader can't affact on the original one on the object. So it's the same old problem, is it doable to let the added shader have an impact on other shaders or textures on the object? I probably can't fix this for now, but I still recorded my attempts.
The experience told me it's not gonna work before I mixed them together, it looks not that bad though.
There's one cheating way I came up with is to open postprocessing to make it blurry and super shining, so it basically realized my target as long as I can lie to myself.
I don't know how to modify passes yet, but I know it's one of the components of shader structure(pragma,struct,intput&output,etc.) which based on OpenGL, CG language.
Section2
What's kind of out of my expect is that failed practice, the top snow. Last time, I thought the reason I failed was the object doesn't have specific UVmap, so the shader can't recognize the Y axis accurately. But I was wrong. There's a new concept introduced when I refined it, Normal Vector.
(Normal Vector is a perpendicular vector of a certain point)
(Basically, it just means the vector points away from the surface)
(first,if we set that red direction as where snow comes from, then the parallel normal direction should have ths most snow, the vector vertical to the red should have the least)
(the values between parallel and vertical could be from 0 to 1)
After understood those theories, the result still BAD.
What confused me most is why the effect is influenced by the light, if I set the intensity to max and change light direction, the snow will go away. But for that forcefield, I deleted the light and it still works well.
This is the gap between idea and reality.
Comments
Post a Comment