POV-Ray : Newsgroups : povray.general : POV-Ray lighting model vs Rayshade Server Time
30 Jul 2024 18:10:55 EDT (-0400)
  POV-Ray lighting model vs Rayshade (Message 1 to 10 of 10)  
From: Grim Reaper
Subject: POV-Ray lighting model vs Rayshade
Date: 4 Jun 2008 04:25:00
Message: <web.48465076c44304ed6863987c0@news.povray.org>
I have always liked the Rayshade lighting model, since you can specify the
ambient, diffuse and specular colour as rgb values, instead of the POV-Ray
percentage of diffuse model.

What are the chances of allowing this in POV-Ray? Or can someone tell me how to
write a Renderman surface shader that will mimic the Rayshade model so I can
use it with POVMan.

The problem with the POV-Ray model is that you can never get exactly the colour
you want, even when you iteratively try and refine it. If you change the light
you have to redo all the colour. It's harder to get the colour you want, cause
you can't just directly specify it.

Thanks


Post a reply to this message

From: Alain
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 4 Jun 2008 20:18:27
Message: <484730d3$1@news.povray.org>
Grim Reaper nous illumina en ce 2008-06-04 04:21 -->
> I have always liked the Rayshade lighting model, since you can specify the
> ambient, diffuse and specular colour as rgb values, instead of the POV-Ray
> percentage of diffuse model.
> 
> What are the chances of allowing this in POV-Ray? Or can someone tell me how to
> write a Renderman surface shader that will mimic the Rayshade model so I can
> use it with POVMan.
> 
> The problem with the POV-Ray model is that you can never get exactly the colour
> you want, even when you iteratively try and refine it. If you change the light
> you have to redo all the colour. It's harder to get the colour you want, cause
> you can't just directly specify it.
> 
> Thanks
> 
> 
In POV-Ray you can always set those parameters with a full colour instead of 
shades of gray. diffuse 1 get promoted to diffuse<1,1,1>.

The following are all legal:
ambient <1,0.5,0.1>/10 // give a red tint to your shadowed areas. Also to the 
rest of the object.
diffuse <0.2, 1, 0.898> // This object will apears blue-green
specular <0.5,0.3,0.8> // bluish megenta specular highlights.
phong <0,1,0> // green phong highlight

If you want rgb value in the 0-255 range, just divide the colour vector by 255.

-- 
Alain
-------------------------------------------------
99 percent of lawyers give the rest a bad name.


Post a reply to this message

From: Tom York
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 5 Jun 2008 14:55:00
Message: <web.484835734c6c80f27d55e4a40@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> The following are all legal:
> ambient <1,0.5,0.1>/10 // give a red tint to your shadowed areas. Also to the
> rest of the object.
> diffuse <0.2, 1, 0.898> // This object will apears blue-green
> specular <0.5,0.3,0.8> // bluish megenta specular highlights.
> phong <0,1,0> // green phong highlight

I'm probably completely wrong, but I thought that diffuse, specular and phong
have always accepted only floats, not colour values. It certainly seems that
way in 3.61, at least. Is this incorrect?

Tom


Post a reply to this message

From: Grim Reaper
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 6 Jun 2008 07:50:00
Message: <web.484923ac4c6c80f26863987c0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

> In POV-Ray you can always set those parameters with a full colour instead of
> shades of gray. diffuse 1 get promoted to diffuse<1,1,1>.
>
> The following are all legal:
> ambient <1,0.5,0.1>/10 // give a red tint to your shadowed areas. Also to the
> rest of the object.
> diffuse <0.2, 1, 0.898> // This object will apears blue-green
> specular <0.5,0.3,0.8> // bluish megenta specular highlights.
> phong <0,1,0> // green phong highlight
>
> If you want rgb value in the 0-255 range, just divide the colour vector by 255.

Tried it, but the only one that allows a vector is ambient, the others do not.
Also the ambient vector does not work as expected, instead of setting the
ambient colour to that colour it just seems to change it to the equivalent
percentage (float) value.


Post a reply to this message

From: Chris B
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 7 Jun 2008 05:19:46
Message: <484a52b2$1@news.povray.org>
"Grim Reaper" <sup### [at] hotmailcom> wrote in message 
news:web.484923ac4c6c80f26863987c0@news.povray.org...
> Alain <ele### [at] netscapenet> wrote:
>
>> In POV-Ray you can always set those parameters with a full colour instead 
>> of
>> shades of gray. diffuse 1 get promoted to diffuse<1,1,1>.
>>
>> The following are all legal:
>> ambient <1,0.5,0.1>/10 // give a red tint to your shadowed areas. Also to 
>> the
>> rest of the object.
>> diffuse <0.2, 1, 0.898> // This object will apears blue-green
>> specular <0.5,0.3,0.8> // bluish megenta specular highlights.
>> phong <0,1,0> // green phong highlight
>>
>> If you want rgb value in the 0-255 range, just divide the colour vector 
>> by 255.
>
> Tried it, but the only one that allows a vector is ambient, the others do 
> not.
> Also the ambient vector does not work as expected, instead of setting the
> ambient colour to that colour it just seems to change it to the equivalent
> percentage (float) value.
>

