POV-Ray : Newsgroups : povray.programming : Implementing a shader : Re: Implementing a shader Server Time
5 Jul 2024 14:41:04 EDT (-0400)
  Re: Implementing a shader  
From: ABX
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

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