POV-Ray : Newsgroups : povray.unofficial.patches : (uni)MegaPOV 0.5a mesh2 textures : Re: (uni)MegaPOV 0.5a mesh2 textures Server Time
2 Sep 2024 02:18:18 EDT (-0400)
  Re: (uni)MegaPOV 0.5a mesh2 textures  
From: Nicolas Calimet
Date: 17 Jul 2000 12:23:05
Message: <39733374.1473D767@free.fr>
Nathan Kopp wrote:

> How many textures are you using?  Usually, a mesh will only have one or two
> textures.  Now that I think about it, if you are trying to use this the same
> way you would have used the color interpolation, you may be using a
> different texture for each vertex, which would definately drain memory.

	Yes precisely. I forgot to mention that I was talking only about mesh2
object which carries a different texture at each vertex. This obviously is quite
memory expensive. And in this case the exemple you give works well since again
the texture are interpolated within triangles only.

> For
> this, the transformations would not be important (solid red is red no matter
> where you look at it).  Currently, I don't have a good solution.  The only
> thing I can say is that it wouldn't be a good idea to have a specialized
> texturing system for meshes that differs drastically from the texturing
> system for the rest of POV.  The old texture vertex color interpolation
> texturing scheme, for example, contradicted the rest of POV's texturing
> system, which is why it was changed into the current form.

	I agree. More than two years ago when I started to do color-interpolation
within triangles, I chose a more general method than the one implemented later by
Ansgar Philippsen. I created a new pattern texture ("vertexcolor") which works for
any (smooth_)triangle, inside mesh or not. Of course it works differently than
other patterns. Also I suppose my code to be faster and without side-effect (like
the message in MegaPOV: "all determinants too small"). Still it was designed only
for colors, not full textures as you do.

	Well, after more trials in this particular situation of mesh2 object (with
as many textures as vertices for example), it seems possible to drastically reduce
the memory cost when copying the object. I was expecting to do better as I was
saying in my previous post, but it crashed in some common situations. At least the
following seems to work even with complex textures.

	Replace this line in Copy_Mesh:
New->Textures[i] = Copy_Textures(((MESH *)Object)->Textures[i]);
	by:
New->Textures[i] = Copy_Texture_Pointer(((MESH *)Object)->Textures[i]);

No need of another Textures->References since it's already handled this way. In my
test-case of 800,000 triangles it may save a few hundred megabytes ;-)

	Maybe not the end of this story ?

	- Nicolas


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


Post a reply to this message

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