POV-Ray : Newsgroups : povray.newusers : declaring a new texture with a macro : Re: declaring a new texture with a macro Server Time
4 May 2024 15:20:54 EDT (-0400)
  Re: declaring a new texture with a macro  
From: Warren
Date: 1 Dec 2015 10:40:00
Message: <web.565dbe1c4f56292ca73f5e290@news.povray.org>
I post the content of the files
File #1 : CouleursPersoAnt.inc


#declare C_marronA1=rgb<113/256, 65/256, 52/256>;
#declare C_marronA2=rgb<117/256, 69/256, 56/256>;

niveau 1 des sols marrons




#declare C_marronB1=rgb<138/256, 89/256, 73/256>;
#declare C_marronB2=rgb<130/256, 85/256, 69/256>;
#declare C_marronB3=rgb<125/256, 77/256, 65/256>;
#declare C_marronB4=C_marronA1;
#declare C_marronB5=C_marronA3;

#declare C_marronC1=C_marronB1*1.15;
#declare C_marronC2=C_marronB2*1.15;
#declare C_marronC3=C_marronB3*1.15;
#declare C_marronC4=C_marronB4*1.15;
#declare C_marronC5=C_marronB5*1.15;
//End of file

File #2 : textures_JeuM_v3.inc

//Nouveau fichier pour les textures
#include "colors.inc"
#include "CouleursPersoAnt.inc"

//Textures des differents sols pour Mercenaires

#macro
T_var_Wrinkles(multiplicateur,Cmarron1,Cmarron2,Cmarron3,Cmarron4,Cmarron5,ValAmbient,ValDiffuse)
    texture{pigment{wrinkles color_map{
                                       [0.0 Cmarron3*multiplicateur]
                                       [0.125 Cmarron2*multiplicateur]
                                       [0.25 Cmarron1*multiplicateur]
                                       [0.375 Cmarron2*multiplicateur]
                                       [0.5 Cmarron3*multiplicateur]
                                       [0.675 Cmarron4*multiplicateur]
                                       [0.75 Cmarron5*multiplicateur]
                                       [0.875 Cmarron4*multiplicateur]
                                       [1.0 Cmarron3*multiplicateur]
                                      }
                    scale 0.005
                    }
            finish { ambient ValAmbient diffuse ValDiffuse}
           }
#end
//Definitions des sols marron avec les macros
#declare
T_marron_MacroNiv1=T_var_Wrinkles(<1,1,1>,C_marronA1,C_marronA2,C_marronA3,C_marronA4,C_marronA5,1,0)
#declare
T_marron_MacroNiv2=T_var_Wrinkles(<1.12,1.1,1.1>,C_marronA1,C_marronA2,C_marronA3,C_marronA4,C_marronA5,1,0)
#declare
T_marron_MacroNiv3=T_var_Wrinkles(<1.32,1.3,1.3>,C_marronA1,C_marronA2,C_marronA3,C_marronA4,C_marronA5,1,0)
#declare
T_marron_MacroNiv4=T_var_Wrinkles(<1.52,1.5,1.5>,C_marronA1,C_marronA2,C_marronA3,C_marronA4,C_marronA5,1,0)

//Texture de la roche des pentes avec sols marrons
#declare T_rocheGriseA=T_var_Wrinkles(<1.3, 1.15,
1>,Gray80,Gray70,Gray60,Gray50,Gray40, 1,0)
#declare T_rocheGriseA2=texture{T_rocheGriseA finish{specular 0.2 diffuse 0.4
ambient 0.24} normal{granite 0.6 scale 0.1}}

File #3 : pentes_v3_x128.pov

#version 3.7;

global_settings{assumed_gamma 1.0}

#declare Anim_Serie=true;
#declare xN=128;
#declare HeightField=true;
#declare Mesh=false;
#declare Photo=true;
#include "textures_JeuM_v3.inc"

#declare T_transition1_2 = texture{gradient y texture_map{[0.0
T_marron_MacroNiv1][0.1 T_rocheGriseA2][0.9 T_rocheGriseA2][1.0
T_marron_MacroNiv2]}};
#declare T_transition2_3 = texture{gradient y texture_map{[0.0
T_marron_MacroNiv2][0.1 T_rocheGriseA2][0.9 T_rocheGriseA2][1.0
T_marron_MacroNiv3]}};
#declare T_transition3_4 = texture{gradient y texture_map{[0.0
T_marron_MacroNiv3][0.1 T_rocheGriseA2][0.9 T_rocheGriseA2][1.0
T_marron_MacroNiv4]}};

#declare tps=clock;

#if (Photo =true)
camera{
       orthographic
       location <0.000001,20,0>
       look_at <0,0,0>
       direction -y
       sky z

  up 2*z
  right 2*x
      }
#else
camera{location <2.5,4,2.5> look_at <0,1,0>}
#end

light_source{<10,20,10>*100 color rgb 1}


height_field{jpg

             #if (Anim_Serie=true)

                     #if (tps>=0 & tps<4)
                        "HF_x128_lineaire1"
                     #end
                     #if (tps>=4 & tps<8)
                        "HF_x128_lineaire2"
                     #end
                     #if (tps>=8 & tps<12)
                        "HF_x128_coin1"//Orniere
                     #end
                     #if (tps>=12 & tps<16)

                     #end
                #end
             #end
             smooth
             translate <-0.5,0,-0.5>


             rotate 90*tps*y
             #end

             scale <2,1,2>
             texture{T_transition1_2}
             scale <1,4,1>

             no_shadow
           }

And the ini file for an auto renderer

-w128
-h128
+a0.3
+KFI0
+KFF15
+KI0
+KF15
+Ipentes_v3_x128.pov
+Ooutput/rr12_x128_.png
+Q9


Post a reply to this message

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