Skip to content

Changing Fog Colors #979

Closed
zz85 opened this Issue Dec 29, 2011 · 2 comments

3 participants

@zz85
zz85 commented Dec 29, 2011

Is there any dirty flags for making fog change colors at runtime?

I tried doing like scene.fog.color.setRGB(1,0,0); but this seems to be of no effect.

@alteredq

Fog color should just work.

Things to watch out for with fog:

  • fog must be present in scene on the first render, you can't add fog in runtime (as this is baked into shader), if you need to go from zero to some fog, you should start with fog that's invisible
  • you can't change fog type in runtime (linear / exponential), as also this is baked
  • fog affects only objects you render, for untouched pixels in the background you need to set clear color to match fog color
@zz85
zz85 commented Dec 29, 2011

Woo, tricky...

Wanted to change the color of the fog for this demo http://jabtunes.com/itcameupon , but then I decided to go without.

Anyways I'll link this to the FAQ too. :)

@mrdoob mrdoob closed this Dec 31, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.