Jump to content
  • Advertisement
Sign in to follow this  
Thevenin

Darkening an image in Real-Time.

This topic is 4871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having difficulties with my Day/Night rendering. Currently I simply subtract a multiple of 50 from Red,Green, and Blue to make the scene darker, however, this isn't working to well. [rolleyes] Given an RGB structure, whats the best (easy + good looking) way to darken it?

Share this post


Link to post
Share on other sites
Advertisement
Normally that'd be done with modulation (multiply everything by 0.5) rather than subtraction. For really good results, you'd probably do gamma correction, but modulation will work fine for most purposes.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
Normally that'd be done with modulation (multiply everything by 0.5) rather than subtraction. For really good results, you'd probably do gamma correction, but modulation will work fine for most purposes.


[embarrass]

Thanks~
ratings++;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Also, for a night effect have the blue factor slightly higher than red and green.

Share this post


Link to post
Share on other sites
And don't fall for the for some reason sometimes made assumption that *.75 is undone by doing *1.25 later on. Just saying.

Share this post


Link to post
Share on other sites
Quote:
Original post by Trienco
And don't fall for the for some reason sometimes made assumption that *.75 is undone by doing *1.25 later on. Just saying.


Multiplying by 0.75 is undone by doing exactly the inverse, dividing by 0.75.
If you want to use multiplies instead of divides to get the original value, then it is done by multipliying by (1.0 / 0.75 ) which is 1.33333

Share this post


Link to post
Share on other sites
just pointing out the obvious, but you should probably keep two images if you're going to be doing a lot of multiplication on them, otherwise the image would deteriate over time by repeated multiplies. make sure you have one image that retains it's original values, and always use that to do the transformations on.

Tim

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!