OpenGL Tutorial 24 - Gamma Correction

preview_player
Показать описание
In this tutorial I'll show you what gamma correction is, why you should apply it to your scenes, and how to do so!

*Source Code*

*OpenGL Documentation*

*Discord Server*

*Patreon*

*Timestamps*
0:00 Introduction & Definition
0:10 Gamma Explanation
0:59 Gamma Correction
1:27 Implementing Gamma Correction
2:11 Washed Out Problem Explanation
2:34 Fix Textures & Background
3:06 Precision Errors
3:28 Precision Fix
3:51 Ending

*References*

#opengl #opengltutorial #computergraphics #cpp #visualstudio #3dgraphics #gammacorrection
Рекомендации по теме
Комментарии
Автор

Thank you for your tutorials!
I especially like how you first explain the general idea, show a nice detailed graphic presentation,
show the code and further explain it, and lastly show some frequently done mistakes to avoid.

daifee
Автор

First of all, I like your videos, they're usually very to the point, and incremental. So congrats!
I do have one nitpick to do on this one: light is not linear, as stated. We perceive it with our eyes, and they have an inherent gamma curve, which is why monitors will also have that curve.

The motivation is missing as well: why not just leave gamma well enough alone? Because when you do light transformations in code, a multiplication of light by 2, would actually not work as expected, it would multiply by a gamma corrected factor. So you do the gamma transform to act like the monitor and make the color of assets linear (loading as SRGB in your case), then you do whatever light transforms you want, then before tossing it to the screen you do the inverse transform to prevent the 2x problem you mentioned.

lkt
Автор

This is awesome! I always thought that gamma-correction options in games were just a nice-to-have for user preferences, but it is actually intended for some users out there whose monitors look wildly different from what the developer expected?

blaarkies
Автор

I like the way you are shuffling out them tutorials lately!

jedder
Автор

Another wonderful tutorial as always.

Can i ask a question?
how did you learned opengl?

manasraut
Автор

Hey victor can you do a tutorial on mouse picking, gizmos and infinite base grid? Awesome video as always❤️

diahaidificbs
Автор

Is that because when we power a value between [0, 1] like 0.5 then the higher the power number, the less the result will be. For example: 0.5^0.2 > 0.5^5, (0.2 = 1/5). So we apply gamma correction for the same principle because color value always range from 0.0f to 1.0f. Thank you!!!

PhamAnhKhoa
Автор

Hey victor, can you make a tutorial about batch rendering and how to incorporate it into a game engine?

fudgeracoon
Автор

I was reading about samplers. I found some people use glBindSampler() next to glBindTexture(). I never used it. So, do you know if it's necessary? When should I use it?

starklosch
Автор

So if I understood this correctly, do I need to use all these to have proper gamma correction:
1. glEnable(GL_FRAMEBUFFER_SRGB)
2. Apply gamma correction in the shader
3. Load textures with GL_SRGB
Do all of these 3 need to implemented at the same time?

nerijusvilcinskas
Автор

Implementing this makes no difference as diffuse textures almost always have gamma correction applied. So unless you want fine control over gamma or your implementing some kind of special post-processing effect then don't bother using this.

JadeWinters
Автор

These videos are a goldmine, thank you so much, really :). Have you considered other types of shaders for future tutorials (like compute shaders for raytracing, etc.)?

pollomagico
Автор

Por favor pode colocar tradução para português Brasil?

gr-source