POV-Ray : Newsgroups : povray.general : ambient and glow : ambient and glow Server Time
4 Aug 2024 02:23:13 EDT (-0400)
  ambient and glow  
From: Rafal 'Raf256' Maj
Date: 7 Aug 2003 10:47:43
Message: <Xns93D0AAC7B324Fraf256com@204.213.191.226>
Hi,
there is some problem related to ambience. It could have 2 functions, it 
can be used to simulate radiosity light in renders without actual 
radiosity, and it can make an object a lightsource.

How about separating this two purposes of ambient?

I.e. we ambient will mean "imitate radiosity" and will NOT be used when 
radiosity is on. And new property "glow" (or some other name) will mean the 
abount of light that surface of object produses itself.

Example of usage :

object { TheMountains  finish { ambient .1 } }

object { ThePersonUnderALamp  finish { ambient .5 } }

object { TheRadioactiveWaste  finish { ambient .1 glow .8 } }


global_settings { // multiplyers for ambient light and for glow
  light_ambient 1 , 0 // 1 when radiosity is OFF, and 0 when it's ON
  light_glow    1 , 1 // 1 when radiosity is OFF, and 1 when it's ON 
}

As for source code - it's mater of adding second ambient value, and adding 
line probably like:

ambient = ambient_ambient * cfgA  +  ambient_glow * cfgB

where cfgA and cfgB depends on whenever radiosity if on or off, and on 
global settings



Currently it is possible to simulate such behaviour i.e. using

#macro PutAmbient(amb, glow)
  ambient
  amb * cfgA  +  glow * cfgB
#end 

finish { PutAmbient(0.1, 0.8) }


But Imho this solution is not very elegant, especialy when it is needed 
inside  includes like metals.inc  (otherwise some materials starts to glow)



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

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