Coding Adventure: Compute Shaders

preview_player
Показать описание
In this coding adventure I learn about compute shaders by creating a very simple raytracer. I then try use what I've learned to speed up my erosion simulation from the previous episode.

If you're enjoying these videos and would like to support me in creating more, you can become a patron here:

The project is available here:

Raytracing article:

Compute shader resources I used:

Music:
"Le Grand Chase"
Licensed under Creative Commons: By Attribution 3.0
Рекомендации по теме
Комментарии
Автор

Hi everyone, hope you enjoy this new episode. If there are any topics that you think would be a good fit for future coding adventure episodes, I'd love to hear them!
Either way, thanks for watching :)

SebastianLague
Автор

That montage is the most accurate depiction of coding i’ve seen in my life

Flowtail
Автор

Graphics programming student here; numthreads is the amount of threads that share data and are executed in one go. Every group is made out of numthreads and so dispatching less groups is generally faster (less stalls), unless these groups access shared data (or do group syncs). Having numthreads as 1, 1, 1 will destroy the whole idea of the gpu; paralization (as it just runs minimum number of threads and then masks out everything but one) since gpu cores are way less powerful by themselves then cpu cores. The threads that are dispatched should be a multiple of the GPU's architecture's minimum threads for optimal performance (32 for nvidia, 64 for amd) since less threads will be wasted. These "minimum threads" are also called a warp and all threads in a warp should follow the same branch (otherwise, branch divergence will cause both branches to be executed, but the branch that shouldn't execute the code will be masked out), this is done because the gpu draws its power from SIMD; a technique that allows you to operate the same operation on multiple objects. Their advertised threads are pretty much faked, as the threads they mention have to do the same thing for every warp; so not functioning like cpu threads. Nice to see something about compute shaders :) You can do infinite things with them; generate things procedurally, do lighting & ssao, culling and setting up draw calls, etc.

EDIT: Do note that more threads in a group isn't always better in algorithms that have branch divergence, for/while loops, syncs and/or write to memory inconsistently (or use groupshared memory). There's a lot of things that can affect this, mostly the GPU architecture, so be sure to test performance with different group sizes.

nielsbishere
Автор

Glad you found the ray tracing tutorial useful, thanks for featuring it here :) David / Three Eyed Games

threeeyedgames
Автор

3:20 those flying prices of code even have a shadow, good job Sebastian

nabeelansari
Автор

Love this channel, you don't feel pressure to follow along. You can just enjoy watching someone learn and write new code, which is always exciting <3

Jejkobbb
Автор

"Oh ok, so with light bouncing, the spheres will take on the color of adjacent spheres a little more, thats neat"
SPHERES BECOME BEAUTIFUL PERFECT MIRRORS

jay-tbl
Автор

2:44 RTX: OFF
2:48 RTX: ON
2:55 RTX: ONER
2:59 RTX: EVEN MORE ON
3:03 RTX: THE ONEST

HurriO
Автор

This is the greatest series of YouTube, hands down

hedonyable
Автор

I have literally no idea what's going on but I'ma keep watching.

TheShadesOfBlack
Автор

Loved this kind of playful video, educational but also fun and entertaining. Please do more of these in the future!

BrinkHouse
Автор

I'm a former programmer who has changed careers to an unrelated field. I just wanted to say how much joy I get from your videos; they truly capture the spirit of why I loved programming.

nick
Автор

3:16 That was unexpected and absolutely hilarious :p

Turtwiggyyy
Автор

3:17 I love his extremely realistic coding sequences! They get a realism-approval by me - a fellow coder :D

Clumpfy
Автор

I feel lucky to have stumbled across your videos. Every one I've watched so far is showing me a different way of looking at things that I didnt think of. Calculating shadows backwards...wow. I love the style of these videos, and the things they are opening my mind to feels extremely important. Thank you!

upowlnight
Автор

I just love how those spheres with hard shadows look halfway the video, gently bobbing up and down, esthetically pleasing.

baseendje
Автор

Thanks for this intro into compute shaders! They are definately something I want to learn more about.

BimzyDev
Автор

This really is amazing. It's the kind of stuff I really like.
My suggestions, just off the top of my head, add some sort of absorption rate, giving raise to river, lakes, etc. Following that, perhaps even consider the still water bodies that'll form, how they interact with the environment and are affect by something or rather.

theignorantphilosopher
Автор

You're a god-dam legend, man xD Respect from a fellow South African!

CheeseChuckie
Автор

Loved the montage of fake typing. Hilarious, would love to see more of that. I enjoy this channel because it fits the code bullet niche but tackles more complicated topics. Can’t wait to see more simulations and other projects. Would it make sense for all the droplets to pool into lakes? Maybe store the final location of all droplets, then calculate lake volume that way?

codyedgington