Jump to content


realtime fire and ice


60 replies to this topic

#21 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 22 May 2012 - 03:36 PM

 rouncer, on 22 May 2012 - 09:24 AM, said:

hey alienizer, nice work there, thanks for the input.
could you explain tone mapping to me? im not familiar with the term!

http://expf.wordpres...pping_operator/

The one from Geon is a must as well.

#22 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 22 May 2012 - 04:26 PM

IMO the best tonemapping algorithm for games currently is Jim Hejl's curve, as reported in John Hable's talk about Uncharted 2. The equation is on slide 140 of this presentation. It's quite simple and has no adjustable parameters (you for sure want to incorporate an adjustable exposure and maybe contrast before applying this equation), but it looks very nice, especially once you have a proper HDR value range in your scenes. BTW, that whole presentation is well worth a read; it's a very good general introduction to the issues of gamma correction, linear-color-space lighting, HDR and tonemapping...every graphics programmer should know these things. :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#23 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 23 May 2012 - 03:34 PM

hmmm, I used the code on page 137 and everything is light gray with a bit of shades!!?? looks like a bad ambient occlussion. Seems to simple the code, am I missing something?

#24 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 23 May 2012 - 06:12 PM

I said page 140, not 137. :) The stuff from page 137 was an older version that used lookup textures that you have to initialize with some filmic curve. Just apply the equation from 140 (to each RGB channel independently). Again, that must be applied to linear HDR color values after scaling by exposure. And it incorporates the linear-to-gamma conversion, so it generates an sRGB output color.
reedbeta.com - developer blog, OpenGL demos, and other projects

#25 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 02:53 AM

Indeed you said 140, but stupid me I had to stop at the first equation page :blink:

I don't understand the LinearColor-0.004 thing. I mean, does LinearColor is the actual color output from the render, or does it need to be LinearColor = Color/(Color+1) or something?

#26 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 04:09 AM

better? (note theres no tone mapping, just adjusted light levels.)
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#27 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 04:49 AM

YES, much better! Now the sun starts to feel HOT :)
A little brighter maybe?

#28 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 24 May 2012 - 04:54 AM

LinearColor is just the linear-color-space, HDR color value output from the renderer.
reedbeta.com - developer blog, OpenGL demos, and other projects

#29 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 05:58 AM

too bright?
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#30 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 07:13 AM

this seems to be the happy medium.
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#31 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 09:26 AM

more modelling...
Posted Image
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#32 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 11:36 AM

this areas done... :)
Posted Image
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#33 Stainless

    Member

  • Members
  • PipPipPipPip
  • 610 posts
  • LocationSouthampton

Posted 24 May 2012 - 01:23 PM

That looks 100% right to me :)

#34 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 01:48 PM

thanks Stainless!
just to polish it off, tiny little bumps on the surface.
Posted Image
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#35 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 02:08 PM

Looks perfect to me now. Great job on the lighting! First one, yes, too bright.

#36 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 02:12 PM

 Reedbeta, on 24 May 2012 - 04:54 AM, said:

LinearColor is just the linear-color-space, HDR color value output from the renderer.

ok, so the equation wants LinearColor, not the color from the render. So how does this work then??

#37 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2759 posts

Posted 24 May 2012 - 02:29 PM

thanks alienizer, getting the balance between the ambient light and the direct light seems to be the trick.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#38 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 03:53 PM

 rouncer, on 24 May 2012 - 02:29 PM, said:

thanks alienizer, getting the balance between the ambient light and the direct light seems to be the trick.

It looks fantastic now. I can just imagine when you'll put some monsters :lol: and stuff, and a background how nice it'll look! Are you working on a game or just for pleasure?

#39 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 24 May 2012 - 04:47 PM

 Alienizer, on 24 May 2012 - 02:12 PM, said:

ok, so the equation wants LinearColor, not the color from the render. So how does this work then??

Read the rest of that presentation.
reedbeta.com - developer blog, OpenGL demos, and other projects

#40 Alienizer

    Member

  • Members
  • PipPipPipPip
  • 440 posts

Posted 24 May 2012 - 05:56 PM

 Reedbeta, on 24 May 2012 - 04:47 PM, said:

Read the rest of that presentation.

I did, but it still isn't looking right, everything is dull. I just don't understand it. I even tried the codes from http://filmicgames.com/archives/75 and still isn't right. My render material colors are between o and 1, but lights hiting a surface will go way above 1, so the final render data is >= 0 <=(all lights power added up) Could that be the problem?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users