POV-Ray : Newsgroups : povray.unofficial.patches : Why can't patterns be declared ? : Re: Why can't patterns be declared ? Server Time
1 Sep 2024 22:12:58 EDT (-0400)
  Re: Why can't patterns be declared ?  
From: Thorsten Froehlich
Date: 2 Mar 2001 23:13:17
Message: <3aa06f5d$1@news.povray.org>
This is approximately (because it isn't complete or perfect) how it 
should look like.  Compare it with the current code and take a guess how
much work it is...

struct Pattern_Struct
{
 unsigned short Type, Wave_Type, Flags;
 int References;
 SNGL Frequency, Phase;
 SNGL Exponent;
 WARP *Warps;
 union
 {
  DENSITY_FILE *Density_File;
  IMAGE *Pattern_Image;
  VECTOR Gradient;
  SNGL Agate_Turb_Scale;
  short Num_of_Waves;
  short Iterations;
  short Arms;
  struct
  {
   SNGL Mortar;
   VECTOR Size;
  } Brick;
  struct
  {
   SNGL Control0, Control1;
  } Quilted;
  struct
  {
   DBL Size, UseCoords;
   VECTOR Metric;
  } Facets;
  struct
  {
   VECTOR Form;
   VECTOR Metric;
   DBL Offset;
   DBL Dim;
   short IsSolid;
   VECTOR *cv;
   long lastseed;
   VECTOR lastcenter;
  }  Crackle;
  struct
  {
   VECTOR Slope_Vector, Altit_Vector;
   short Slope_Base, Altit_Base;
   SNGL Slope_Len, Altit_Len;
   UV_VECT Slope_Mod, Altit_Mod;
  } Slope;
  struct
  {
   unsigned short Fn;
   void *Data;
  } Function;
  PIGMENT *Pattern_Pigment;
 } Vals;
};

enum PIGMENT_TYPE
{
 NO_PIGMENT = 0,
 COLOR_PIGMENT,        // uses Colour
 AVERAGE_PIGMENT,      // uses Average_Map
 UV_PIGMENT,           // uses Blend_Map and Pigment
 IMAGE_PIGMENT,        // uses Image
 PATTERN_PIGMENT       // uses Blend_Map and TPat
};      

struct Pigment_Struct
{
 PIGMENT_TYPE Pigment_Type;
 union
 {
  COLOUR Colour;
  BLEND_MAP *Average_Map;
  struct
  {
   BLEND_MAP *Blend_Map;
   union
   {
    PIGMENT *Pigment;
    TPATTERN *TPat;
   };
  };
  IMAGE *Image;
 };
};

enum NORMAL_TYPE
{
 NO_NORMAL = 0,
 IMAGE_NORMAL,         // uses Image
 PATTERN_NORMAL        // uses TPat
};

struct Tnormal_Struct
{
 NORMAL_TYPE Normal_Type;
 SNGL Amount;
 SNGL Delta;
 union
 {
  IMAGE *Image;
  TPATTERN *TPat;
 };
};

struct Texture_Struct
{
 TEXTURE *Next;
 TEXTURE *Next_Material;
 PIGMENT *Pigment;
 TNORMAL *Tnormal;
 FINISH *Finish;
 TEXTURE *Materials;
 int Num_Of_Mats;
};

struct Finish_Struct
{
 SNGL Diffuse, Brilliance;
 SNGL Specular, Roughness;
 SNGL Phong, Phong_Size;
 SNGL Irid, Irid_Film_Thickness, Irid_Turb;
 SNGL Temp_Caustics, Temp_IOR, Temp_Dispersion,
      Temp_Refract, Reflect_Exp;
 SNGL Crand, Metallic;
 RGB Ambient, Reflection_Max, Reflection_Min;
 SNGL Reflection_Falloff;
 int Reflection_Type;
 SNGL Reflect_Metallic;
 int Conserve_Energy;
};


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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