POV-Ray : Newsgroups : povray.programming : Implementing a shader Server Time
3 Jul 2024 05:43:10 EDT (-0400)
  Implementing a shader (Message 1 to 3 of 3)  
From: MM
Subject: Implementing a shader
Date: 16 Apr 2003 04:35:02
Message: <web.3e9d15a675c877fe5fe3f1440@news.povray.org>
I'm trying to implement a simple shader in POV-Ray by modifying the existing
source code.  The code is quite extensive, and knowing where to begin seems
a bit confusing.  Does anyone have any ideas on where I would specify a
method call to a shader to determine the colour of a particular ray
intersecting an object?  Does anyone know if a method has been created to
determine the incident angle of a ray on an object, and if so, under which
class is it?

Thanks,

MM


Post a reply to this message

From: ABX
Subject: Re: Implementing a shader
Date: 16 Apr 2003 04:48:27
Message: <fd5q9vcf8qpdo7v0vfhptvrv7bha0n0h08@4ax.com>
On Wed, 16 Apr 2003 04:34:46 EDT, "MM" <jro### [at] po-boxmcgillca> wrote:
> I'm trying to implement a simple shader in POV-Ray by modifying the existing
> source code.

Have you seen POV-Man - "Bridge between POV-Ray and RenderMan" ?

> The code is quite extensive, and knowing where to begin seems
> a bit confusing.  Does anyone have any ideas on where I would specify a
> method call to a shader to determine the colour of a particular ray
> intersecting an object?

There is nothing different between POV engine and general raytracing engine
idea. First objects are checked for intersection then pigment is calculated. I'm
not sure what part you want replace but go to render.cpp and find trace_pixel()
and start reading what is order of calls. Names of functions usually well
describes what they do.

> Does anyone know if a method has been created to
> determine the incident angle of a ray on an object

You mean angle between ray and normal at intersection point? Look into
http://mathworld.wolfram.com/ or standard include files in POV distribution.

> and if so, under which
> class is it?

Class ? Have you looked into POV-Ray sources already ? ;-)

Out of curiosity: have you idea about implementing shader for general purposes
or just because you need some specific pattern you can't find ? Perhaps there is
much simpler workaround for you, though some would like shader implemented.

ABX


Post a reply to this message

From: MM
Subject: Re: Implementing a shader
Date: 27 Apr 2003 01:10:06
Message: <web.3eab6561f851515fa7ace9950@news.povray.org>
ABX wrote:
>On Wed, 16 Apr 2003 04:34:46 EDT, "MM" <jro### [at] po-boxmcgillca> wrote:
>> I'm trying to implement a simple shader in POV-Ray by modifying the existing
>> source code.
>
>Have you seen POV-Man - "Bridge between POV-Ray and RenderMan" ?
>

I got hold of POV-Man and all my problems have been solved. Thanks a lot
:-)!

>Out of curiosity: have you idea about implementing shader for general purposes
>or just because you need some specific pattern you can't find ? Perhaps there is
>much simpler workaround for you, though some would like shader implemented.
>
>ABX
>

I needed to create and test a particular pattern (a soap bubble shader to be
exact), which I've now been able to do.

Again, thanks a lot,

MM


Post a reply to this message

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