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

Content deleted Content added
Line 576:
::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.
:But if we do not subtract, then contrast ratio from 1:16 will become 16:64=1:4, will become very small. And if we subtract, then contrast ratio will increase 3 times, because before algorithm if is 1:16, then after (17-16):(64-16)=1:48. But unfortunately subtraction changing normal colours balance. So better use normal algorithm "<math>final.rgb=color.rgb/average</math>". Or to use correction, which don't brings distortion of natural colors balance:
::<math>final.rgb=((color.rgb)^{1/(2-average)})/average;</math> 0<color.rgb<1; 0<average<1.
::This way you will get weakest colour rised by 16 and more and in proper colors natural balance. For example if average=16/255=0.062745, then color=1/255=0.00392 is rised to:
::1) <math>final.rgb=(1/255)^{1/(2-16/255)}/(16/255)=0.00392^{1/1.937254902}/0.062745=0.057247641/0.062745=0.912384286;</math> or 232.66=233; so need average put to some limits like 0.5<average<1;
::2) <math>final.rgb=(1/255)/(16/255)=0.00392/0.062745=0.0625;</math> or 15.9375=16.
::Another example, average=128/255=0.5, color=16/255=0.062745 and for first case 0.5<average<1, then:
::1) <math>final.rgb=(16/255)^{1/(2-0.5)}/0.5=0.062745^{1/1.5}/0.5=0.1579/0.5=0.315803203;</math> or 80.5298=81;
::2) <math>final.rgb=(16/255)/0.5=0.062745/0.5=0.12549;</math> or 32.