POV-Ray : Newsgroups : povray.general : trying to create mirrored wall, with sun glint Server Time
30 Jul 2024 18:11:05 EDT (-0400)
  trying to create mirrored wall, with sun glint (Message 1 to 4 of 4)  
From: Leef me
Subject: trying to create mirrored wall, with sun glint
Date: 7 Oct 2008 03:15:00
Message: <web.48eb0b65ba15f375892adb1d0@news.povray.org>
I want to create a wall that mimics the reflectiveness of a building that has
mirrored glass on the outside. The real effect I would like is the glint when
you happen to catch the sun as it passes (or you move quickly as in a car)

Can anyone make suggestions for my code, or help me start from scratch if I'm
going the wrong way?


Thank in advance.

Leef_me


#version 3.6;

#include "colors.inc"

//global_settings {
//  assumed_gamma 1.0
//  max_trace_level 5
//}


camera {

#if(1)                    // normal view
  location  <0.0, 0,7>
  look_at   <0.0, 0.0, 0>

#else                     // top view
  location  <0.0, 20,5.5>
  look_at   <0.0, 0.0, 2>

#end

}



#if(1)

light_source {
  <0, 0, 9>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-12+frame_number/2,+12-frame_number/2,0>

}
#end



// the diffuse setting seems to allow for a spot effect

#declare mirror_texture =  texture {
    pigment {
      color rgb <1,1,1>
    }
    finish { reflection {1} ambient .0 diffuse .6
//    finish { reflection {1} ambient 0 diffuse 0
    }
}

#if(0)

// Create an infinite sphere around scene
// and allow any pigment on it
sky_sphere {
  pigment {
    gradient y
    color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] }
  }
}

#end



#if(1)    // create a grid of mirrors, each rotated slightly


#declare y1 = -5;
#declare y2 = 5;
#while (y1<=y2)


    #declare x1 = -5;
    #declare x2 = 5;
    #while (x1<=x2)

      //mirror box
      box { 0,1
      rotate<y1,x1,0>
            scale .9
      translate <x1,y1,-10>
      texture {mirror_texture}

      }

    #declare x1 = x1+1;
    #end

#declare y1 = y1+1;
#end

#else   // or create one larger mirror

  box { -5,5
  scale <1,1,.01>
  translate <0,0,-10.>
  texture {mirror_texture}
  }

#end



  //mirror frame, to help identify where the mirror is located
  box { -8,8
  scale <1,1,.01>
  translate <0,0,-10.1>
      pigment { color Red}

  }


#if(1) // select a solid white area, later will use a picture

   box { 0,1

#if(1)

      pigment { color White}
#else

      pigment {        image_map  {   jpeg "wcleaves.jpg"      }  scale 1   }

#end

      scale <20,20,.01>
      translate <-10,-10,10>

}

#end


Post a reply to this message

From: jan dvorak
Subject: Re: trying to create mirrored wall, with sun glint
Date: 7 Oct 2008 04:48:32
Message: <48eb2260@news.povray.org>
Leef_me napsal(a):
> I want to create a wall that mimics the reflectiveness of a building that has
> mirrored glass on the outside. The real effect I would like is the glint when
> you happen to catch the sun as it passes (or you move quickly as in a car)
> 
> Can anyone make suggestions for my code, or help me start from scratch if I'm
> going the wrong way?

you need to add a specular reflection if you want to reflect light_sources.


Post a reply to this message

From: Reactor
Subject: Re: trying to create mirrored wall, with sun glint
Date: 7 Oct 2008 22:20:00
Message: <web.48ec17c9607a3def984f57650@news.povray.org>
"Leef_me" <nomail@nomail> wrote:
> I want to create a wall that mimics the reflectiveness of a building that has
> mirrored glass on the outside. The real effect I would like is the glint when
> you happen to catch the sun as it passes (or you move quickly as in a car)
>
> Can anyone make suggestions for my code, or help me start from scratch if I'm
> going the wrong way?
>
>
> Thank in advance.


Unfortunately, depicting the sun in a mirror is not as simple as it may seem.
One of the difficulties that you may face is the relative brightness between
the sun as a light_source with color 1 and other lightly colored objects in the
scene cannot be reproduced realistically without special techniques.
  Other possible concerns are the type of 'glint' effect you want to see may be
caused by many different things occurring simultaneously that must be
explicitly specified in povray.  For instance, as you may already be aware,
light_sources by default have no visible appearance.  Photons might be required
to duplicate the effect that you want.  Things like lens flares must be
simulated via the use of objects (there are macros for this).

That being said, let's look at your texture.

> // the diffuse setting seems to allow for a spot effect
>
> #declare mirror_texture =  texture {
>     pigment {
>       color rgb <1,1,1>
>     }
>     finish { reflection {1} ambient .0 diffuse .6
> //    finish { reflection {1} ambient 0 diffuse 0
>     }
> }


I recommend changing this to something more like:


#declare mirror_texture =  texture {
    pigment {
      color rgb <0.900,1.000,0.975>//<1,1,1>
    }
    finish {
        specular 1 roughness 0.001  // use one or the other,
        // phong 5 phong_size 200   // both generally not needed
        reflection { 1 metallic 1 }
        ambient 0 diffuse 0
    }

    normal{
    average
    normal_map{
        [1.00 bumps .005 scale 1/4 ]
        [1.00 bumps .010 scale 1 ]
            }
    }
//    finish { reflection {1} ambient 0 diffuse 0
}

The pigment statement:
    I added some color so that the reflection has a slight tint - this could
also have been simulated by using a color vector after the reflection keyword.

The finish statement:
    The specular and roughness keyword will give you bright highlights on the
surface.  Lower roughness values give tighter (smaller) highlights, and should
be used for shinier surfaces (the best value for a scene is usually determined
by experimentation).  Specular can be greater than one, providing brighter
highlights, but color clipping may become an issue, leading to large, bright
highlights that have unusually hard edges.
    I set ambient and diffuse to zero, which is best for perfectly mirrored
objects.  Setting the ambient or diffuse lighting to something other than zero
will cause the object to be shaded in response to the light (or lack of, in the
case of ambient) in addition to being mirrored, which can cause the reflections
to look brighter, in effect reflecting more light than what hits the surface.
That being said, setting specular and phong to zero, setting diffuse to
something greater than one (2 - 5) and boosting the brilliance to about 1000
can give you another, related highlight effect.  However, the angle will be
different from that of the specular highlight, which may be unrealistic in an
area with complex lighting conditions (such as when the shadow of a building
covers part of the mirror).

The normal statement:
    I gave the texture some bumpiness to give the wavy, distorted effect often
present with large pieces of mirrored glass.


        HTH,
    -Reactor


Post a reply to this message

From: Alain
Subject: Re: trying to create mirrored wall, with sun glint
Date: 9 Oct 2008 13:58:40
Message: <48ee4650$1@news.povray.org>
Leef_me nous illumina en ce 2008-10-07 03:10 -->
> I want to create a wall that mimics the reflectiveness of a building that has
> mirrored glass on the outside. The real effect I would like is the glint when
> you happen to catch the sun as it passes (or you move quickly as in a car)
> 
> Can anyone make suggestions for my code, or help me start from scratch if I'm
> going the wrong way?
> 
> 
> Thank in advance.
> 
> Leef_me
> 
> 
You need to add some highlight, ether specular or phong, to your mirrors.
You may also use a looks_like object with a large ambient value.

-- 
Alain
-------------------------------------------------
Wanna be lonely? Get married.


Post a reply to this message

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