POV-Ray : Newsgroups : povray.programming : fog flag to fade to sky_sphere/background color : Re: fog flag to fade to sky_sphere/background color Server Time
19 Apr 2024 16:10:48 EDT (-0400)
  Re: fog flag to fade to sky_sphere/background color  
From: scott
Date: 30 May 2013 03:09:38
Message: <51a6fb32$1@news.povray.org>
>> Would there be much interest in adding a flag to the fog object that
>> uses the scene background colour (eg from sky_sphere or background) as
>> fog_color rather than a constant?
>
> A while back I wrote an SDL version of something similar to what you're talking
> about, sans background support (which wouldn't have made much sense). Using it
> is... not very easy. Every object taking part in the fog has to have its texture
> wrapped in a special macro. The camera position needs to be tracked. Creating
> and/or converting sky pigments requires special macros. It could easily become a
> nightmare when trying to combine it with other scene-management-intensive
> activities like texture baking.

I first tried to implement a similar effect using media, but you have to 
manually "translate" whatever pigment you've used on the sky_sphere into 
a density map, and getting it to match up (so that objects towards 
infinity appear the same colour as the sky_sphere) is not trivial. Also 
rendering time takes a much bigger hit than with a simple fog.

> So yeah, I'd be interested :)

Thinking about it a bit more it would probably be more flexible if you 
could just use a pigment object for the fog color, then if you want you 
can just use the same one for sky_sphere, or something different (eg if 
you have a cloud layer that you don't want to fade to). That sounds a 
bit more work to implement though.

I'll see if I can have a go at implementation of the first idea, but 
last time I tried to compile the source with Visual Studio Express I 
remember getting atlbase.h errors (I'm pretty sure I got it to work in 
the past with VSexpress so I'll spend some more time with it over the 
weekend).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.