Shader Optimization – True Instruction Cost Performance Tips Tutorial
YOUR LINK HERE:
http://youtube.com/watch?v=y0QASid1v8w
Support on Patreon: / techartaid • Get project files: https://techartaid.com/products/ • Streaming weekly at / techartaid • Learn how to optimize material performance in HLSL and Unreal Engine. I use shader compiler to analyze GPU assembly instructions (which is easier than you think!). I explain the real speed of intrinsic math operations - how expensive is sin, cos, atan in GPU cycles. I also share tips about texture sampling cost, UVs. The process applies to all real time game engines that use HLSL language: Unity, Unreal Engine, Godot • Kostas Anagnostou - How to read shader assembly: https://interplayoflight.wordpress.co... • Fabian Giesen (Ryg) - A Trip Through Graphics Pipeline: https://fgiesen.wordpress.com/2011/07... • 00:00 Intro • 00:05 Shader assembly. How compilers work • 00:08 Basic shader in HLSL • 10:00 Cost of sin instruction (sine, cosine) • 12:20 Test material in UE5. Are constants optimized? • 15:46 Unreal instruction count is fake • 20:19 How expensive is tan (tangent) on GPU • 21:21 Be careful with material functions in Unreal • 23:49 Do unconnected nodes contribute to instruction cost? • 26:28 Can we beat the compiler? • 31:21 Texture sampling. How mipmaps cache improve speed • 36:37 Free math trick (thanks to texture memory latency) • 41:33 Scalar memory (SGPR) vs vector registers (VGPR) • 44:20 Wait counter • 47:13 Modifying UV coordinates can affect performance. Cache coherence • 56:00 Packing grayscale into RGB channels in Substance Designer • 59:26 Gradient mapping. Color curve atlas in Unreal Engine
#############################
