POV-Ray : Newsgroups : povray.general : INQUIRY: Wooden Planks Texture : Re: INQUIRY: Wooden Planks Texture Server Time
5 May 2024 08:48:02 EDT (-0400)
  Re: INQUIRY: Wooden Planks Texture  
From: Sven Littkowski
Date: 3 Apr 2018 05:44:07
Message: <5ac34ce7$1@news.povray.org>
Thanks. Will try to adapt both given examples to what I need. But i
recognize, both versions are solid bodies and not just plain textures.
Will check further...




On 01.04.2018 01:53, Thomas de Groot wrote:
> /************************************************************************
**********
>  Persistence of Vision Ray Tracer Scene Description File
>  File name   : DH_WoodFloor_2.pov
>  Version     : 3.6
>  Description : Macro for making a wooden board floor
>                in version 2 the texture has been changed to a patterned o
ne
>                
>  Date        : October 2004; version 2: 31 March 2008
>  Author      : Dan B. Hentschel
>  Adapted		 : Thomas de Groot (03-2008 & 11-2017)
>  E-mail      : Povray newsgroup
>  
>  Copyright (C) 2004. All rights reserved.
> *************************************************************************
*********/
> 
> // for use with v.3.7:
> // +w640 +h640 +a0.3 +am2 +bm2 +wt6
> // +w800 +h800 +a0.3 +am2 +bm2 +wt6
> //Using UberPOV no_cache; stochastic antialiasing; roughness
> //+w800 +h800 +am3 +a0.01 +ac0.9 +r4 +bm2 +wt6
> 
> //#version 3.7;
> #version unofficial patch 3.71; //UberPOV
> #patch "upov-radiosity-no_cache" 0.1;
> #patch "upov-reflection-roughness" 0.9;
> 
> #ifndef (Standalone)	#declare Standalone = true;	#end
> #include "rand.inc"
> 
> 
> #macro Woodmap1(r,g,b)
>     [0.0, 0.1 color srgb <0.88*r, 0.60*g, 0.40*b>
>               color srgb <0.88*r, 0.60*g, 0.40*b>]
>     [0.1, 0.9 color srgb <0.88*r, 0.60*g, 0.40*b>
>               color srgb <0.60*r, 0.30*g, 0.20*b>]
>     [0.9, 1.0 color srgb <0.60*r, 0.30*g, 0.20*b>
>               color srgb <0.60*r, 0.30*g, 0.20*b>]
> #end
> 
> #macro Woodmap2(r,g,b)
>     [0.0, 0.1 color srgbt <0.55*r, 0.32*g, 0.20*b, 0.100>
>               color srgbt <0.55*r, 0.32*g, 0.20*b, 0.500>]
>     [0.1, 0.2 color srgbt <0.55*r, 0.35*g, 0.20*b, 0.650>
>               color srgbt <0.88*r, 0.60*g, 0.40*b, 0.975>]
>     [0.2, 0.3 color srgbt <0.88*r, 0.60*g, 0.40*b, 0.975>
>               color srgbt <0.60*r, 0.30*g, 0.20*b, 1.000>]
>     [0.3, 0.4 color srgbt <0.60*r, 0.30*g, 0.20*b, 0.100>
>               color srgbt <0.60*r, 0.30*g, 0.20*b, 0.500>]
>     [0.4, 0.9 color srgbt <0.60*r, 0.30*g, 0.20*b, 0.650>
>               color srgbt <0.88*r, 0.60*g, 0.40*b, 0.975>]
>     [0.9, 1.0 color srgbt <0.88*r, 0.60*g, 0.40*b, 0.975>
>               color srgbt <0.55*r, 0.32*g, 0.20*b, 1.000>]
> #end
> 
> #declare Woodpig1 =
> pigment {
>   wood
>   turbulence 0.04
>   octaves 3
>   scale <0.05, .05, 1>*0.2
> }
> 
> #declare Woodnor1 =
> normal {
>   wood
>   turbulence 0.04
>   octaves 3
>   scale <0.05, .05, 1>*0.2
> }
> 
> #declare Woodpig2 =
> pigment {
>   wood
>   turbulence <0.1, 0.5, 1>
>   octaves 5
>   lambda 3.25
>   scale <0.15, .5, 1>*0.2
>   rotate <5, 10, 5>*0.05
>   translate -x*2
> }
> 
> #declare Woodnor2 =
> normal {
>   wood
>   turbulence <0.1, 0.5, 1>
>   octaves 5
>   lambda 3.25
>   scale <0.15, .5, 1>*0.2
>   rotate <5, 10, 5>*0.05
>   translate -x*2
> }
> 
> #declare floor_sd=seed(12);
> 
> //=======================
=========================
========================cha
nged by TdG
> #macro wood_floor_texture(r,g,b,Tscale)
> #if (simple_blocks)
>   pigment { color srgb <0.88*r, 0.60*g, 0.40*b> }
> #else
>   #local tex_scale = (0.8 + rand(floor_sd));
>   #local tex_rotate = RRand(-0.5, 0.5, floor_sd);
>   #local tex_translate = rand(floor_sd)*5;
>   #local WM1 = color_map {Woodmap1(r,g,b)};
>   #local WM2 = color_map {Woodmap2(r,g,b)};
>   
>   #local WoodLayer_dull =
>   texture {
>     pigment { Woodpig1  color_map { WM1 } }
>     normal {Woodnor1}
>     finish {
>       specular 0.05
>       roughness 0.003
>       ambient 0
>       diffuse 0.4
>     }
>     scale tex_scale
>     rotate tex_rotate
>     translate tex_translate
>   }
>   texture {
>     pigment { Woodpig2  color_map { WM2 } }
>     normal {Woodnor1}
>     finish {
>       specular 0.05
>       roughness 0.003
>       ambient 0
>       diffuse 0.4
>     }
>     scale tex_scale
>     rotate tex_rotate
>     translate tex_translate
>   }
>           
>   #local WoodLayer_shiny =
>   texture {
>     pigment { Woodpig1  color_map { WM1 } }
>     normal {Woodnor2}
>     finish {
>       specular 0.9
>       roughness 0.005
>       ambient 0
>       diffuse 0.6
>     }
>     scale tex_scale
>     rotate tex_rotate
>     translate tex_translate
>   }
>   texture {
>     pigment { Woodpig2  color_map { WM2 } }
>     normal {Woodnor2}
>     finish {
>       specular 0.9
>       roughness 0.005
>       ambient 0
>       diffuse 0.6
>     }
>     scale tex_scale
>     rotate tex_rotate
>     translate tex_translate
>   }
>           
>   #local Patterned_wood =
>   material {
>     texture {
>       pigment_pattern {
>         wood
>         turbulence 0.04
>         octaves 3
>         scale <0.05, .05, 1>*0.1
>         pigment_map {
>           [0.0   color rgb <0.0, 0.0, 0.0>]
>           [1.0   color rgb <1.0, 1.0, 1.0>]
>         }
>         scale  <0.2, 2.5, 0.2>*0.2
>       }
>       texture_map {
>         [0.0   WoodLayer_dull]
>         [1.0   WoodLayer_shiny]
>       }
>     }
>   }
> 
>   material {Patterned_wood scale Tscale}
> #end	//of if
> #end	//of macro
> 
> #macro wood_floor(board_spacing, board_width, board_length, nails, floor_
left, floor_right, floor_start, floor_end, Tscale)
>     union {
>         #local x_pos = floor_left;
>         #while (x_pos < floor_right)
>             #local rd = RRand(0, 99, floor_sd);
>             #local rd2 = 0;
>             
>             #while (rd2 <= rd)
>               #local rd = RRand(0, 99, floor_sd);
>               #local floor_rd = seed(rd);
>               #local rd2=rd2+1;
>             #end
>             
>             #local first_board = RRand(board_length*0.1, board_length*1
,floor_rd);
>             
>             #local z_pos = floor_start;
>             
>             #while (z_pos <= floor_end)
>                 #local board_lighten = rand(floor_sd)*0.3+0.85;
>                 
>                 #if (first_board | 0)
>                     box {
>                         <x_pos, -1, z_pos>
>                         <x_pos+board_width, 0, z_pos+first_board>
>                         wood_floor_texture(
>                             (rand(floor_sd)*0.1+0.95)*board_lighten,
>                             (rand(floor_sd)*0.1+0.95)*board_lighten,
>                             (rand(floor_sd)*0.1+0.95)*board_lighten,
>                             Tscale
>                         )
>                     }
>                     #local z_pos = z_pos + first_board + board_spacing;

