4. Shadow_pigment

4.1. Description

Ce patch ajoute un paramètre à une lumière : un pigment pour les ombres qu'elle projette. (Comme tout les autres patchs ici c'est du bricolage, et en particulier fonctionnement non garanti si utilisation avec transparence, photons et autres bizarreries :).

4.2. Syntaxe

light_source { ... shadow_pigment { pigment_ombre } ... }

Les ombres créées par cette light_source seront de couleur définie par pigment_ombre.

4.3. Exemples

shadow_pigment
Shadow_pigment
camera { location <0,1.5,-5> up y right x look_at <0,1,0> }

// Shadow_pigment light_source
light_source 
{ 
  <-50,35,-10> color rgb 1
  shadow_pigment { color rgb <1,0,0> } }

// Light_sources normales
light_source { <50,30,-10> .4 }
light_source { <0,10,10> .3 }

sphere { <-1,1,0>, 1 pigment { color rgb 1 } finish { ambient .2 diffuse .8 } }
box { <-0.5,0,-0.5>,<.5,2,.5> rotate 40*y translate 1*x pigment { color rgb 1 } finish { ambient .2 diffuse .8 } }
sphere { <0,0.2,-1>, .2 pigment { color rgb 1 } finish { ambient .2 diffuse .8 } }

plane { y,0 pigment { color rgb 1 } finish { ambient .2 diffuse .8 } }
shadow_pigment avec area_light
Shadow_pigment avec area_light

Pareil que ci-dessus mais avec une area_light.

shadow_pigment avec plusieurs lights
Shadow_pigment avec plusieurs lights
light_source { <50,30,-10> .4 shadow_pigment { color rgb <0,1,0> }}
light_source { <0,10,10> .3 shadow_pigment { color rgb <0,0,1> }}

Pareil en ajoutant des shadow_pigment aux deux autres light_source.

4.4. Program

Look for #ifdef SHADOW_PIGMENT_PATCH in sources

A pointer to a pigment was added into the light struct (Light_Source_Struct).

Possible improvements/problems

  • There are certainly situations not very well handled with this (exotic) patch. Needs more testing