|
|
"Rune" <run### [at] inamecom> wrote...
> This works:
>
> #declare Tex = texture {pigment {color rgb 1} translate x}
> mesh {triangle {x, y, z texture {Tex}}}
>
> But this doesn't work:
>
> #declare Tex = texture {pigment {color rgb 1}}
> mesh {triangle {x, y, z texture {Tex translate x}}}
>
> My point is that if the whole texture is copied anyway, then why does it
> make a difference if the texture is transformed before or after it is
> applied to the triangle?
BUT - the texture is only copied ONCE for the WHOLE mesh. If you use that
same texture 100000000 times in the mesh, you will get only one single copy
with many pointers pointing to it. This is a HUGE memory saving
optimization. But as soon as you translate the texture, you can't re-use
it, because that basically creates a new texture because the translation
becomes an integral part of the texture definition.
This is also why you have to declare the textures before the mesh instead of
within the mesh. The issue is consolidating textures. Let's say you have a
mesh with 1000 triangles (a small mesh). 500 use texture{pigment{ color rgb
<1,0,0>}} and the other 500 use texture{pigment{color rgb <0,0,1>}}. Now,
you wouldn't want 500 copies of each of those textures, would you? Of
course not. But, how in the world is POV supposed to know that those
textures are identical and that it should merge them into one of each?
Instead, you declare two textures before starting the mesh, then you assign
those two textures to the 1000 triangles. This tells POV exactly what you
want: you want 2 textures assigned to 1000 triangles, not 1000 triangles
each with its own unique textures.
-Nathan
Post a reply to this message
|
|