POV-Ray : Newsgroups : povray.newusers : Negative reaction to light sources Server Time
24 Dec 2024 11:25:09 EST (-0500)
  Negative reaction to light sources (Message 1 to 4 of 4)  
From: Sudrien
Subject: Negative reaction to light sources
Date: 19 Feb 2008 01:35:00
Message: <web.47ba77f6c8fefbc496f6ef730@news.povray.org>
Doing the usual earth render to re-acquaint myself - trying to use all the
image-map types I can find. Specifically, this question is about the nighttime
maps.
They react the opposite way, in general, as normal objects - You don't see them
in direct light (lights are off), but they are obvious when there is no natural
light source (on at night).

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...

So, what can I do to get the right effect?


-Sud.





========

/*
Based off "Earth Scene File by Constantine Thomas"

Sudrien
19 Feb 2008
*/


camera{
  location <75000,75000,0>
  direction<0,0,5>
  look_at  <0,0,0>
  rotate <0,40,0>
}


// create a regular point light source
light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  looks_like {sphere {0*x, 696265 pigment {color <0,0,0>} finish {ambient 1}}}
  translate <150000000, 0, 0>
  rotate <0,30,0>
}



#declare Earth=
union {

//Land map
  sphere { 0, 6378.01
    texture{
      image_pattern { jpeg "earthspec1k.jpg"  map_type 1 interpolate 2  }
      texture_map {
        [0.0
          pigment {image_map {jpeg "earthmap1k.jpg" map_type 1 interpolate 2 }}
          normal {bump_map { jpeg "earthbump1k.jpg" map_type 1 interpolate 2
bump_size 15.0 }}
          finish {ambient 0.2 diffuse 1}
          ]
        [1.0
          pigment {image_map {jpeg "earthmap1k.jpg" map_type 1 interpolate 2 }}
          normal {bump_map { jpeg "earthbump1k.jpg" map_type 1 interpolate 2
bump_size 15.0 }}
          finish {ambient 0.1 diffuse 1 specular 0.1 roughness 0.01}
          ]
        }
      }

    }


  sphere { 0, 6378.011
    texture{
      pigment {image_map  {jpeg "earthlights1k.jpg"  map_type 1 interpolate 2
filter all 1 transmit all 0.8 }}
      finish {ambient -0.8 diffuse -0.8}
      }
    }


       }// end Earth union

object {Earth rotate <0,135,0>}


========


Post a reply to this message

From: Tom York
Subject: Re: Negative reaction to light sources
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

From: Bob Hughes
Subject: Re: Negative reaction to light sources
Date: 19 Feb 2008 04:34:32
Message: <47baa2a8$1@news.povray.org>
Might also be a good idea to forego that filter 1 and use just transmit in a 
loop, like so:

#local Tc=0;
#while (Tc<128)
transmit Tc, 1
#local Tc=Tc+1;
#end

Need to convert to a paletted image first, of course, one with the lightest 
indices going from either 255 downward or 0 upward. Then adjust the loop 
test number up or down to what looks best. The above works for white at 255 
and gray at 128.

Negative diffuse alone should cause opposite of usual. Darker perpendicular 
to a light source and brighter the more parallel the surface gets to the 
light source. But I wasn't getting anything looking right using what you 
had.
I put no_shadow into the nighttime lights sphere, too, but that probably 
isn't needed.
-- 
/*bob hughes*/


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Negative reaction to light sources
Date: 19 Feb 2008 06:11:50
Message: <47bab976$1@news.povray.org>
> 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...

As far as I understand it, it is just based on a difference in
brightness. The lights are so faint you don't actually see them
unless you make a long exposure with sensitive equipment.

Of course this would completely saturate the visible portions
on dayside of the terminator, so all images you find which show
both surface features and city lights are probably stiched
together, post-processed and/or artificially generated.
If that is what you want, you need to fake it too ;)


Post a reply to this message

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