ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Writing Unity Shaders Using Depth Textures

Unity

Unity3d

shaders

shader

3d

code

cel

shading

toon shader

cel shader

cg

hlsl

programming

vert

frag

vertex

fragment

pixel

2d

physics

tutorial

games

development

ben swee

swee

material

graphics

rendering

rendering engineer

tech art

technical artist

gpu

training

real

time

shader from scratch

normals

tangents

3d modeling

what are shaders

theory and application

gpu explained

intro to shaders

unity shaders

unity materials

depth map

depth texture

Автор: Benjamin Swee - Custom Unity Shaders

Загружено: 2022-04-18

Просмотров: 13088

Описание: If you want to support my Patreon: https://patreon.com/user?u=92850367

Writing Unity Shaders Using Depth Textures
Udemy Course: https://www.udemy.com/course/unity-sh...

Today I'll be doing this effect that uses the depth texture to create this inverse world like effect

This is the math and code to create the rotational effect

float2 textureCoordinate = i.screenPosition.xy / i.screenPosition.w;
float r = dot(i.viewDir, normalize(i.normal)) * 2 + _Time.y;
float g = (atan2(i.normal.y, i.normal.x) / 2 * UNITY_PI ) + 0.5 + _Time.y;
fixed4 col = tex2D(_MainTex, float2(r,g));
float depth = Linear01Depth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, textureCoordinate));
float3 color = lerp(_ColorOne, _ColorTwo, depth);
float fresnel = pow(dot(i.viewDir, normalize(i.normal) ),0.3);
return fixed4(pow(color * fresnel,2)*2 + col * (1-fresnel) * 2,1);

Ben here, and I've been writing shaders and full systems of shaders in Unity from scratch for 6-7 years now. Shaders, especially HLSL or CG shaders seem to be less known in Unity, so I just wanted to do my part, share my experiences and really show others how to write shader code.

The goal is to teach others how to write optimal shader code that is production-ready. I also want to try to recreate the cool-looking effects we see in other games. It would be awesome to see more and more people write shaders from scratch, understand it at a deeper level and ultimately create their own shaders.

Content of this video
0:00 - Intro & Setup
1:37 - Screen Space UVs
3:41 - Depth texture
5:40 - Decode it
8:00 - Color it
9:10 - Fresnel

#unity3d #unitydeveloper #gamedev #shaders

For more in-depth access I do have a Udemy course that I will continue to update as I create more mini-lessons.

https://www.udemy.com/course/unity-sh...

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Writing Unity Shaders Using Depth Textures

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Plasma shader in Unity

Plasma shader in Unity

Write A Custom URP Shader Using Unity BRDF

Write A Custom URP Shader Using Unity BRDF

An introduction to Shader Art Coding

An introduction to Shader Art Coding

Японец по цене ВАЗа! Оживляем пацанскую мечту :)

Японец по цене ВАЗа! Оживляем пацанскую мечту :)

MC² Audio's E25 - The ENGLISH AMP

MC² Audio's E25 - The ENGLISH AMP

Outline Post Process in Unity Shader Graph (URP)

Outline Post Process in Unity Shader Graph (URP)

Чёртово Кладбище - Что Скрывает Самое Страшное и Аномальное Место в Мире

Чёртово Кладбище - Что Скрывает Самое Страшное и Аномальное Место в Мире

Outlines - Devlog 2

Outlines - Devlog 2

ЗАВОДСКАЯ ЭЛЕКТРИЧЕСКАЯ КАЛИНА ПОЧТИ БЕЗ ПРОБЕГА. СТРАННАЯ ПОКУПКА.

ЗАВОДСКАЯ ЭЛЕКТРИЧЕСКАЯ КАЛИНА ПОЧТИ БЕЗ ПРОБЕГА. СТРАННАЯ ПОКУПКА.

Unity Shader Graph: Crystals!

Unity Shader Graph: Crystals!

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]