POV-Ray : Newsgroups : povray.unofficial.patches : Mesh2 uv_vectors problem : Re: Mesh2 uv_vectors problem Server Time
2 Sep 2024 00:18:11 EDT (-0400)
  Re: Mesh2 uv_vectors problem  
From: Nicolas Calimet
Date: 14 Jan 2001 18:41:00
Message: <3A624A94.5CF4A3B@free.fr>
> > which of course requires a lot of memory to declare both
> > texture variables and textures in the mesh.
> 
> Well, not texture variables, just the textures.

	What do you mean ?

	When you #declare/#local a variable e.g. as a texture, the
memory allocated for this variable is the size of the texture. And
when you create a texture calling that variable, like 'texture{t1}',
it copies the data contained in the variable. So in this case you
need twice as much as memory:

#declare t=texture{ ... }    // requires the size of the texture
                             // t is not a pointer, but a texture
triangle{ ... texture{t} }   // makes a copy of the texture t

	Now, with the second syntax I mentionned in my previous post:
you will re-declare the same variable 't', so it requires the memory
for only one texture variable ('t') plus for textures of every triangle.
With an array of textures, you would need twice the memory required for
the textures of your triangles: variables + copies.
	That's why re-declaring the same variable for the next textures
of your mesh will work. If POV was not working this way, only the last
triangle of your mesh would have the correct texture, and all the previous
triangles would refer to this last. Not the expected result ;-)


> > which might be only a little longer to parse... maybe not.

	Finally this syntax (declare the texture before each triangle
with the same variable) *might be* a little bit longer to parse since
you have to allocate/desallocate memory each time you declare the
texture when parsing the mesh. But memory requirements should be
definitely less for numerous triangles than using a texture array !


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

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