POV-Ray : Newsgroups : povray.general : uv mapping a mask Server Time
6 Nov 2024 18:26:05 EST (-0500)
  uv mapping a mask (Message 1 to 1 of 1)  
From: Eric Medlin
Subject: uv mapping a mask
Date: 14 Apr 2004 14:03:36
Message: <eric.medlin-0B8ED1.14033414042004@news.povray.org>
I need a way to uv map a mask onto a mesh2 object.  Part of the mesh2 
object has uv coords. and the other parts don't.  I am currently uv 
mapping a image_map to get its color.  Now I want to apply a normal map 
to places that I don't mask out with a uv mapped masked.  Also the same 
normal map will be applied to places that don't have uv mapping coords.  
Here is some sample code that I have.

mesh2{
   vertex_vectors{...}
   normal_vectors{...}
   uv_vectors{...}
   texture_list{
      2,
      texture{ // part that has uv coords.
         normal{
            // This needs to only appear where a mask tells it to.
            // It must also appear the same size as the normal
            // below in the other texture node and use the same
            // scale value
            boze scale 0.02
         }
         pigment{uv_mapping image_map{jpeg "image.jpg"}
      }
      texture{ // all parts without uv coords.
         normal{bozo scale 0.02}
         pigment{color rgb <1,1,1>}
      }
   }
   face_indices{...}
   normal_indices{...}
   uv_indices{...}
}

I have tried doing this, but this of course changes the scaling of the 
normal boze.  I just recently learned this thanks to Thorsten Froehlich.
normal{uv_mapping image_pattern{tga "mask.tga"}
   normal_map{
      [0.5 bozo scale 0.02]
      [0.5 quilted] // just to see if the mask works, it does
   }
}


Post a reply to this message

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