• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            黎明的剔透里伸出了你沁清的曖昧

            Graphics|EngineDev|GameDev|2D&3D Art

              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              60 隨筆 :: 1 文章 :: 18 評(píng)論 :: 0 Trackbacks


            image

            在計(jì)算機(jī)圖形學(xué)領(lǐng)域時(shí)常聽(tīng)到gamma correction ,gamma correction 控制了圖像整體的亮度,reproduce colors也需要gamma correction的一些理論知識(shí),gamma correction不僅僅是控制了圖像的亮度,而且還控制了RGB各個(gè)分量的比例,我們知道渲染器是線(xiàn)性的,而顯示器并非線(xiàn)性,其實(shí)電子打在屏幕上從而產(chǎn)生亮點(diǎn),電子的運(yùn)動(dòng)受電壓控制,這兩者是指數(shù)關(guān)系的,所以產(chǎn)生的亮度也跟電壓成指數(shù)關(guān)系,而發(fā)送給顯示器的voltages范圍是0~1:

            image

            image

            對(duì)于我們輸入的圖像,如果直接顯示,那么就會(huì)篇暗,根據(jù)已知電壓與顯示亮度的關(guān)系,進(jìn)行g(shù)amma correction ,其實(shí)就是對(duì)gamma曲線(xiàn)的修正。一般生產(chǎn)廠(chǎng)家不加說(shuō)明,他們的伽碼值大約等于2.5.

            image

            image

            代碼:

               gammaCorrection = 1 / gamma
               colour = GetPixelColour(x, y)
               newRed   = 255 * (Red(colour)   / 255) ^ gammaCorrection
               newGreen = 255 * (Green(colour) / 255) ^ gammaCorrection
               newBlue  = 255 * (Blue(colour)  / 255) ^ gammaCorrection
               PutPixelColour(x, y) = RGB(newRed, newGreen, newBlue)

            知道m(xù)onitor不是一個(gè)線(xiàn)性的,那么我們?cè)谶M(jìn)行顏色加法時(shí),我們得到的顏色并不是真正的顏色值的相加,比如gamma factor是2.2

            red = add (r1, r2);

            red= add (0.235,0.156);

            對(duì)于一個(gè)線(xiàn)性設(shè)備,red = 0.391,對(duì)于未經(jīng)修正的montior red=0.126;

            因?yàn)橛幸粋€(gè)冪函數(shù)的運(yùn)算:C_out = C_in2.2

            現(xiàn)在使用gamma correction :C_corrected= C_out1.0/2.2

            0.3912.2 = 0.126

            0.1261.0/2.2 = 0.39

            我們看到使用伽碼校正以后我們能得到我們預(yù)想的顏色值0.39.

             

            imageimage

             

            imageimage

             

            imageimage

             

             

            There are two ways to do gamma correction:

            • Using the renderer. The renderer (the graphics card or GPU) is a linear device. Modern renderers have the support of gamma correction via sRGB textures and framebuffer formats. See the following OpenGL extensions for more details: GL_ARB_framebuffer_sRGB and GL_EXT_texture_sRGB. With these extensions you can get gamma corrected values for free but gamma correction factor is set to 2.2. You can’t change it.
            • Using a software gamma correction. The gamma correction is applied to the final scene buffer thanks to apixel shader and you can set the gamma correction you want.

            In OpenGL, using GL_ARB_framebuffer_sRGB is really simple: once your FBO is bound, just enable the sRGB space with

            glEnable(GL_FRAMEBUFFER_SRGB);
             
            gamma-correction
            posted on 2012-11-15 23:05 情絕格調(diào)(fresmaster) 閱讀(1652) 評(píng)論(1)  編輯 收藏 引用 所屬分類(lèi): GraphicsDocuments

            評(píng)論

            # re: Gamma Correction 2014-07-09 11:35 tzzhwj
            謝謝你的勞動(dòng)  回復(fù)  更多評(píng)論
              

            日韩精品久久久久久免费| 久久综合成人网| 狠狠色丁香久久婷婷综合蜜芽五月| 伊人久久大香线焦综合四虎| 无码伊人66久久大杳蕉网站谷歌| 精品伊人久久大线蕉色首页| 久久久久亚洲AV成人网人人网站 | 99热精品久久只有精品| 精品国产乱码久久久久久1区2区| 色欲久久久天天天综合网| 亚洲国产欧洲综合997久久| 久久亚洲私人国产精品vA| 久久精品人人槡人妻人人玩AV | 国内精品久久久久久久久电影网| 午夜精品久久影院蜜桃| 99久久无色码中文字幕人妻| 亚洲午夜无码久久久久| 国内精品久久久久影院优| 国产99久久久国产精品~~牛| 久久久久婷婷| 亚洲伊人久久精品影院| 久久99久久99小草精品免视看| 久久精品18| 亚洲色大成网站www久久九| 久久精品国产亚洲一区二区| 激情五月综合综合久久69| 国产精品久久久久a影院| 91久久精品91久久性色| 四虎影视久久久免费观看| 久久久久亚洲AV片无码下载蜜桃| 中文字幕亚洲综合久久| 久久伊人精品一区二区三区| 国产精品美女久久久久久2018| 久久久久九九精品影院| 久久久久亚洲AV无码麻豆| 久久国产成人精品国产成人亚洲| 久久久久久伊人高潮影院| 久久99精品国产麻豆不卡| 青草国产精品久久久久久| 久久久久久av无码免费看大片| 日韩久久久久久中文人妻|