POV-Ray : Newsgroups : povray.newusers : Negative reaction to light sources : Re: Negative reaction to light sources Server Time
28 Jul 2024 18:16:49 EDT (-0400)
  Re: Negative reaction to light sources  
From: Tom York
Date: 19 Feb 2008 03:05:01
Message: <web.47ba8d1040d17fdb7d55e4a40@news.povray.org>
"Sudrien" <sud### [at] fusemailcom> wrote:
> As it is a reaction to the main light source, it's not the same as a second
> light source... and it isn't a simple ambiance problem, as they shouldn't be
> visible in daytime...

There is no luminance or ramp pattern, so last time I had this problem I took
advantage of there usually being one major light source and used a gradient
pattern to mix the nightside and darkside textures in a texture_map, something
very roughly like this (assumes your planet has a radius of 1.0):

#declare LocalLightVector = vnormalize(KeyLightPos - PlanetCentre);

// LightSide_Texture uses your daylight map
#declare LightSide_Texture = texture { ... }

// DarkSide_Texture uses your nightside map
#declare DarkSide_Texture = texture { ... }

// Full texture uses a gradient pattern to blend between them.
// The direction of the blend is the direction from
// planetary centre to the key light position (sun position).
#declare Full_Texture = texture
{
  // We want the blend to span the diameter of the planet and
  // be centred on the terminator, hence the scale by 2 and
  // the translation.
  pigment_pattern
  {
    gradient LocalLightVector scale 2 translate -LocalLightVector
  }

  // This is quite a smooth blend between day and night side textures.
  // You can make the transition sharpest by using 0.5 in both
  // texture_map entries.
  texture_map
  {
    [0.4 DarkSide_Texture ]
    [0.6 LightSide_Texture ]
  }
}

Looking back, I see I actually used a pigment_map to mix the dayside and
nightside maps via pigments rather than textures, but the principles are
exactly the same.

Tom


Post a reply to this message

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