POV-Ray : Newsgroups : povray.windows : some question about windows cmd : Re: some question about windows cmd Server Time
29 Apr 2024 07:18:22 EDT (-0400)
  Re: some question about windows cmd  
From: clipka
Date: 4 Apr 2018 15:26:14
Message: <5ac526d6$1@news.povray.org>
Am 04.04.2018 um 15:32 schrieb 944291641:

> Thanks for you kindness, I have try to set the color of shaded leaf, but I
> failed.Could you give me a hand that how to setup the lit and the unlit in
> different color?

You could just use plain old boring standard illumination:

    #declare MyTree = mesh { ... /* no textures here */ }

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient 0 /* shadowed areas should look pitch black */
          diffuse 1 /* lit areas should look as bright as possible */
        }
      }
    }

This would give you an image where all unlit areas are pitch black, and
all lit areas are some shade of grey (or white).


You can also use the `brilliance` mechanism to make the brightness of
the lit areas independent of the direction of illumination:

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient 0 /* shadowed areas should look pitch black */
          diffuse 1 /* lit areas should look as bright as possible */
          brilliance 0 /* incident light angle is totally irrelevant */
        }
      }
    }

If you want to use two different colours instead of black and white, you
can achieve this as well by toying with the light source colour and
ambient; e.g. to have the shadowed areas look red and the lit areas
green, you could use:

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient rgb <1,0,0> /* red */
          diffuse 1
          brilliance 0
        }
      }
    }

    light_source {
      MyLightSourcePosition
      rgb <-1,1,0> /* negative red cancels the ambient on lit areas,
                      positive green makes them look green */
    }


If you need to know which portions of the leaves are lit, even for
leaves that are not visible from the camera, you can use the mesh camera
to "bake" a texture map for the tree with the corresponding colors for
the lit and unlit areas; I'm not familiar the syntax though.


Post a reply to this message

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