How To Create a Water Depth Effect // Godot 4 3D Shader Tutorial

Опубликовано: 27 Сентябрь 2024
на канале: StayAtHomeDev
4,703
250

In this Godot 4 shader tutorial, we're learning how to create a depth effect in our water shader using the DEPTH and SCREEN textures.

-----------------------------------------------------------------------------------

MISSING LINES FOR SAMPLING TEXTURES

// Get Depth and Screen Textures
float depth = textureLod(depth_texture, SCREEN_UV, 0.0).r;
vec3 screen = textureLod(screen_texture, SCREEN_UV, 0.0).rgb;

-----------------------------------------------------------------------------------

🔥 GET THE SOURCE FILES ►►   / stayathomedev_  

👉🏼 CHECK OUT MY GODOT 4 FPS TUTORIAL SERIES ►►    • The Godot FPS Project  

👉🏼 CHECK OUT MY GODOT 4 UI TUTORIAL SERIES ►►    • Godot User Interface Tutorials  

-----------------------------------------------------------------------------------

0:00 - Introduction and Overview
0:17 - Why DEPTH and SCREEN textures
0:43 - Adding New Uniforms and Textures
1:29 - Sampling the Textures and Beer's Law
2:17 - Lerp Color With DEPTH and SCREEN
2:43 - Final Result
3:00 - Get the Source Files

-----------------------------------------------------------------------------------

This series is part of my sponsored Godot shader tutorial videos where we'll create shaders step by step. I won't be skipping any steps in the process and everything will be sequential video to video.

Joining my Patreon in one of the 3 tiers will give you:

access to the private Discord channel
your name in the project README
early access to tutorial videos
power to vote on what mechanics get covered in future videos
full access to the project source files to use in your own projects

-----------------------------------------------------------------------------------

STAYATHOMEDEV ►► https://stayathomedev.com
TWITTER ►►   / stayathomedev  
MY GODOT ASSETS ►► https://stayathomedev.itch.io/

#godot #godotengine #shaders


Смотрите видео How To Create a Water Depth Effect // Godot 4 3D Shader Tutorial онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь StayAtHomeDev 27 Сентябрь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 4,703 раз и оно понравилось 250 людям.