[1.0.6] "True" gamma

A place to show off your mods and discuss modding SCPCB.
User avatar
juanjpro
Barotrauma Developer
Posts: 1180
Joined: Sun Dec 16, 2012 10:51 pm
Location: eeeeee

[1.0.6] "True" gamma

Postby juanjpro » Fri Oct 31, 2014 8:44 pm

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)
Last edited by juanjpro on Fri Apr 03, 2015 1:49 am, edited 1 time in total.
a

Abincyprus
Guard
Posts: 226
Joined: Sun Mar 16, 2014 4:31 pm

Re: [1.0.6] "True" gamma

Postby Abincyprus » Fri Oct 31, 2014 10:40 pm

Very nice! Has to be a part of the game itself tbh. This would be called a, "contrast," setting but, whateva. :p

User avatar
Juicy
Senior Staff
Posts: 1456
Joined: Mon Dec 31, 2012 7:47 pm
Location: Spain

Re: [1.0.6] "True" gamma

Postby Juicy » Sat Nov 01, 2014 2:38 am

Fine job
Don't put the gas away yet...

User avatar
Theimperfectbeing
MTF
Posts: 974
Joined: Sat Aug 31, 2013 2:35 am
Location: In a ditch

Re: [1.0.6] "True" gamma

Postby Theimperfectbeing » Sun Nov 02, 2014 5:31 am

Excellent work as usual Juan!
eric

User avatar
TheHoongs
Guard
Posts: 135
Joined: Tue Nov 19, 2013 9:42 am
Location: In a car

Re: [1.0.6] "True" gamma

Postby TheHoongs » Sun Nov 02, 2014 4:08 pm

WE NEED THIS IN THE GAME!
AM I THE ONLY FIVE NIGHTS AT FREDDY'S FAN?


Check out my game

User avatar
Skin_
Operative
Posts: 324
Joined: Sun Oct 06, 2013 10:53 am

Re: [1.0.6] "True" gamma

Postby Skin_ » Wed Nov 05, 2014 5:38 pm

Awesome! I thought something seemed a little off about it.
Image

User avatar
Nehpys
Senior Staff
Posts: 1730
Joined: Wed Feb 05, 2014 6:02 pm
Location: The Isles of Corinthia

Re: [1.0.6] "True" gamma

Postby Nehpys » Mon Nov 10, 2014 12:41 am

Actualy, yes. I agree with Abincyprus, it is more of a "Contrast" setting, but Fine job.

danielmus
Technician
Posts: 81
Joined: Mon Jan 13, 2014 9:35 pm
Location: New Zealand
Contact:

Re: [1.0.6] "True" gamma

Postby danielmus » Sat Dec 06, 2014 2:09 pm

Thank you so much for this! :D Though sadly it doesn't work if recording the screen :c

User avatar
yonzo_rikuo
MTF
Posts: 646
Joined: Fri Aug 29, 2014 10:12 am

Re: [1.0.6] "True" gamma

Postby yonzo_rikuo » Tue Jan 06, 2015 1:13 am

this question might be stupid but if you make the gamma level high, will it emit the gamma radiation?
Furries and FnaF fan must be terminated to avoid incident-[REDACTED]
- DR.Yonzo

User avatar
juanjpro
Barotrauma Developer
Posts: 1180
Joined: Sun Dec 16, 2012 10:51 pm
Location: eeeeee

Re: [1.0.6] "True" gamma

Postby juanjpro » Tue Jan 06, 2015 1:27 am

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?
a


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests