POV-Ray : Newsgroups : povray.general : Layering detail textures : Re: Layering detail textures Server Time
29 Jul 2021 17:48:24 EDT (-0400)
  Re: Layering detail textures  
From: Tek
Date: 12 Oct 2012 12:25:01
Message: <web.5078441f207c714e4b0aa1fd0@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
>
> The reason the elements are individually textured is that, though they may use
> the same texture, the orientation of that texture is important w/r/t the
> individual object, and cannot be placed on the whole model.
>
> The problem is that I want to apply a series of overlays to the object as a
> whole, to simulate the effects of age, decals, spray-paint etc...  doing this to
> individual objects would make the csg ten times as complicated - making it
> impossible for me to construct the object procedurally, and use different
> overlays for different situations - and involve complex transformations of
> textures on the micro-level.
>

The texture transformations needn't be complex, internally POV represents them
as just a matrix. You just need to know the transformation for your object, then
you can do transform { ... inverse }.

For example if you're doing a recursive object, just keep track of the
transform:

#macro Object(ParentTransform)
   #local ObjectToParent = transform { rotate 20 scale .2 translate .1*y };
   #local ObjectToWorld = transform { ParentTransform ObjectToParent };
   object {
      TheObject

      texture { LocalTexture }
      texture { GlobalTexture transform { ObjectToWorld inverse } }

      transform { MyTransform }
   }
   // recurse
   Object(ObjectToWorld)
#end

But I agree it would be much nicer if POV could provide a more general solution
for handling layered textures (I'm always annoyed that it doesn't let you layer
over a texture_map).


Post a reply to this message

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