>                     #local first_board = 0;
>                 #else
>                     #if (z_pos+board_length>floor_end)
>                         box {
>                             <x_pos, -1, z_pos>
>                             <x_pos+board_width, 0, floor_end>
>                             wood_floor_texture(
>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  Tscale
>                             )
>                         }
>                     #else
>                         box {
>                             <x_pos, -1, z_pos>
>                             <x_pos+board_width, 0, z_pos+board_length>
>                             wood_floor_texture(
>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  (rand(floor_sd)*0.1+0.95)*board_lighten,

>                                  Tscale
>                             )
>                         }
>                     #end //end of if z_pos+board_length
>                     
>                     #local z_pos = z_pos + board_length + board_spacing
;
>                     
>                 #end //end of if first_board
>                 
>            #end //end of while z_pos
>             
>              #local x_pos = x_pos + board_width + board_spacing;
>             
>         #end //end of while x_pos
>     }
> #end //end of macro
> 
> //=======================
=========================
=========================
================
> #if (Standalone)
> #include "rad_def.inc"
> 
> global_settings {
>   assumed_gamma 1.0
>   radiosity {
>     pretrace_start 0.08           // start pretrace at this size
>     pretrace_end   0.004           // end pretrace at this size
>     count 10, 1000                      // higher -> higher quality (1..1
600) [35] note: set to 10 with stochastic antialiasing
>     nearest_count 10, 5               // higher -> higher quality (1..10)
 [5]
>     error_bound 1               // higher -> smoother, less accurate [1.8
]
>     recursion_limit 3             // how much interreflections are calcul
ated (1..5+) [3]
>     low_error_factor .3           // reduce error_bound during last pretr
ace step
>     gray_threshold 0.0            // increase for weakening colors (0..1)
 [0]
