UE4 Graphics Profiling: Pipeline and Bottlenecks

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ค. 2024
  • Learn about the pipeline in modern desktop GPUs and how it affects your game content's performance.
    Get project files: techartaid.com/products/
    Vertex, pixel and memory-related sources of trouble are explained. Optimization viewmodes are shown, as a tool for early detection of bottlenecks.
    All parts playlist: • UE4 Graphics Profiling
    Chapters:
    00:00 Introduction
    01:35 Anatomy of a frame. 'Stat unit' command
    03:06 Types of shaders
    03:55 Draw calls
    04:45 Pixel-bound problems. Translucency
    06:44 Quad overdraw
    08:15 Vertex-bound problems
    09:45 Memory-related problems
    12:18 Deferred vs. Forward rendering
    14:00 Optimization Viewmodes
    20:29 Texture statistics
    Thanks to early reviewers: Mikołaj Fabjański and Ch Hope.
    Links and sources:
    [1] "A trip through the Graphics Pipeline 2011" (amazing in-depth series about pipeline): fgiesen.wordpress.com/2011/07...
    [2] "GPU Gems 3 - Deferred Shading in Tabula Rasa" (deferred theory): http.developer.nvidia.com/GPUG...
    [3] "How bad are small triangles on GPU and why?": www.g-truc.net/post-0662.html
    [4] "Counting Quads" (quad overdraw explained): blog.selfshadow.com/2012/11/12...
    [5] "GPU Performance for Game Artists": fragmentbuffer.com/gpu-perform...

ความคิดเห็น • 100

  • @TheGabmeisterX
    @TheGabmeisterX 2 ปีที่แล้ว +1

    Great explanations. I keep rewatching your videos on graphics optimization.

  • @wii58739
    @wii58739 3 ปีที่แล้ว +6

    These tutorials are pure gold, thank you for making them :)

  • @FitGameDeveloper
    @FitGameDeveloper 4 ปีที่แล้ว +5

    Truly amazing video series. Well-organized structure, digestible segments, and clear examples (with images and real-time examples).

    • @TechArtAid
      @TechArtAid  4 ปีที่แล้ว +3

      Thanks, I'm glad you enjoyed them!

  • @mhnoni
    @mhnoni 7 ปีที่แล้ว +2

    I can truly say this series is one of the best tutorial about optimization , i found at least 2 point i need to immediate check on my project wihc is tesselation landspace and texture compress size .

  • @Govi627
    @Govi627 7 ปีที่แล้ว +2

    Love your videos, hoping to see more

  • @SasisaPlays
    @SasisaPlays 4 ปีที่แล้ว +1

    It’s a pure gold tutorial series!

  • @omri1324
    @omri1324 5 ปีที่แล้ว

    I am so glad I found this! great resource!!

  • @projectrat5564
    @projectrat5564 6 ปีที่แล้ว

    This is some really good stuff. Thanks!

  • @Khaliszt
    @Khaliszt 7 ปีที่แล้ว

    I know your channel is mainly focused on art, but i would really love and appreciate a series like this (awesome by the way) about UE4's Game Thread! Profiling both graphics and gameplay would help me tons! Thanks for this.

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +Khaliszt A. I surely lack expertise there. But at least there seems to be more info, documentation and blog posts about the gameplay code side

  • @PolygonAcademy
    @PolygonAcademy 5 ปีที่แล้ว +6

    dude this is awesome, I'm an environment artist and have a basic technical knowledge base but this really helps when optimizing a scene. thanks for the info :)

    • @TechArtAid
      @TechArtAid  5 ปีที่แล้ว +1

      Thanks for the thanks and letting know 😊

  • @pawpotsRS
    @pawpotsRS 4 ปีที่แล้ว

    for every technical surely I'll subscribe!

  • @IceeyIceey
    @IceeyIceey 7 ปีที่แล้ว

    Wielkie dzięki za tą serię. Dziś sprawdziłem lightmapy w swojej grze i wykryłem wiele niepotrzebnie wysokich rozdzielczości lightmap. Cała seria przyda się jeszcze raz przed wypuszczeniem gry!

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +IceeyIceey No to ekstra. UE ma sporo tooli i trybów do szukania nieoptymalnych miejsc. Szczerze, na początku myślałem że to będzie temat na jeden tut :D

  • @chiboreache
    @chiboreache 7 ปีที่แล้ว

    Very useful, as usual, thanks

  • @ReplicatedYT
    @ReplicatedYT ปีที่แล้ว

    Very useful thanks!

  • @SellusionStar
    @SellusionStar 7 ปีที่แล้ว +1

    thank you mate!!

  • @amirsaeed8733
    @amirsaeed8733 5 ปีที่แล้ว

    It was very useful thank you :)

  • @AxisLotl
    @AxisLotl 6 ปีที่แล้ว

    Thank you so much. You are helping me a lot to improve my work.

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว +1

      +Pepito Grillo Nice to hear that. If you'd like to know more about something, let me know. May come in handy for the optimization ebook I'm writing

  • @jso19801980
    @jso19801980 4 ปีที่แล้ว

    no fancy new features or plugins..
    just the very fundamental stuff we should all know
    love it!!!

    • @TechArtAid
      @TechArtAid  4 ปีที่แล้ว

      I'm glad you appreciate the fundamentals! I found such knowledge even more important at CDP Red, due to a custom engine

  • @esparafucio
    @esparafucio 7 ปีที่แล้ว

    Awesome video! In regards to Forward Rendering, Unreal seems to use "Clustered Forward Rendering" based on Ola Olsson's work, which compute lights in a frustrum-space grid, instead of a screen space grid, like Forward+.

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว +1

      +esparafucio You're right. So I also made a mistake in Part 3.2, explaining ComputeLightGrid. It's not just for culling, it's for deciding which fragment of the 3d space the lamp affects.

  • @iamisandisnt
    @iamisandisnt 7 ปีที่แล้ว

    I haven't even watched this yet and I love it already :D

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว +1

      +iamisandisnt Haha ;) no rush. This is meant more as a compendium to return to, anytime

  • @fonfa
    @fonfa 7 ปีที่แล้ว

    Such good information! Thanks a lot!

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      Nice to hear it. I tried to compile many tips that I think are not popular enough ;) Like quad overshading, texture cache coherency. Of course their significance may vary

    • @fonfa
      @fonfa 7 ปีที่แล้ว

      Yeah, you've explained it in an easier way than I've seen elsewhere so I'm pretty sure this will be useful to artists of all disciplines and not only tech artists :)

  • @alangonzalezleon6556
    @alangonzalezleon6556 4 ปีที่แล้ว

    Thank you very much. Now I know what is my problem in my game : D

  • @Nerfdalocks
    @Nerfdalocks 6 ปีที่แล้ว

    This content is great, just great. Thank you so much!

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว +1

      +Jacob Ben-David I'm glad you liked it, thanks! Now I'm working on a text version

    • @Nerfdalocks
      @Nerfdalocks 6 ปีที่แล้ว

      Awesome I can see how that could be super useful as I'm basically sitting here taking notes for the entire length of the video. Though having you explain it and demonstrating it in editor/scene is extremely valuable and makes everything that much more clear. Keep up the great work!

  • @RSS6612
    @RSS6612 7 ปีที่แล้ว

    this is awesome thanks

  • @yonjuunininjin
    @yonjuunininjin 7 ปีที่แล้ว

    I could listen to you all day

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +Ninjin All right! That's what I was told by another person, Simon, after this video. So I went with this advice when making part 3.2, uploaded yesterday :) Compendium-sort of thing

  • @AdityasinghSisodiya
    @AdityasinghSisodiya 6 ปีที่แล้ว

    Made my day. Greetings Mate!!! Have a nice cup of coffee

  • @silencemoon1936
    @silencemoon1936 6 ปีที่แล้ว

    Love it!Is really Help me too much :)

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      +Moon Silence I'm glad to hear that! What are you working on?

  • @MarcusHouseJumper
    @MarcusHouseJumper 7 ปีที่แล้ว

    first of all a big compliment how you gather and bring these Tech-Art infos to the point. keep this channel like it is, spacially for people who are seriously interested in the UE4 pipeline.
    Could you give some hints about how to avoid lightbleeds? giving objects just a bigger lightmap resolution is probably not the best solution i guess.
    A big THX for this channel and plz keep going ;)

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +Hansi HansHans Good to hear that the formula works for "theoretical" topics as well. As for the lighting, I plan to do a multi-part lighting tutorial, late Summer. But does increasing the lightmap resolution help? Can you test it? If yes, then maybe it's a problem of UV islands having too small margin between them

    • @MarcusHouseJumper
      @MarcusHouseJumper 7 ปีที่แล้ว

      In some cases it works, unless you choose a material which is not that bright in the diffuse. When i blocking out the level design i like to use the basic_wall material comming with the starter content, and really basic geometrie of course. In this case increasing the LM-Res wont work. I think the gradient between light/shadowed areas might be too strong. In that case i use geometrie to block from outside.

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      Having a big black (unlit) cube that surrounded the entire building helped me in one scene. In another one, I used double-sided walls, with very little lightmap-UV space dedicated to those back polygons. Remember to place a Lightmass Importance Volume that will closely surround your area where lighting matters (building floors, but not background). Only if that fails, you can also try World Settings > Lightmass Settings > Level Scale (0.5, 0.75), Indirect Quality (2, 3): imgur.com/a/g25dV

    • @MarcusHouseJumper
      @MarcusHouseJumper 7 ปีที่แล้ว

      the unlit box is a very nice workaround. never thought of changing the material type. thx. ;)
      will there be a houdini tutorial? it already became the tool of choice for me. but its not easy changing the workflow, and there is a lot to learn.

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +Hansi HansHans Houdini is your main tool? What do you use it for? Next tutorial series after this I plan to do are UE4 lighting and Houdini. But I'm still looking for ideas for the second one - what cases really require Houdini

  • @dipeyes
    @dipeyes 5 ปีที่แล้ว

    very useful!

  • @user-fu7zr5us5f
    @user-fu7zr5us5f 4 ปีที่แล้ว

    really really useful!

  • @RonnerFTW
    @RonnerFTW 7 ปีที่แล้ว

    The tesselation landspace trick helped me out alot! thanks, Our deadline is in less than a week now is there any chance you'll be done with part 3 by then for a final check regarding the GPU visualizer to understand some of the processes before we hand it in? (:

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว +1

      +Johan Ronner I think I'll do it on next weekend. But ask here, or by e-mail (it's at oskarswierad.com)
      In general: play the game in new window, minimize other windows, press Ctrl Shift comma. Base Pass cost = complexity of shaders, object count, decal count, resolution. If you're using Forward renderer then lighting goes there too. Translucency = translucent objects, particles and lighting of such objects. HZB = generation of Z-buffer used by SSR, AO and culling. Lighting = cost of lights, depends on their attentuation radii and game resolution. ShadowDepths = avoid dynamic shadows if it's a problem. Post processing = bloom, ambient occlusion (it's costly!), screen space reflections, lens flares. All of which can be disabled or lowered in radius/quality. Cheers :)

  • @priareos3878
    @priareos3878 6 ปีที่แล้ว +1

    Hey man, great video! I'm curious about what you said concerning UVs and the Cache (min 11:20). Do you mean UV manipulations like Flowmaps/UV Distortion, UV Tiling changes etc. in the material should be avoided? I do this a lot in my particles and decals, so maybe you could give me some more details on how it will affect performance?

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว +3

      +Priareos Tiling is of course a normal thing, used everywhere. (It can be only a matter of discussion if it's more efficient to do it with a VertexInterpolator node or even Customized UVs). Cache coherence is preserved, because neighbouring pixels read from a similar place on the texture. So the situation is also fine when the flow maps are smooth. The problem of low coherence arises when we use a strong, noise-like distortion. It makes the material require to read from random places on the entire texture - neighbouring pixels miss the predicted position (loaded into the cache), so a new piece of texture has to be read from VRAM. I've never seen a clear example of this being a problem. It would be interesting to measure it (a material with and without noisy distortion).
      edit: I mean spatial coherence of texture fetches. More here: www.gamedev.net/forums/topic/399901-texture-cache--pixel-shader/?tab=comments#comment-3659628

    • @priareos3878
      @priareos3878 6 ปีที่แล้ว

      Tech Art Aid Thank you!

  • @Bas3008
    @Bas3008 3 ปีที่แล้ว

    Wow, that is some immensely useful information, thank you! When you were talking about multiple layers of translucency, I was wondering if you can limit the maximum depth it will render? Like if there are for example 10 stacked transparent leaves, can you tell UE4 to only render the translucency of say the first 3? I'd imagine that would save a lot of performance.

    • @TechArtAid
      @TechArtAid  3 ปีที่แล้ว

      This is stochastic transparency, if I understand correctly. It's used in offline renderers and I know there have been examples of this method used in real time. I don't think it's used in UE though, except maybe hair

  • @easternwarlord
    @easternwarlord 3 ปีที่แล้ว

    Thanks for the video. Lot of useful information.
    Changing the LOD bias level on the landscape didn't work for me though... do I miss something?

    • @TechArtAid
      @TechArtAid  3 ปีที่แล้ว

      Thanks! Hmm it should. Landscape->Select Tool->Select Section->LODBias, then set it to a positive number. Does anything change in the wireframe view mode?

    • @easternwarlord
      @easternwarlord 3 ปีที่แล้ว

      @@TechArtAid Nope. Can't get this working.

  • @QuiteDan
    @QuiteDan 2 วันที่ผ่านมา

    Quad overdraw absolutely killed my steamdeck performance. It was faster in most cases to have a transparent material vs masked material with using Dither TAA node.

    • @TechArtAid
      @TechArtAid  2 วันที่ผ่านมา +1

      😱 Unusual! Thanks for sharing. I haven't dealt with that platform so far

    • @QuiteDan
      @QuiteDan 2 วันที่ผ่านมา

      @@TechArtAid No prob! To clarify, I am still using masked materials for grass and stuff on steamdeck.
      It just tanks the frame rate really bad when I try to use Dither TAA to in place of a 50% opaque object, for instance.

  • @Shanataru
    @Shanataru 6 ปีที่แล้ว

    Great tutorial,
    can I ask you what is the difference between Mesh draw calls and Draw primitive calls? I found Draw primitive calls on "stat rhi" and it seems few times bigger. What does it even mean?

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      Interesting. If I were to guess, I'd say primitives include helper meshes, while mesh draw calls are only actual models. Can you try adding particle systems or more lamps (with shadows disabled) and see what happens?

    • @Shanataru
      @Shanataru 6 ปีที่แล้ว

      So I have added some point lights with no shadows and it seems to be steadily increasing (primitive calls from 286 to something like 366, mesh calls from 26 to something like 79). I have no idea what it means, but there you go

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      Okay. Still no idea then. A great question anyway... I'll keep that in mind for the ebook

    • @Shanataru
      @Shanataru 6 ปีที่แล้ว

      Alright, thank you anyway :)

  • @charliebrownau
    @charliebrownau 6 ปีที่แล้ว

    Gday
    Do you have any advice or tutorials to support
    OpenGL 4.5 + OpenAL + SDL2 in UE4 instead of DirectX11

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      Sorry, no idea how to do that

  • @sergelyukshin8302
    @sergelyukshin8302 7 ปีที่แล้ว

    Yeah man. That's it.

  • @lakaiart
    @lakaiart 2 ปีที่แล้ว

    why is the quad overdraw in the "quad ovderdraw viewmode" just showing for translucent objects? I thought quad overdraw occurs for small and elongated triangles. So for example a sphere should have some quad overdraw on the poles because there are mostly long triangles in that place.

    • @TechArtAid
      @TechArtAid  2 ปีที่แล้ว +1

      That's correct. Doesn't it? There should be at least a bit of overdraw. Though for translucent it's a bigger value, as you can have many e.g. particles affecting a single pixel

    • @lakaiart
      @lakaiart 2 ปีที่แล้ว

      I don't understand why quad overdraw is a problem when using translucent objects. I thought translucency only matters in terms of overdraw not quad overdraw (quad overshading). As I understand it these are two different problems. Quad overdraw occurs cause 4 pixel blocks get calculated when rendering a triangle and if they don't fit in the triangle they are wasted. Overdraw on the other hand occurs because of wrong render order so that the triangle has to be shaded again if it were rendered before the object in front of it.

    • @TechArtAid
      @TechArtAid  2 ปีที่แล้ว +1

      Ah, I see. You're right, absolutely. So maybe they just combined these 2 problems into a single view mode?

    • @lakaiart
      @lakaiart 2 ปีที่แล้ว

      @@TechArtAid yes I think they've combined these two issues. I've tested quite a bit. It seems that no matter how dense my mesh is or how far away it never shows more than a green color. If I use transparency it gets worse as you said. Orange is max though if I use a dense transparent Object. If mulitple of them overlap it goes all to white. Pretty confusing to a get a grip on what effect is from overdraw and what from quad overdraw. But thanks for you help :). Is there maybe a way to measure just the effekt of quad overdraw in ms or something similar?

  • @mhnoni
    @mhnoni 7 ปีที่แล้ว

    Can you make a small tutorial on what is Object pooling - Object caching and can it be done only in BP without C++ or plugin?

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      I'd rather cover art/graphics ideas here, but it surely is a very useful pattern :)
      It goes like that: let's say you're making a weapon blueprint. In a naive way, you'll create new bullet every time a button is pressed, then destroy it when it collides. The problem is that creating objects is costly and destroying them doesn't free memory instantly. A garbage collector (memory manager) will have to take care of destroyed objects, sometimes causing a moment of slowdown.
      So a better approach is to make an array of (let's say) 1000 bullets at the start of the game (or creation of weapon). Instead of creating new bullets, you take one of the inactive ones. When it collides, you don't destroy it - just mark it inactive and invisible.
      So you just need an Array and simple functions to "initialize" and "destroy" a bullet (just marking them active/inactive, setting location and velocity).
      Anyway, I should rather link to this site, which is pure gold: gameprogrammingpatterns.com/object-pool.html

    • @mhnoni
      @mhnoni 7 ปีที่แล้ว

      That what i was trying to understand :) no need tutorial as you explained the reason when to use the pooling and how to use it and the article is very useful it is pure gold , thanks again mate :)

  •  7 ปีที่แล้ว

    Hey, do you plan to make closed captions?

    • @TechArtAid
      @TechArtAid  7 ปีที่แล้ว

      +Michał Miłkowski Yes. As usual, though with some delay :)

    •  7 ปีที่แล้ว

      Great :)

  • @lesha1955
    @lesha1955 6 ปีที่แล้ว

    Can you please tell me, texture streaming pool locate on RAM or VRAM?

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      +lesha1955 Great question. I suspect it's VRAM - see Logan Bailey's (staff) answer: answers.unrealengine.com/questions/359407/warning-texture-streaming-pool-over-650mb.html
      Is it the same amount of RAM? I don't know. I'm not sure if the engine has to keep the textures sent to the GPU in the system RAM.

    • @lesha1955
      @lesha1955 6 ปีที่แล้ว

      Thanks for the answer. Maybe you also know why all my textures (even those that do not placed on any levels) loaded in texture streaming pool? Can I change it somewhere? I trying to fix texture memory usage with level streaming, but I can't see changes in memory stat when I load and unload levels during play in editor.I was looking for an answer everywhere, but not found it:( /*Sorry for my english*/

    • @TechArtAid
      @TechArtAid  6 ปีที่แล้ว

      +lesha1955 Have you tried the texture usage view in the Statistics window? (20:26) And are you sure they're all loaded? Try on an empty level with several assets too. (your English is good, don't worry, I'm not a native speaker either)

    • @lesha1955
      @lesha1955 6 ปีที่แล้ว

      You right, when I check it using statistics, I don't see them, but when I play in editor and logout my texture streaming pool, I see them there, here screenshots: answers.unrealengine.com/questions/757119/texture-streaming-2.html
      It's very strange...
      Should I worry about this or not? Becouse I want to optimize my game for 1Gb VRAM players, and have a lot of different textures, but if I can't unload them with level streaming, and all of textures will loaded in VRAM this will be very hard

  • @justplaying4292
    @justplaying4292 ปีที่แล้ว

    5:55 Isn't the engine using the forward rendering technique for translucency objects?

    • @TechArtAid
      @TechArtAid  ปีที่แล้ว +1

      Exactly, that's why it's so heavy. Deferred by definition allows only for 1 value (of base color, roughness) per pixel. But it means that the lighting is calculated only once too. For transparents, it has to be repeated for all "layers" in a pixel. There are some optimization techniques employed but still more expensive that deferred

    • @justplaying4292
      @justplaying4292 ปีที่แล้ว

      @@TechArtAid ​ Interesting, thanks for the clarification; also, I saw some blog and slide shows about Doom Eternal 2020 (Siggraph 2020) that is completely done in forward rendering, which makes me doubt myself if I truly understand the forward rendering.

    • @TechArtAid
      @TechArtAid  ปีที่แล้ว +1

      Because it can be fast :) but it requires a total buy-in from your content teams. VR games are forward-rendered too. They just don't have more than 2 lights at once in most situations :D Many VR games just baked all their stuff.
      Doom divides the screen into smaller tiles. It's called clustered forward, or forward+. It helps a bit. But as I said, it requires absolute discipline in keeping the content lean & well optimized

    • @justplaying4292
      @justplaying4292 ปีที่แล้ว +1

      @@TechArtAid Clustered forward, learn something new today.

  • @-CornDawg
    @-CornDawg 5 ปีที่แล้ว

    Didn't get