Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Changing Fog Colors #979

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

Changing Fog Colors #979

zz85 opened this issue Dec 29, 2011 · 2 comments
Labels

Comments

@zz85
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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 as completed Dec 31, 2011
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants