POV-Ray : Newsgroups : povray.general : ambient and glow Server Time
16 Nov 2024 23:20:54 EST (-0500)
  ambient and glow (Message 1 to 4 of 4)  
From: Rafal 'Raf256' Maj
Subject: ambient and glow
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

From: Christopher James Huff
Subject: Re: ambient and glow
Date: 7 Aug 2003 11:40:51
Message: <cjameshuff-685AED.10392407082003@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote:

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

What is the problem? The fact that it could be more complex does not 
mean there is a problem with it.


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

A better solution: just use separate textures when radiosity is on.

#declare Radiosity = on;

#if(Radiosity)
    texture {...}
#else
    texture {...}
#end

Or something similar for just the finish settings that need changed.


> 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

But why, when it's so easy to do in the scene file?


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

If it's possible already, where's the problem?


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

Those textures weren't designed for radiosity, that's why they don't 
look right. I fail to see how this would have any effect. And how is 
having an extra feature with no added functionality more elegant?

There is something called "emissivity" that actually is fairly difficult 
(maybe impossible) to fully simulate in POV, but it appears to be 
unrelated to what you are talking about. Emissivity would simply add to 
the surface color, not contribute to the ambient lighting, and would be 
independent of radiosity.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: ambient and glow
Date: 7 Aug 2003 11:57:56
Message: <Xns93D0B6AF4FE7raf256com@204.213.191.226>
cja### [at] earthlinknet news:cjameshuff-
685### [at] netplexaussieorg

> But why, when it's so easy to do in the scene file?
> If it's possible already, where's the problem?

True, it's maybe not a problem, but a thing that could be done more 
elegant. It's only a suggestion to make code more clear.

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

From: Roberto A 
Subject: Re: ambient and glow
Date: 7 Aug 2003 17:01:42
Message: <3f32be36$1@news.povray.org>
> It's only a suggestion to make code more clear.
>
> --
> #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

Hehehe, clear as the code in your .sig? :-D

Just kidding! :-D


Post a reply to this message

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