POV-Ray : Newsgroups : povray.binaries.scene-files : How to synchronize texture heightfield with texture colors : How to synchronize texture heightfield with texture colors Server Time
27 Apr 2024 18:32:15 EDT (-0400)
  How to synchronize texture heightfield with texture colors  
From: m steiger
Date: 8 Jan 2011 05:46:53
Message: <4d28409d@news.povray.org>
I was trying to synchronize a heightfield defined by a crackle texture
with a color texture that also uses a crackle pattern.

Because of using a color texture with normal shading this should give a 
great 3d impression.

But the scaling seems to be wrong.
Picture 1 shows the naked heightfield.
Picture 2 a colored heightfield example.
But as you can see the heights are colored wrong.

Any idea how to syncronize this 2 textures ?



//*********************************************************
// Persistence of Vision Ray Tracer Scene Description File
// File:  Heightfield_sync_1.pov
// Desc:  Basic heightfield synronize example
// Date:  2010-01-08
// Auth:  Martin Steiger
// Time:  00:00:17   1680*1050
//*********************************************************

#version 3.6;

#include "colors.inc"

//--- camera ---
camera { location <5, 2.8, -2>
          look_at  <5, 1.5, 0> }

//--- lights ---
light_source {<-140,200,300> rgb 1.5}
light_source {<140,200,-300> rgb 0.5}

//---  color texture ---
#declare texture1 =
   texture {
     normal  {crackle 16}
     pigment {crackle
              color_map { [ 0 color Gray*0.8]
                          [ 1 color Red*0.8] }
              //scale 0.1
             }
     finish {ambient 0.4 diffuse 0.6 phong 1}
   }

//--- heightfield ---
height_field            // bitmap <0,0,0> .. <1,1,0>
{ function 1024,1024    // resolution
   {
     pigment             // heightfield texture
     { crackle
         color_map { [ 0 color 0]
                     [ 1 color 1] }
         scale 0.1       // pattern scale
     }
   }
   scale <10, 0.3, 10>   // size x*h*y
   pigment { rgb <222/255, 180/255, 100/255> }  // default hf color
   texture { texture1 scale 1 translate 0}      // colorize texture
}


Post a reply to this message


Attachments:
Download 'heightfield_sync_1.png' (216 KB) Download 'heightfield_sync_2.png' (347 KB)

Preview of image 'heightfield_sync_1.png'
heightfield_sync_1.png

Preview of image 'heightfield_sync_2.png'
heightfield_sync_2.png


 

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