Intro to Compute Shaders in Unity URP! Replace Geometry Shaders ✔️ 2020.3 | Game Dev Tutorial

preview_player
Показать описание
✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3
🩹 Fixes:
► Make sure your source mesh has read/write enabled in it's asset importer inspector.

Compute Shaders are scripts that run on the GPU! They're very powerful, allowing you to leverage the GPU's unique abilities and generate meshes to draw procedurally. There's not a lot of information on using them, so I hope to demystify them and add another wrench to your game development toolbox. Specifically, I convert a geometry shader to a compute shader, increasing compatibility and efficiency.

👋 Subscribe for weekly game development videos!

👑 Join my Patreon for extra influence over topics, early access to videos, and downloadable project files!

🔗 Check out my website for a searchable list of tutorials!

🎬 Previous videos

✨Follow up videos

📜 Required scripts

📚 Reference scripts

⏲️ Timestamps:
0:00 Intro
1:02 Theory
3:00 The compute shader
7:00 The graphics shader
9:42 The C# renderer
16:11 Fixing vertex count
17:42 Wrap up and credits

🎖️ Credits and references:

#GameDev #IndieDev #Unity
Рекомендации по теме
Комментарии
Автор

The most under rated channel! Awesome tute, really well explained.

nikefootbag
Автор

Wow, this channel rules! It is like an arcane secret knowledge. I have very little experience with openGL and a little more with shaders and I feel that only thanks to it I was able to tag along. Fantastic stuff. Best channel on graphics and shaders that is also comprehensive. Thanks for doing this. And this is the stuff that makes my keep playing with Unity - you can't play like this in Unreal. It is other thing that maybe there you don't have to, but if one would like to, well, only in Unity :)

adamodimattia
Автор

hey man thanks for making these videos. You're really filling in the gaps in knowledge I have about shaders.

jamesmudge
Автор

I plan to use compute shaders in dynamic occlusion culling system based on raycasting. Several attempts failed mostly from performance reasons even using jobs and burst. Thank you for explaining thread groups when dispatching.

Bzuco
Автор

❤️👏🏻😍😍 won’t miss next week. Computer shaders for grasss in my racing game

onefoxstudio
Автор

Thanks for showing all steps with detailed explanations. I could have better understanding for them.

lunahwang
Автор

Thanks! This is a really awesome tutorial. Subbed 👍

RugbugRedfern
Автор

awesome tutorial. thanks for making this!

adamhoward
Автор

Really great contents, definitely the best on shaders: sorry that I just joined your Patreon program (level 3) only now!
On this video, works like a charm on Unity 2022.2, with a slight change (in PyramidFaces.hlsl):
return UniversalFragmentBlinnPhong(lightingInput, albedo, 1, 0, 0, 1);
changed to
SurfaceData surfaceInput = (SurfaceData)0;
surfaceInput.albedo = albedo;
surfaceInput.alpha = 1;
surfaceInput.specular = 1;
return UniversalFragmentBlinnPhong(lightingInput, surfaceInput);
Thanks again so much for your work!
Edit: found this down below in the comments also / initially, "my" solution came from another video of yours on shaders...

dragoons_net
Автор

Awesome! Very nice video!
I look forward to checking out more of your vids 😀😀😀😀😀😀

David-guhv
Автор

Thanks for u awesome tutorials, looking for more.

aidenwang
Автор

...so, there's a feature in Youtube where you can go through each frame by using [, ] and [.] ... thank me later.

Romulus
Автор

thank you very much... I was struggling on making compute shaders works on others tutorials but this one worked like a charm... I still have to understand what's going on but this code will surely help me a lot. thx!

CristianoFerr
Автор

Jeez Ned, just discovered your channel and it's a goldmine!

rubicon
Автор

I have to try this to show meshlets like mesh shaders do. I never thought you could actually use computeshaders for rendering

KyuremPlayer
Автор

I'm not a unity developer, but so much of what you did is call very thin wrappers around directx calls. It would have been simpler to do in directx11/12 directly. Obviously you had to do all of that because you're using Unity, it's just funny to me how convoluted it ends up being

Max-wkcg
Автор

really really cool!
i understood it all until about 18min.
I've just started with unity so i do not understand very well about the graphic pipelines it uses.
do you plan any series on this ?
about compute shader, i find them really impressive for simulations. i would really like to see a water sim or smth like it (clouds, smoke etc) but i still need to study i lot. do you recommend any resources to get started with this kind of stuff ?

motbus
Автор

This is really interesting and useful. I'm curious tho, I read a post about how the ComputeBuffer isn't really needed anymore due to GraphicsBuffer bbeing a thing. I was hoping you may be interested in doing a tutorial either on this or the grass possibly showing converting the existing code from the ComputeBuffers to GraphicsBuffers (since I read u can do more and less needing to pass data between buffers? unless im mistaken)

Memeieli
Автор

I'm curious do you have any exple for how to make sell sheder ?

I need sell sheder for my urp project the problem is the one I have find have shadows isuous and need to use thos shaders tricks to make fur

watercat
Автор

Will you do raymarching stuff eventually? It uses Compute Shaders right?
remembering Sebastian's video of clouds and then Outer Wilds and it was terrifying and it still haunts me lol

papercrease
welcome to shbcf.ru