Talk:High-dynamic-range rendering: Difference between revisions

Content deleted Content added
Line 572:
::If you have monitor (with big contrast like 8^8=16777216:1), where 255 is 8 times stronger than 128, and 128 is 8 times stronger than 64, and 64 is 8 times stronger than 32 and so on. Then by rising gamma to value <math>k_g=3</math> you applying algorithm "<math>final.rgb=(color.rgb)^{1/3}; </math> 0<color.rgb<1" and you will get, that 255 is 2 times stronger than 128, and 128 is 2 times stronger than 64, and 64 is 2 times stronger than 32. Because <math>0.8^{1/3}/0.1^{1/3}=0.9283/0.46416=2.</math>
::For monitors with contrast 2^8=256~300:1, there is no point use gamma correction, because 1 (and even 0) shining pretty strong. So if monitors developers don't put they own calibration into monitor (that 0 is 1000 times weaker than 1 and 1 is about 300 times weaker than 255), then gamma should perfectly to let you to choose desired contrast ratio (from say 50:1 to 100000:1) by changing coefficient <math>0.5<k_g<0<3.5.</math> Good thing about gamma is that it don't rising 0 at all. So this is main advantage of big contrast monitors over small contrast monitors (which have strong 0 and contrast between 1 and 0 is about 2:1 or at most 10:1), because if 0 is very black, then better visible weak colours like 3, 5, 10, if gamma is more than 1 (default gamma=1). But for some reason at least for old some CRT monitors contrast and brightness combined correction "contrast=100-brightness/2.55" rising too weak colours better and in correct contrast (you must judge if contrast between colours is correct by comparing 10 with 20 and 255 with 128 or 10 with 5, and if in all cases two times smaller number looks like two times weaker then contrast is correct, by correcting with gamma for some reason disappearing difference between 255 and 128 and difference between 5 and 10 is very big and between 10 and 20 very small, but it's maybe because in CRT (cathode ray tube) monitors screen becoming too negative and for weak colours it's big difference and for strong colours almost no difference, also after some time (after about 20 minutes) in CRT monitors screen becoming charged and weak colours becoming weaker; so for LCD monitors gamma should do everything correct). This contrast and brightness combined correction "contrast=100-brightness/2.55" difference between weak colours doing almost invisible; if before this correction colour was 10 and was two times stronger than 5, then after correction colour 10 is about 1.1 or 1.3 times stronger than 5, but for strong colours almost nothing changing, like if 128 was 2 times stronger than 64, then after correction 128 is 1.9 times stronger than 64. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Versatranitsonlywaytofly|Versatranitsonlywaytofly]] ([[User talk:Versatranitsonlywaytofly|talk]] • [[Special:Contributions/Versatranitsonlywaytofly|contribs]]) 19:25, 12 December 2011 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
::If you have monitor with contrast ratio 2^8=256:1, where 255 is 2 times stronger than 128, and 128 is 2 times stronger than 64, and 64 is 2 times stronger than 32. Then by changing gamma from 1 to 2, you will get contrast <math>(\sqrt{2})^8=1.4142^8=16:1</math>. Then 255 will be 1.4142 times stronger than 128, and 128 will be 1.4142 times stronger than 64 and so on. Because <math>\sqrt{0.2}/\sqrt{0.1}=\sqrt{2}=1.4142.</math> So if for HDR <math>k_g</math> changing from 1 to 2, then weakest color is 1/255=0.003921568 and if scene is very dark then weakest colour will become <math>0.003921568^{1/2}=0.062622429</math> and this is 0.0626*255=15.9687=16. Another example if <math>k_g=1.5</math>, then <math>0.003921568^{1/1.5}=0.00392^{2}{3}=0.024867943</math> and this is 0.02487*255=6.34=6. So at <math>k_g=2</math> range 1-16 will be expanded to 16-64, because <math>(16/255)^{1/2}=0.062745^{1/2}=0.250489716</math> and this is 0.2504897*255=63.87=64. So at <math>k_g=2</math> we want to subtract 16 or 16/255=0.0627. At <math>k_g=1.5</math>, we want to subtract 6 or 6/255=0.0235. At difference <math>1<k_g<2</math>, we want subtract proper values from 1 to 16 or from 1/255 to 16/255. So algorithm is this:
::<math>final.rgb=(color.rgb)^{1/k_g}-(1/255)^{1/k_g}=(color.rgb)^{1/(2-average)}-(1/255)^{1/(2-average)};</math> 0<color.rgb<1; 0<average<1.</math>
::Also we may want, that during weak lighting in scene, when 1/255=0.0039, would look like 16/255=0.0627, so then we do not subtract anything:
::<math>final.rgb=(color.rgb)^{1/k_g}=(color.rgb)^{1/(2-average)};</math> 0<color.rgb<1; 0<average<1.</math>