Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Screen Brightness/Contrast Changing

Author
Message
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 7th May 2007 13:27
Hi. I was wondering... is there a way to change the brightness/conrast of the screen (or a quick way to do it for an image) like in photoshop with DBPro?

Thanks,
-Sixty Squares

MadrMan
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: 0x5AB63C
Posted: 7th May 2007 14:32
maybe the 'set gamma' command can help?
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 15th May 2007 13:59 Edited at: 15th May 2007 13:59
Thanks for responding,

I think SET GAMMA may work for brightness, however not all computers support it.

Does anyone else have any ideas (or a shader) that I could try?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th May 2007 15:11
SET GAMMA also only works if you are running in full-screen exclusive mode.

Try this:
- Make your camera render to an image.
- Make a fullscreen sprite from this image.
- Alter the alpha level of the sprite.

It's going to be slow(ish), but it might work for you.

NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 15th May 2007 15:20
Use the settings on your screen.


Since the other one was scaring you guys so much...
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th May 2007 01:48
@IanM: I think that doing that gives you a motion blur effect...

Randomness 128
18
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 16th May 2007 03:21
It does.

If you want to increase the brightness, you could use a white sprite that fills the screen. Set the alpha level to 0 (or better yet hide it) for no brightness adjustment. Increase the alpha level to make it brighter. You could make it darker by using a black sprite instead.

For contrast, I have no idea.

Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th May 2007 04:20
That's a good idea Randomness 128! Well, that solves brightness... Now for contrast. That's the hardest part I tihnk...

Jrock
19
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Riven
Posted: 16th May 2007 04:52
It may not be very efficent, but you could probably use a shader for contrast.

Practice makes perfect. But if nobody is perfect, why practice?
Agent Dink
21
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 16th May 2007 07:32
You could scale a plane to the screen size and texture it with your camera image and use ghosting? But that would only increase the brightness and contrast, you wouldn't have any control as to how much...

I have no signature...
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 16th May 2007 12:23
Do you want this effect to be done in realtime (ie while the game is playing with very little slowdown) or is it for static images?

[center]
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th May 2007 13:36
@JRock: Are there any shaders that could help with something like this?

@Agent Dink: That sounds like a cool idea...

@Nicholas Thompson: It would be done in realtime.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th May 2007 15:20
Quote: "I think that doing that gives you a motion blur effect...
"


No, you are setting the gamma of the sprite, not the alpha. Gamma affects brightness, alpha affects transparency.

You set the gamma of a sprite by using the SET SPRITE DIFFUSE command on a colour by colour basis, like so:



Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th May 2007 23:33 Edited at: 17th May 2007 05:04
Quote: "- Alter the alpha level of the sprite."


Anyway I see what you mean IanM. That probably will work for brightness.

Anyway I tried Agen Dink's idea and I'm getting pretty good but semi-odd results:



Jrock
19
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Riven
Posted: 17th May 2007 01:11
Well, if you still need it, this might do the job (But you'd have to buy DarkShader)

Here is what I found:
Hue Sat Lighting Affects the hue and saturation levels of the scene

http://darkbasicpro.thegamecreators.com/?f=darkshader

And if all else fails, you could probably make one in DarkShader.

Practice makes perfect. But if nobody is perfect, why practice?
Agent Dink
21
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 17th May 2007 05:19
Heh, my idea is funky!

I have no signature...
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 18th May 2007 00:07
Is there any way of using SET GAMMA RED,GREEN,BLUE, this is a topic I too am very curious in achieving

Login to post a reply

Server time is: 2025-08-08 15:33:40
Your offset time is: 2025-08-08 15:33:40