Particle System Color - Advanced Materials - Episode 53

Поділитися
Вставка
  • Опубліковано 15 тра 2024
  • In this tutorial video for Unreal and Unity, we add color controls to our particle system so we can tint the particles. There's also a bonus tip showing how to add the pixel clip function to reduce overdraw and increase performance.
    ------------------------------------
    Here's last week's tutorial that shows how to add opacity controls so the particles can fade in and out instead of popping:
    • Particle System Opacit...
    Here's the playlist for all of the videos in the series:
    • Creating a Particle Sy...
    Shader Book Recommendations
    www.bencloward.com/resources_...
    ------------------------------
    Theme Music
    Peace in the Circuitry - Glitch Hop
    teknoaxe.com/Link_Code_3.php?q...
    Background Music
    Speo - Reminiscent
    • Speo - Reminiscent [Ta...
    #UnrealEngine #shadergraph #Unity

КОМЕНТАРІ • 12

  • @Jbbriant-Ardaria
    @Jbbriant-Ardaria 29 днів тому +1

    Awesome Ben, thank you to follow this mission to teach us how to make good looking video games !

  • @shanyup
    @shanyup 25 днів тому

    Your lessons are great. Can you make a shader for the desert with the sand effect on it? I watched the previous lesson number 14, but it may be possible to get an even better view, especially when applied to terrain. It would be great if you could, thank you.

  • @itay7
    @itay7 28 днів тому +3

    Is baking color into 3 channels cheaper on performance than doing basic recolor math with 1 grayscale channel? I think it's GPU vs RAM

    • @BenCloward
      @BenCloward  27 днів тому +1

      Great question! There is a performance cost to using pixel clip, so the performance you gain back from the clipping has to out-weight the cost you pay for performing it. It makes sense to use in a case like this where there is potentially a lot of overdraw but my not be as impactful on other things. The only real way to know is to test it with and without and see which is cheaper.

    • @fleity
      @fleity 26 днів тому

      @@BenCloward This comment was probably meant to be an answer rto a different comment which asekd about the downsides of pixel clipping.

    • @fleity
      @fleity 26 днів тому

      It depends. Baking the colors into the texture saves a minor amount of instructions at the cost of additional gpu memory. This happens often you trade instructions vs memory. Without hard measured proof I'd say you are probably better of with doing a few more instructions (especially if it is simple stuff like a lerp) compared to using up more gpu memory.
      If you are able to use the same texture multiple times by just tinting it differently this memory saving quickly builds up.
      If for whatever reason you would be instruction count bound but would have memory free to spare the story is a bit different, but that should happen very rarely.

    • @BenCloward
      @BenCloward  25 днів тому

      @@fleity Yep - you're right. I must have made a mistake. Thanks!

  • @DillonBoucherDesigns
    @DillonBoucherDesigns 27 днів тому

    What are the downsides of Pixel Clipping? Should I be Pixel Clipping all of my masked/translucent materials that have unused pixels? Or are there diminishing returns if used too much in your scene?

    • @fleity
      @fleity 26 днів тому

      Yes! There are additional costs to alpha discard / pixel clipping compared to a fully opaque shader. It makes very little sense to alpha clip everything by default. If you know an object can be fully opaque it is better to communicate that from the beginning. It can help a little bit with overdraw but it is much more useful if you used with otherwise opaque shaders which benefit from depth testing which then prevent all surfaces behind the current one to not be drawn at all.
      On Tile-based deferred gpus (mobile, meta quest) there is a hardware shader stage for "hidden surface removal" which culls fully opaque areas directly on the gpu. BUT alpha clipping breaks this optimization for that entire tile causing the tile to render multiple times. This is really device specific and in depth and less of a in general thing... but oh well, fun stuff, alpha clip can be more expensive on these gpus than just alpha blending.

  • @gamnoidan
    @gamnoidan 28 днів тому

    Hello Ben!
    Thank you for your great tutorials!
    I have a problem with Pixel clipping.
    1) I dont understand why it works for you :)
    2) This custom hlsl works for me only as mask, so when i put it to opacity input it just works like usual opacity mask, but all pixels (even which should be clipped) still draws.
    What have i done wrong? Maybe i should turn on something for this?

    • @GMTechArt
      @GMTechArt 28 днів тому

      add parameter to World Position Offset.

    • @BenCloward
      @BenCloward  27 днів тому

      I'm sorry but I don't understand your description of the problem.