Jump to content
  • Advertisement
Sign in to follow this  
IsItSharp

Pathtracing - How to combine the colors of two or more passes?

Recommended Posts

I am working on a pathtracer and right now I am struggeling with how to combine the colors after each pass.

Assume, after pass 1 we have Color1 for Pixel (1, 1), after pass 2 we have Color2 for Pixel (1,1) - how should Color1 and Color2 be combined to result in an accurate color?

Share this post


Link to post
Share on other sites
Advertisement

JoeJ is right, but it's important to point out that this needs to be done in "linear space". If you think of colors as the triplets of numbers that we plug into RGB values for a display, the arithmetic doesn't quite work out.

You need to do the computations using numbers that correspond to the physical quantity we care about (I think "luminance" might be the word I should be using, but I'm not an expert and I haven't thought about the details in a really long time). Then you'd use tone mapping to get the RGB values to send to the screen.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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!