Page 1 of 2

[1.0.6] "True" gamma

Posted: Fri Oct 31, 2014 8:44 pm
by juanjp600
Actual gamma correction takes every pixel on the screen and raises its R,G and B components by a power of 1/gamma, assuming that the values of RGB are between 0 and 1. The game's implementation just makes the whole screen brighter, but things are still hard to see because the contrast is low.

This mod changes the UpdateScreenGamma function to be closer to what gamma correction actually is.

Download
https://www.mediafire.com/?jy38fi0jqxmc46d
Drag this into your SCP-CB (v1.0.6) folder and run it.

Source code changes:
Main.bb
Replace UpdateScreenGamma with this:

Code: Select all

Function UpdateScreenGamma()
	Local n# = 1.0/ScreenGamma
	Local k%
	
	For k=0 To 255 
		Local c# = Min(Max(0, ((k/255.0)^n)*255), 255)
		SetGamma k,k,k,c,c,c
	Next 
	UpdateGamma 
End Function
Menu.bb
Replace line 486 with this:

Code: Select all

ScreenGamma = (SlideBar(x + 310*MenuScale, y+6*MenuScale, 150*MenuScale, ScreenGamma*50.0)/50.0)

Re: [1.0.6] "True" gamma

Posted: Fri Oct 31, 2014 10:40 pm
by Abincyprus
Very nice! Has to be a part of the game itself tbh. This would be called a, "contrast," setting but, whateva. :p

Re: [1.0.6] "True" gamma

Posted: Sun Nov 02, 2014 5:31 am
by Theimperfectbeing
Excellent work as usual Juan!

Re: [1.0.6] "True" gamma

Posted: Sun Nov 02, 2014 4:08 pm
by TheHoongs
WE NEED THIS IN THE GAME!

Re: [1.0.6] "True" gamma

Posted: Wed Nov 05, 2014 5:38 pm
by Skin_
Awesome! I thought something seemed a little off about it.

Re: [1.0.6] "True" gamma

Posted: Mon Nov 10, 2014 12:41 am
by Nehpys
Actualy, yes. I agree with Abincyprus, it is more of a "Contrast" setting, but Fine job.

Re: [1.0.6] "True" gamma

Posted: Sat Dec 06, 2014 2:09 pm
by danielmus
Thank you so much for this! :D Though sadly it doesn't work if recording the screen :c

Re: [1.0.6] "True" gamma

Posted: Tue Jan 06, 2015 1:13 am
by yonzo_rikuo
this question might be stupid but if you make the gamma level high, will it emit the gamma radiation?

Re: [1.0.6] "True" gamma

Posted: Tue Jan 06, 2015 1:27 am
by juanjp600
yonzo_rikuo wrote:this question might be stupid but if you make the gamma level high, will it emit the gamma radiation?
What kind of question is this? Does your PC explode if you play a video of a nuke?

Re: [1.0.6] "True" gamma

Posted: Tue Jan 06, 2015 3:34 pm
by InnocentSam
juanjpro wrote:
yonzo_rikuo wrote:this question might be stupid but if you make the gamma level high, will it emit the gamma radiation?
What kind of question is this? Does your PC explode if you play a video of a nuke?
Yes.
Image