|
|
Thinking a little bit more about it:
> #declare Tex = texture {pigment {color rgb 1}}
> mesh {triangle {x, y, z texture {Tex translate x}}}
> is not valid because the texture wants only the 'Tex' identifier when
> defined in meshes. POV docs say that only an identifier is allowed due
> to optimisation purposes (I didn't check the exact words).
Of course the "optimisation" mentionned would be exactly *not*
to copy the whole texture when it's exactly the same. This is what does
the Mesh_Hash_Texture() function... So what Nathan said previously is
quite logical, and I agree with that. I may have been confused by the
fact that the syntax I wrote actually give different textures while the
texture name is the same:
mesh{
#declare Tex = texture{ whatever translate x }
triangle{... texture{Tex}}
#declare Tex = texture{ whatever2 rotate z }
triangle{... texture{Tex}}
}
This is probably due to the fact that the Tex variable has a
different memory adress when it is reallocated; then the hashing code
consider that Tex and new Tex are really not the same. Then I wonder
what would happen if, when parsing a lot of triangles using this script,
exactly the same adress is given "by chance" to the Tex variable as for
a previous triangle... this would mess up the stuff.
Anyway POV really rocks... not like me :_(
Okay, now I stop my monologue, I promise.
*** Nicolas Calimet
*** http://pov4grasp.free.fr
Post a reply to this message
|
|