Intro To Color Correction For Games

Поділитися
Вставка
  • Опубліковано 3 бер 2022
  • Post processing is a powerful tool that every indie game developer can utilize to level up their game's visuals. In this video we go over the basic math of contrast, brightness, saturation, and gamma correction for use in shaders.
    Support me on Patreon!
    / acerola_t
    Twitter: / acerola_t
    Twitch: / acerola_t
    Code: github.com/GarrettGunnell/Grass
    Join My Discord Server! / discord
    Music:
    During The Test - Persona 3 OST
    Afternoon Break - Persona 3 OST
    Some random royalty free infomercial music idk
    Thanks for watching!
    This video is dedicated to my friend, Alotryx.
    #acerola #gamedev #graphics #unity #unity3d #madewithunity #indiedev #unity2d #tutorial #shader
  • Наука та технологія

КОМЕНТАРІ • 49

  • @Acerola_t
    @Acerola_t  2 роки тому +105

    Sorry for the shorter vid, I just started a full time position at Intel as a graphics software engineer and more importantly I've been playing Elden Ring. Expect a video on recreating an effect or two from the game, since there's a lot of cool lookin stuff.
    For those that are obsessed with optimizations like myself and want to delve into post processing more before I make more vids on the topic, make sure to read about and be mindful of overdraw.

    • @CTSSTC
      @CTSSTC 2 роки тому +10

      This video was brought to you by 4:20 yolo

    • @ChrisD__
      @ChrisD__ 2 роки тому

      Woah, are you working on something related to Arc?

    • @Acerola_t
      @Acerola_t  2 роки тому +24

      @@ChrisD__ Unfortunately not. I was on Intel's graphics performance analyzer team so I was helping make their gpu profiling tools. I've since left Intel and have accepted an offer at Sony Studio Bend (studio that made Days Gone) and will be a graphics programmer on their upcoming title. I havent started that job yet though so I havent officially announced it lol

    • @mrcreepypl
      @mrcreepypl 2 роки тому +2

      @@Acerola_t congrats!

    • @Acerola_t
      @Acerola_t  2 роки тому +9

      @@mrcreepypl Thanks! I'm very excited

  • @TheComfy
    @TheComfy 2 роки тому +76

    mmmmmm yes gamma 0 and 1 color numbers math, I think I got it THANKS ACEROLA

  • @DrClementShimizu
    @DrClementShimizu 2 роки тому +68

    One of the things that can help people is knowing if you a going for physically accurate color or not. If so then one thing that I found helpful is labeling color at every phase if is linear or in in gamma space. For example a color from a texture would start in gamma space. Mathematical operations on that color should be done in linear space. The the final output should be in gamma space. Adding post processing, hdr, and tone mapping features to the render pipeline requires you to ensure the dynamic range and gamma space the inputs to the post processing matches the outputs of the shaders. Physically accurate color requires a lot of discipline to get it right.
    On a side note, I have a background in color science. I think your video is great.
    If you find the topic of color science interesting, there is a wonderful and deep field to explore with many real world applications out side of video games. I encourage those interested to experiment and test your assumptions using the scientific method. You may be surprised on much fun you have.

    • @Acerola_t
      @Acerola_t  2 роки тому +9

      As far as I'm aware in Unity, if your color space is set to linear then textures will be fed into the gpu in linear space. The documentation is rather confusing on that front.
      Physically based rendering has perhaps the most academic resources so I prefer to focus on stylized. I'm going to tackle the concepts of hdr and tonemapping in a future video for sure, gamut clipping is a topic I don't think has much coverage.
      Thanks for the comment! I would definitely love to read about color science outside of the context of video games.

  • @Elesnouman
    @Elesnouman 2 роки тому +16

    I just found your content and i have to say you are one of the few, very few devs on youtube that quite literally show the real process behind gamedev and how hard and complex it can be.
    btw you are a pretty good teacher.

  • @IdeaToGame
    @IdeaToGame Рік тому +9

    Thank you Shaggy, really high quality content and pretty useful!

  • @keyblademonkey12
    @keyblademonkey12 23 дні тому

    Oh my god your videos are incredible. I've been getting a bit more into shaders and visual effects and have had a hard time starting out as I often just don't know what terms to google / search. Your videos are so amazingly helpful and they're the perfect length too: They go into enough detail to give me all the terminology and stuff I need to google, but leave enough loose ends for me to figure out implementations and explore myself.

  • @abulak3477
    @abulak3477 2 роки тому +18

    BETWEEN 0 ANNND 1

    • @Acerola_t
      @Acerola_t  2 роки тому +4

      Thank you I made the entire video for that joke

  • @aryajpegasus
    @aryajpegasus Рік тому +6

    that make sure to clamp color to 0 and 1 SAVED MY LIFE,
    turns out that was whats was causing the weird black squares

    • @Acerola_t
      @Acerola_t  Рік тому +4

      if you're doing SDR you clamp to 0 to 1, if you're doing HDR, you clamp to 0 because negative values will ruin your life generally

    • @aryajpegasus
      @aryajpegasus Рік тому +1

      true I don't need that kinda Negativity in my life ahaha (I'll show myself out)

  • @Soundy777
    @Soundy777 2 роки тому +3

    Incredible content!!! Loving this channel! LETS GO!

  • @GFXMOD
    @GFXMOD 7 місяців тому

    I'm still waiting for more on Color Correction for games! My favorite topic.
    Great channel. Love your style, man. Please continue.

  • @frankkubrick865
    @frankkubrick865 Рік тому

    very informative, thanks a lot!

  • @grochlin7106
    @grochlin7106 2 роки тому +1

    thank u for talking about the basics : ')

  • @teamldm
    @teamldm 2 роки тому +7

    Great video! Loved the dry humor. That's a sub from me my man.

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      Thank you so much! I really appreciate it.

  • @hal3117
    @hal3117 Рік тому +2

    This man casually mirror flips his living room and thinks we won't notice! Not me, I'm as eagle-eyed as they come. Unfoolable 😎

  • @kepcukhusamettin9400
    @kepcukhusamettin9400 Рік тому

    Thanks that helped a lot

  • @kylebooth2528
    @kylebooth2528 Рік тому +2

    I know a guy who didn't clamp his values between 0 and 1. It worked ok on Windows but the values started to loop on Linux. He had me test it. It was not easy to describe.

    • @Acerola_t
      @Acerola_t  Рік тому +2

      you clamp 0 to 1 because a lot of math assumes the value is between 0 to 1, not doing so is often incorrect unless you know what you're doing

  • @braydonfisher9273
    @braydonfisher9273 9 місяців тому

    This shouldn't have been as funny as it was. Love it.

  • @gr8m8watch
    @gr8m8watch Рік тому

    This is the perfect youtube video.

  • @danielagutierrez2149
    @danielagutierrez2149 8 місяців тому

    Hi-hat, i don’t know if you know about this topic, but I’m writing my tesis. For it I had to do a camera calibration for Arducam cameras. The problem is that the linearization seems to be off. I used a color checker and the greyscale values aren’t linear, it looks more like an s… do you have maybe an idea of why? Or what could be done?

  • @quatricise
    @quatricise Рік тому +2

    As a photoshop nerd, I have to say I have a slight problem with the brightness and contrast part. Ideally, you should't clip your dark or light values like that. You might run into problems later on if you add a new object which outputs colors outside of your range, because then the object loses detail.
    In photoshop a contrast slider actually interpolates between a linear relationship and ease-in-out relationship. I think it's a mixture of two logarithms or something, but I have no idea how to describe this mathematically.
    Correct me if I misunderstand what you're doing with the brightness and contrast.

    • @Acerola_t
      @Acerola_t  Рік тому +1

      You would love the next video in which I explain how to handle rgb clipping

  • @DevDunkStudio
    @DevDunkStudio 2 роки тому +3

    Don't new unity projects use linear as default now?

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      As far as I'm aware no, but if they do that's great

    • @DevDunkStudio
      @DevDunkStudio 2 роки тому +3

      @@Acerola_t I mostly do VR development, so maybe it's the oculus plugin changing it. Because new OpenXR runtime only allows linear

    • @zelos666
      @zelos666 2 роки тому +1

      @@Acerola_t I just checked, they absolutely do. Well, at least the 3D (URP) template does. 2D (URP) still seems to use Gamma, so depends on the template, but it is definitely set as default for some of them.

  • @wires87
    @wires87 5 місяців тому

    DUSK just makes you do it yourself

  • @sansan8994
    @sansan8994 Рік тому

    Isn't your Luminance formula outdated? It's (0.2126*R + 0.7152*G + 0.0722*B) these days. Or am I missing something? @2:28

    • @Acerola_t
      @Acerola_t  Рік тому

      there's like infinite ways to calculate luminance there's no specific formula lol
      the fast way to do it is to just use the green channel only, or you can do my formula or one of the 10923810923098 other ones, it's all basically the same.

    • @sansan8994
      @sansan8994 Рік тому

      @@Acerola_t Ah ok :) thanks

  • @ch40s1
    @ch40s1 Рік тому

    moistest dryness i ever came across

  • @tonyhakston536
    @tonyhakston536 11 місяців тому

    you can't just tell me not to do something and expect me not to force it to work.

    • @Acerola_t
      @Acerola_t  11 місяців тому

      you're free to do whatever you want, but math works the same for everyone!

  • @balki4evr
    @balki4evr Рік тому

    I don’t care what anyone else has already said: you’re not getting enough credit for “your games can go from zero to one… … in rgb values.”

  • @xKeray
    @xKeray 2 роки тому +1

    unity sucks

    • @Acerola_t
      @Acerola_t  2 роки тому +4

      unity is alright as long as you don't use any unity tools

    • @INeatFreak
      @INeatFreak 2 роки тому +1

      @@Acerola_t truuuu lol

    • @xKeray
      @xKeray 2 роки тому

      @@Acerola_t fair, but I would rather just either use godot/unreal on roll something custom - especially for tutorials on graphis programming I would avoid unity