>     minimum_reuse 0.015           // reuse of old radiosity samples [0.01
5]
>     maximum_reuse 0.1							// new parameter 3.7 [0.2]
>     brightness 1                  // brightness of radiosity effects (0..
1) [1]
> 
>     adc_bailout 0.01/2
>     normal on                   // take surface normals into account [off
]
>     media off                    // take media into account [off]
>     always_sample off           // turn sampling in final trace off [on]
>     //max_sample 1.0              // maximum brightness of samples
>   }
> }
> 
> plane { y, -0.5 
>   pigment {srgb 0.2}
> }
> 
> sphere {0, 1
>   pigment {srgb <0.733333, 0.733333, 1.00000>}
>   scale 1000
>   hollow
> }
> 
> light_source{<0,100,-100> color srgb 1}
> 
> camera{
>   location<0, 15, -30> 
>   look_at<0, 0, 0>
>   up y
>   right x*image_width/image_height
> }
> 
> #declare do_board_floor = true;
> #declare simple_blocks = false;
> #declare left_wall = -25;
> #declare right_wall = 25;
> #declare back_wall = -25;
> #declare front_wall = 25;
> #declare Tscale = 0.9;
> 
> #if (do_board_floor)
>   object {
>     wood_floor(
>               0.005, 			// board_spacing [0.005]
>               1.5, 				// board_width
>               8, 				// board_length
>               0, 					// nails (not implemented)
>               left_wall,  // floor_left
>               right_wall,	// floor_right
>               back_wall,	// floor_start
>               front_wall,	// floor_end
>               Tscale			// general scaling of final texture
>               )
>     rotate 30*y
>   }
> #else
>   box {
>     <left_wall, -1, back_wall>
>     <right_wall, 0, front_wall>
>     wood_floor_texture(1,1,1)
>   }
> #end
>  
> #end // end of Standalone
> //=======================
=========================
=========================
================

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

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