Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

URP particle-based screen distortion. 🖥️ Particles are in the 3D world, but use screen coordinates to distort what's behind them. Excellent for shockwaves! ⭕️ A bit more work + polish, and I can throw the shader on GitHub. #unity3d #gamedev #realtimevfx

86,693 görüntüleme • 3 yıl önce •via X (Twitter)

10 Yorum

Mirza Beig profil fotoğrafı
Mirza Beig3 yıl önce

During the debug view, you'll see what's basically this.

Mirza Beig profil fotoğrafı
Mirza Beig3 yıl önce

Also working on a system for particle tracking.

Mirza Beig profil fotoğrafı
Mirza Beig2 yıl önce

Creamy-smooth distortion. 🍦

Mirza Beig profil fotoğrafı
Mirza Beig3 yıl önce

Updated the interactive demo, here: 👉

Mirza Beig profil fotoğrafı
Mirza Beig2 yıl önce

Setting up a 'pond' demo scene for release.

Mirza Beig profil fotoğrafı
Mirza Beig3 yıl önce

Aaaand, I've gone too far.

Mirza Beig profil fotoğrafı
Mirza Beig2 yıl önce

Progress.

Mirza Beig profil fotoğrafı
Mirza Beig2 yıl önce

Remake and cleanup :)

lucasfera15 profil fotoğrafı
lucasfera153 yıl önce

Amazing! The distortion also affects transparent materials?

Mirza Beig profil fotoğrafı
Mirza Beig3 yıl önce

There are very few transparent materials in the scene. I think maybe only two, and one of them is the distortion. The other one is behind it, as a soft glow for when the particles strike the cube. 💥

Benzer Videolar

🧑‍🏫 How to make a glass/refraction shader: 🍷 Refraction will ultimately have the effect that whatever is behind your mesh should appear distorted by the surface of the mesh itself. We're not going for external caustics projection, just modelling glass-like, distorting "transparency". 🌆 In Unity, you can sample the *global* _CameraOpaqueTexture (make sure it's enabled in your URP asset settings), which is what your scene looks like rendered without any transparent objects. In Shader Graph, you can simply use the Scene Colour node. 🔢 The UVs required for this texture are the normalized screen coordinates, so if we offset/warp/distort these coordinates and sample the texture, we ultimately produce a distorted image. We can offset the UVs by some normal map, as well as a refraction vector based on the direction from the camera -> the vertex/fragment (flip viewDir, which is otherwise vertex/fragment -> camera) and normals of the object. 📸 Input the (reversed) world space view direction and normal into HLSL refract. **Convert the refraction direction vector to tangent space before adding it to the screen UV.** Use the result to sample _CameraOpaqueTexture. refract(-worldViewDirection, worldNormal, eta); eta -> refraction ratio (from_IOR / to_IOR), > for air, 1.0 / indexOfRefraction (IOR). IOR of water = 1.33, glass = 1.54... 💡 You can also do naive "looks about right" hacks: fresnel -> normal from grayscale, which can be used for distortion. Or distort it any other way (without even specifically using refract at all), really... 🧠 Thus, even if your object is rendered as a transparent type (and vanilla Unity URP will require that it is), it is fully 'opaque' (max alpha), but it renders on its surface what is behind it, using the screen UV. If you distort those UVs by the camera view and normals of the surface it will be rendered on, it then appears like refractive glass on that surface. > Transparent render queue, but alpha = 1.0.

Mirza Beig

125,253 görüntüleme • 1 yıl önce