POV-Ray : Newsgroups : povray.programming : Implementing a new pigment : Re: Implementing a new pigment Server Time
1 May 2024 18:29:58 EDT (-0400)
  Re: Implementing a new pigment  
From: Nicolas Alvarez
Date: 29 Nov 2008 23:33:01
Message: <4932177c@news.povray.org>
Nicolas Alvarez wrote:
> I want to know how do I go about implementing a new pigment type. It's not
> a pattern, and it's not a new bitmap file format for image_map; I have to
> get a x,y,z point as input and return a rgbt color.
> 
> Would be also good if someone could give me some basic pointers on where
> to start modifying the parser to read parameters for it (although that's
> kind of low priority, especially considering I have yet to look at the
> parser code).

I want to report I got a very basic pigment working in like 15 minutes.

sphere {
  <0,0.5,0>,0.5
  pigment {
    my_test
  }
}

Renders a green sphere. "my_test" is a new keyword, not a pre-#declared
pigment. The code that calculates the pigment color is pretty simple:

      case MY_PATTERN:
        Make_Colour(Colour, 0.0, 1.0, 0.0);
        Colour_Found = true;
        break;


Post a reply to this message

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