POV-Ray : Newsgroups : povray.advanced-users : uv mapping a mask Server Time
28 Jul 2024 16:27:59 EDT (-0400)
  uv mapping a mask (Message 1 to 1 of 1)  
From: Eric Medlin
Subject: uv mapping a mask
Date: 3 May 2004 17:19:42
Message: <eric.medlin-7C4467.17193903052004@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
   }
}

P.S. I posted this in general on April 14th, but I have not got any 
response so I figured I would give the advanced people a try at it.


Post a reply to this message

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