Here we go:
The cheap water caustics breakdown in @UnrealEngine!
49 instructions and 1 texture sample
Works with dynamic lighting and has RGB split
Details below
:)
#UE4Study #gamedev #indiedev #shaderspic.twitter.com/MhnwFdIKGC
-
Pokaż ten wątek
-
The key here is the clever usage of WPbehindTranslucency. This allows us to project the caustics below the water plane in world space. Attach this at the end of your water shader, adding to the Base Color.pic.twitter.com/VKZftD0eDM
1 odpowiedź 3 podane dalej 22 polubionePokaż ten wątek -
There is no procedural stuff here, the material function is an extension to the Motion_4waychaos found in the engine. The panning is equal in all 4 axes, as it is addictive. You can add a general direction to the pan by blending it with SoftLight, and then rotate the pannerspic.twitter.com/1rsovCIAeO
1 odpowiedź 1 podany dalej 17 polubionychPokaż ten wątek -
Towards the end, you can see the RGB split implementation. It requires the base texture to have RBG spit on it, and then it desaturates that using a sine wave. I used a free
@Substance3D generator for this one, but you easily can split a BW texture in PS. https://share.substance3d.com/libraries/23 pic.twitter.com/FCKvaJkqOp
1 odpowiedź 0 podanych dalej 15 polubionychPokaż ten wątek -
Finally, lerp the caustics with a simple depth fade :) This prevents caustics from being drawn below a certain point.pic.twitter.com/BhPFqrNp3f
1 odpowiedź 0 podanych dalej 12 polubionychPokaż ten wątek -
Another bonus of using this method is that the caustics will be influenced by your water flow refraction because they are actually beneath the water plane
2 odpowiedzi 0 podanych dalej 6 polubionychPokaż ten wątek -
Lastly, everything is multiplied by the scene colour, so that brightly lit areas have more visible caustics and shadowed areas have little to no caustics.pic.twitter.com/2dIVl7yKDo
2 odpowiedzi 1 podany dalej 16 polubionychPokaż ten wątek -
Like any other, this approach is not perfect, obviously, if the camera is below the water plane, the caustics are gone, but it shouldn't be hard to use a similar approach in a PP material active below the surface. Another issue is flat 90-degree surfacespic.twitter.com/gHykQBpTuY
4 odpowiedzi 0 podanych dalej 14 polubionychPokaż ten wątek
Use the world position behind translucency and sample the normal GBuffer to generate triplanar coordinates and this should be solved for :)
-
-
W odpowiedzi do @calvinatorr
Thanks for that, I did try that approach,as I have it working on decals, but ended up messing up the other normals... But that is just me being bad at shaders :) Glad to know it was the right approach!
0 odpowiedzi 0 podanych dalej 0 polubionychDziękujemy. Twitter skorzysta z tych informacji, aby Twoja oś czasu bardziej Ci odpowiadała. CofnijCofnij
-
Wydaje się, że ładowanie zajmuje dużo czasu.
Twitter jest przeciążony lub wystąpił chwilowy problem. Spróbuj ponownie lub sprawdź status Twittera, aby uzyskać więcej informacji.