POV-Ray : Newsgroups : povray.general : Had a thought.. : Had a thought.. Server Time
1 Aug 2024 00:18:53 EDT (-0400)
  Had a thought..  
From: Patrick Elliott
Date: 29 Jun 2006 16:22:23
Message: <MPG.1f0de469270f5a65989f30@news.povray.org>
Specifically last night when I couldn't sleep. No idea how I got around 
to thinking about POV-Ray. The last thing I was doing was watching the 
new Blade TV show. lol

Anyway.. I seem to remember discussions of problems with trying to 
simulate sunlight, etc. Mainly, no matter how far away you place a 
light, it never produces a parallel path, or at least not without 
placing it so far away that the light never gets to the objects. But, if 
I understand Sky_Sphere right, it acts on the color of a pixel if the 
ray goes effectively infinite.. So, my first thought was something like:

Sky_Light {
  X, Y, Z
  // 0 = point light, 1 = unit disc.
  size {0/1
        [scale <x,y>]}
  pigment {...}
  falloff 0->1
}

Where X,Y,Z is the "direction" from origin the light would appear on the 
sky_sphere, size is either a point or unit sized disc, which in the 
later case can be scaled, and there is a falloff, which lets you 
determine how fast the light shrinks. The only problem was.. How to make 
it work with the sky_spheres own pattern, so I thought:

Sky_Light {
  X, Y, Z
  // 0 = point light, 1 = unit disc.
  size {0/1
        [scale <x,y>]}
  pigment {...}
  [mask_pattern {...}]
  falloff 0->1
}

Which would let you define something like a transparency mask. How much 
the sky_sphere gives off light, relative to the sky_light, would be 
determined by the mask. Ok.. Still has problems... The thought though 
was that something like a cloud could have a mask that made the 
"denser" parts transfer less light than the other parts, so you could 
get some shadows from the clouds. Then it occurred to me that this still 
doesn't deal with the sun type source too well. What is needed is for 
falloff to be patterned as well, so you can define a sharp drop near the 
center disc, then a much slower fade from there, so that some light is 
still coming off the farthest edges of the visible sky, just like in the 
real world. But, how to determine the "brightness" of stars, without 
them producing large enough amounts of light to act like normal point 
sources as well... The do provide "some" after all, just not a lot and 
they need to be visible.

Then I decided this was getting too complex and decided, maybe a 
sky_light isn't needed. What might work better is to make a light_mask 
or even add a pattern system to ambient, for the sky_sphere. In other 
words, either define a kind of brightness pattern that determines how 
much "light" is given off by parts of the sky_sphere, or just let 
ambient be defined the same way as the texture for the sky_sphere, so 
that you can create white spots for stars, using stafield, but also use 
the same pattern to determine the "brightness" of those spots from the 
standpoint of providing light. This would however mean, in both cases, 
disabling any current light interaction with sky_sphere, when the new 
options are used, so that its only visible as per the ambient level it 
produces, not just by itself. The light_mask is probably the better bet, 
ambient isn't meant to be a light source, except in cases like 
radiosity, where it does work like one. But, this actually means that 
maybe the visibility of the sky_sphere "must" be based on interaction 
with the mask, since other lights in the scene having an effect on it 
would mess things up a lot.

So, what does anyone think of the idea. I am only assuming its possible 
to make such a light source system work, but unless I am seriously 
missing something, I would think it would solve the parallel light from 
distant sources issue, and better than the current system, which has an 
ambient value/light amounts from the sky_sphere that is for the entire 
object. You are still forced to make a "sun" point light or area light 
as well, which won't produce quite the right results. Of course, I have 
no bloody clue if this would be any better, but that's for the people 
that know how the heck this would/wouldn't work to figure out. lol

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}


Post a reply to this message

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