How To Write Fast Shaders

  Рет қаралды 18,310

Jump Trajectory

Jump Trajectory

Күн бұрын

Shaders performance test:
docs.google.com/document/d/1-...
Data Oriented Desing:
gameprogrammingpatterns.com/d...
• CppCon 2014: Mike Acto...
RDR 2 graphics study by Hüseyin:
imgeself.github.io/posts/2020...
Sharper Mipmapping using Shader Based Supersampling by Ben Golus:
/ sharper-mipmapping-usi...
Music:
Wehrmut by Godmode
Divider by Chris Zabriskie is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
Artist: chriszabriskie.com/
camerashake_background_music_pt2 by Igor Vaiman
/ igor_vaiman
Beyond by Patrick Patrikios
0:00 Intro
0:56 Data Locality
02:01 Latency Hiding
03:02 Context Switch
03:42 Practical Tips
04:44 Texture Format
05:36 MIP-mapping
06:40 Channel Packing
07:12 Compute and Shared Memory
08:42 Blur Example
10:03 Outro
#shaders #unity #optimization #programming

Пікірлер: 55
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
Turns out I completely misused the term cache coherency. Pretend that every time I say "coherency" it's actually "locality". Sorry about that.
@xanderlinhares
@xanderlinhares 2 жыл бұрын
You're certainly not the only one. I've been to many GDC talks where the speaker makes the same mistake which is probably why a lot of us do too.
@SebastianLague
@SebastianLague 2 жыл бұрын
Really nicely done! Would love to see more videos on this topic :)
@-vanitas5229
@-vanitas5229 2 жыл бұрын
Update Plz!!!!!😃
@nielsbishere
@nielsbishere 2 жыл бұрын
A few things to add; shared memory is slow on mobile, so be careful when caching texture fetches there, as it might actually cost you. However this is really good on desktop when you have a lot of or big textures in resolution or bpp. Another important thing is that the most efficient group thread count may vary depending on your shader and gpu, so be sure to test on your target device(s) and pick the optimal version (some might want 16x16, some 32x32 for example). Aside from this, be sure that the group size (W*H*L) is dividable by 32 or you lose some perf because of how threads are scheduled.
@VictorGordan
@VictorGordan 2 жыл бұрын
Really impressive production quality! Looking forward to more videos from you :)
@filipathtc
@filipathtc 2 жыл бұрын
Insanely well made video! Thank you so much for this! :)
@mastermati773
@mastermati773 2 жыл бұрын
I haven't seen such quality of a video for a while.
@TwistedPresence
@TwistedPresence 2 жыл бұрын
Excellent video! I've implemented and modified your previous projects (FFT Ocean & Aero Surfaces) in my current project. Your explanations are invaluable! Great stuff!
@therealsemechki
@therealsemechki 2 жыл бұрын
Wow, this was really helpful! I just finished my first compute shader project (marching cubes) and realized there's a way I can save on performance by reducing memory costs! Thanks so much!
@igorvaiman5633
@igorvaiman5633 2 жыл бұрын
great introduction to the topic with very cool visualization! thanks
@ralofpatel470
@ralofpatel470 2 жыл бұрын
Very informative. Hard to get a video on such a critical topic. Thank you 👍
@nikitablack1568
@nikitablack1568 2 жыл бұрын
Great explanation and visualization. Keep going!
@ittaimann4580
@ittaimann4580 2 жыл бұрын
Excellent video! Definitely a really good description of everything.
@DeadlockCode
@DeadlockCode 2 жыл бұрын
Your videos never cease to amaze me!
@elden2814
@elden2814 2 жыл бұрын
Excellent Video! It is so hard to find good resources on shader optomization so it usually boils down to either a.)repeated benchmarking and/or b.)guesswork.
@curiouspers
@curiouspers 2 жыл бұрын
That's a great video! Thank you, keep up the good work!
@hallowedbythyframe
@hallowedbythyframe 2 жыл бұрын
Very good video, subscribed. Would love to see more videos like this.
@redsteph
@redsteph 2 жыл бұрын
Very well explained. Keep it up!
@tarck333333rrrr
@tarck333333rrrr 2 жыл бұрын
Fantastic video! Now waiting for a sequel about subgroup intrinsics and register allocation!
@robinbosch2931
@robinbosch2931 Жыл бұрын
Very nice Video, didnt expect some generall GPU video to be so helpfull.
@KaletheQuick
@KaletheQuick 2 жыл бұрын
I learned a lot, thank you!
@bilek993
@bilek993 2 жыл бұрын
Amazing video!
@skippythemagnificent8103
@skippythemagnificent8103 Жыл бұрын
That was clear and brilliant many thanks.
@in2fractalout
@in2fractalout 2 жыл бұрын
great job. thk u a lot. mostly I loos all the details, but I get the main idea. supercool visualisation makes a sense. great empact! I`will look it some more) that`s what I was lookin 4
@kodos_
@kodos_ 2 жыл бұрын
Потрясающее видео во всём: от интересности и практичности до качества как визуального, так и "образовательного" с точки зрения подачи информации. Спасибо!
@Fapret
@Fapret 2 жыл бұрын
great video!!
@aerialresearchdevelopmenta7871
@aerialresearchdevelopmenta7871 8 ай бұрын
Would love a more detailed video on your ocean system
@GuilherminoBr
@GuilherminoBr 2 жыл бұрын
Your channel is underrated
@pilogun1454
@pilogun1454 2 жыл бұрын
Have you thought about doing some more plane stuff?
@quinquow
@quinquow 2 жыл бұрын
Very nice video that helped me understand some things better. Can you elaborate how you misinterpreted the unity manual/how it actually works? And for another question, the resizeable BAR feature newer gpus do, do you know how that can be used for more performance in practice? Is it just better to use certain texture sizes for it?
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
Desktop GPUs do all floating-point calculations in 32-bit float format, while some mobile or older hardware can do half precision (16-bit) or fixed calculations. Unity manual says just that (however, on very recent GPUs native 16-bit float calcualtions are possible again). This doesn't say anything about textures though, they can have various formats. For some time I thought that they are also converted to 32-bits and all other fancy formats are for mobile. And was wrong!
@FredDufresne
@FredDufresne 2 жыл бұрын
@@JumpTrajectory So textures are stored in various formats on the GPU but calculations are done in 32bit float right? (ignoring 16bit/int of old hardware)
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
@@FredDufresne Basically yes! On desktop in HLSL half is just an alias for float. Though I think there is also native int calculations support. Also 16-bit is not only for old hardware, but also for mobile and for newer desktop hardware.
@mxn5132
@mxn5132 Жыл бұрын
Would be awesome if you made a version of your IFFT ocean for UE4.27 since it would still work for UE5 with a little tweak but it would support devs with existing projects that are difficult to migrate to a newer engine version. A video about quad trees on the Unreal Engine would be highly valued as well.
@jasonzil
@jasonzil 2 жыл бұрын
Could you talk about how to dispatch in a group as you show at @9:19? Would you decide the threads to be (8,1,1)?
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
Yeah, you could do something like numthreads(im_width, 1, 1), and comuteShader.Dispatch(...., 1, im_height, 1)
@5589e5
@5589e5 2 жыл бұрын
You've been working on the new water in WoW, haven't you? I'm probably wrong.
@azgan123
@azgan123 2 жыл бұрын
Do you ever do game jams? I like your style and would like to join up with you :)
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
Occasionally! Took part in all the GMTK ones
@icedwater9763
@icedwater9763 2 жыл бұрын
im only here for sanic O_O
@antonioconte3315
@antonioconte3315 9 ай бұрын
Почему ты перестал выпускать видео ?
@irongarden8415
@irongarden8415 3 ай бұрын
Привет! Как можно с тобой связаться? Я Tech Artist, и мне интересно ты все ещё разрабатываешь игры? На ИТч ио у тебя много проектов)
@JumpTrajectory
@JumpTrajectory 3 ай бұрын
можно в твиттер написать twitter.com/pensionerov
@ra1yms0up
@ra1yms0up 11 ай бұрын
Чувак, ты в порядке?
@t.a2851
@t.a2851 2 жыл бұрын
Subtitles would be very helpful.😀
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
Done!
@Kavukamari
@Kavukamari 10 ай бұрын
gpu hungry need more ops
@Maufdiot
@Maufdiot 2 жыл бұрын
I need stocks for your channel
@iDROIDchannel
@iDROIDchannel 2 жыл бұрын
Узнаю акцент
@milanstevic8424
@milanstevic8424 2 жыл бұрын
and? where's the accent from?
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
@@milanstevic8424 Россия-матушка
@milanstevic8424
@milanstevic8424 2 жыл бұрын
@@JumpTrajectory for some reason I thought you were Dutch, I don't know why, but yes I can hear it now. greetings from Serbia, very nice video.
@JumpTrajectory
@JumpTrajectory 2 жыл бұрын
@@milanstevic8424 Fun fact, youtube auto generated Dutch subtitles for this video, so you are not alone
@milanstevic8424
@milanstevic8424 2 жыл бұрын
@@JumpTrajectory haha, so that's why I made that assumption. well it managed to completely derail me :)
Ray tracing in unity. Пример использования compute shaders
20:15
Максим Крюков
Рет қаралды 3,7 М.
Screenshake that doesn't suck
8:37
Jump Trajectory
Рет қаралды 25 М.
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 19 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 7 МЛН
How I Solved Real Time Motion Blur
10:20
Sphynx_Owner
Рет қаралды 10 М.
The Art of Game Optimization
10:18
Worlds In Motion
Рет қаралды 257 М.
Learn GODOT 4 Compute Shaders with RAYTRACING!!
12:40
NekotoArts
Рет қаралды 27 М.
Realistic Aircraft Physics for Games
11:42
Jump Trajectory
Рет қаралды 78 М.
The Strange Graphics Of LETHAL COMPANY
15:59
Acerola
Рет қаралды 751 М.
Bloom.
26:10
The Cherno
Рет қаралды 115 М.
I made a better Ray-Tracing engine
17:38
NamePointer
Рет қаралды 247 М.
GPU Compute Shader Work Groups
6:36
Arsiliath
Рет қаралды 6 М.
So I made my own shaders...
5:31
Legitimoose
Рет қаралды 85 М.
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2 МЛН
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Кинг Комп Shorts
Рет қаралды 1,2 МЛН