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:16:23 EDT (-0400)
  Re: (uni)MegaPOV 0.5a mesh2 textures  
From: Nathan Kopp
Date: 17 Jul 2000 15:31:07
Message: <39735efb$1@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote...
> 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 ?

Unfortunately, no.  While this does work for solid colors, it will not work
for any other kinds of textures, because of transformation problems.
(  More extensive changes would be necessary to make it work.  I had been
working on that (in a more general sense for all objects, not just meshes),
but it was taking too much effort so I moved on to "more important" things.
Feel free to keep working on it, though  :-)  One quick-hack solution would
be to check and see if the texture is a solid color with no normal, and if
so, just copy the texture pointer.  That should work correctly in all
situations and will save you much memory for your particular use.

-Nathan


Post a reply to this message

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