Ambient seems to work the way I would expect it to when a colour is 
specified, so the following code shows up as mainly red, even though the 
pigment is more yellow.

camera {location <0,0,-1> look_at 0}
light_source {   <-4,75 ,-10   >, rgb 1}
sphere {<0,0,3>,1
  pigment {rgb <0.5,1,0>}
  finish  {ambient <1,0,0> phong 0.5}
}

Diffuse, Specular and Phong in the 3.6.1 help are listed as accepting an 
'Amount', rather than a 'Color' and POV-Ray 3.6.1 whinges about it when a 
colour is specified. Can anyone verify the behaviour of the 3.7 beta?

Regards,
Chris B.


Post a reply to this message

From: Carlo C 
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 7 Jun 2008 08:40:01
Message: <web.484a80a84c6c80f2db0701950@news.povray.org>
"Tom York" <alp### [at] zubenelgenubi34spcom> wrote:
> Alain <ele### [at] netscapenet> wrote:
> > The following are all legal:
> > ambient <1,0.5,0.1>/10 // give a red tint to your shadowed areas. Also to the
> > rest of the object.
> > diffuse <0.2, 1, 0.898> // This object will apears blue-green
> > specular <0.5,0.3,0.8> // bluish megenta specular highlights.
> > phong <0,1,0> // green phong highlight
>
> I'm probably completely wrong, but I thought that diffuse, specular and phong
> have always accepted only floats, not colour values. It certainly seems that
> way in 3.61, at least. Is this incorrect?
>
> Tom

Is absolutely correct, unfortunately.


Post a reply to this message

From: Grim Reaper
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 8 Jun 2008 05:50:00
Message: <web.484baa224c6c80f26863987c0@news.povray.org>
> Ambient seems to work the way I would expect it to when a colour is
> specified, so the following code shows up as mainly red, even though the
> pigment is more yellow.
>
> camera {location <0,0,-1> look_at 0}
> light_source {   <-4,75 ,-10   >, rgb 1}
> sphere {<0,0,3>,1
>   pigment {rgb <0.5,1,0>}
>   finish  {ambient <1,0,0> phong 0.5}
> }

Your example works for me to, but it seems to only work when the ambient and rgb
shares rgb values, that is the red component is more than zero for both. The
following for example doesn't work as expected.

camera {location <0,0,-1> look_at 0}
light_source {   <-4,75 ,-10   >, rgb 1}

sphere
{
   <0,0,3>,1
   pigment {rgb <0.8, 0, 0>}
   finish
   {
      ambient <0, 0, 1>  phong 0.5
   }
}


Post a reply to this message

From: Warp
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 8 Jun 2008 06:44:23
Message: <484bb807@news.povray.org>
Grim Reaper <sup### [at] hotmailcom> wrote:
> The following for example doesn't work as expected.

  Actually it does work as expected. If the surface is pure red, it does
not reflect anything than red light. It will not reflect blue light. Thus
it will not reflect blue ambient light either.

  POV-Ray was designed from the very start to emulate classical lighting
principles such as this one (although, admittedly, you can still achieve
physically incorrect results, such as an object reflecing *more* light
than it's receiving).

  I'm not saying that's a good (or a bad) thing. I'm just stating a fact.

-- 
                                                          - Warp


Post a reply to this message

From: Chris B
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 8 Jun 2008 07:02:32
Message: <484bbc48@news.povray.org>
"Grim Reaper" <sup### [at] hotmailcom> wrote in message 
news:web.484baa224c6c80f26863987c0@news.povray.org...
>> Ambient seems to work the way I would expect it to when a colour is
>> specified...
>
> Your example works for me to, but it seems to only work when the ambient 
> and rgb
> shares rgb values, that is the red component is more than zero for both.
>

Ah I can see what you're expecting, but the Ambient setting is controlling 
how much of the light coming from the object simulates ambient lighting of 
the pigment specified. If the colour of the object has a zero red component 
then any red in the ambient lighting will have no impact. By contrast, I 
believe that the 'reflection' finish setting is independant of the colour of 
the pigment, allowing red to be reflected off a pure shiny green surface.

Regards,
Chris B.


Post a reply to this message

From: Grim Reaper
Subject: Re: POV-Ray lighting model vs Rayshade
Date: 9 Jun 2008 03:15:01
Message: <web.484cd7c64c6c80f26863987c0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Grim Reaper <sup### [at] hotmailcom> wrote:
> > The following for example doesn't work as expected.
>
>   Actually it does work as expected. If the surface is pure red, it does
> not reflect anything than red light. It will not reflect blue light. Thus
> it will not reflect blue ambient light either.
>
>   POV-Ray was designed from the very start to emulate classical lighting
> principles such as this one (although, admittedly, you can still achieve
> physically incorrect results, such as an object reflecing *more* light
> than it's receiving).
>
>   I'm not saying that's a good (or a bad) thing. I'm just stating a fact.
>
> --
>                                                           - Warp

Ok so I guess the question becomes: Does anyone know what lighting model formula
I can use to mimic the Rayshade lighting model in POVMan through a Renderman
shader?


Post a reply to this message

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