POV-Ray : Newsgroups : povray.general : Can I bake UV textures with Povray? : Re: Can I bake UV textures with Povray? Server Time
2 Aug 2024 18:09:40 EDT (-0400)
  Re: Can I bake UV textures with Povray?  
From: Tor Olav Kristensen
Date: 20 Aug 2004 10:42:15
Message: <41260dc7$1@news.povray.org>
ekolis wrote:
> I know there's a trick in Renderman to get the renderer to "bake" UV
> textures from procedural textures, but is there a way to do the same in
> Povray?

Is this what you are looking for:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

torus {
   4, 1
   texture {
     uv_mapping
     pigment {
       marble
//      gradient <1, 0, 0>
       turbulence 0.4
       color_map {
         [0.2 color rgb  <1, 0.8, 0>*1.2 ]
         [0.8 color rgb <0.1, 0.3, 0.4>*1.5 ]
       }
       scale <3, 1, 3>/4
     }
   }
}

camera {
   location <1, 1, -2>*4
   look_at <0, -1, 0>
}

light_source {
   100*<1, 1, -1>
   color rgb <1, 1, 1>
   shadowless
}

background { color rgb <1, 1, 1>/2 }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

This code takes the procedural texture "residing"
in the region from <0, 0, 0> to <1, 1, 0> and
maps it onto a torus. It can of course be mapped
onto any primitive that has support for UV-mapping
in POV-Ray.

By applying some more math you can remove the
visible seams in the texture.

In this thread you will find an image of a shape
with a texture that is UV-mapped that way:

http://news.povray.org/povray.binaries.images/thread/%3CXns934A8B380763Dtorolavkhotmailcom%40204.213.191.226%3E/?ttop=197385&toff=1650
http://tinyurl.com/6ovqy

-- 
Tor Olav
http://subcube.net
http://subcube.com


Post a reply to this message

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