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:12:28 EDT (-0400)
  Re: (uni)MegaPOV 0.5a mesh2 textures  
From: Nathan Kopp
Date: 16 Jul 2000 17:05:29
Message: <39722399@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote...
> I've noticed in the mesh.c code that all textures are
> copied when the initial mesh2 object is duplicated

Yes.  The original mesh implementation did not do this, but that caused a
BUG.

> This is IMHO a little bit in contradiction with the original
> mesh features. Needless to say that it requires much more
> memory when using big meshes with a lot of textures...
> I suppose it could be possible to use a Reference
> system as designed for the Data structure of the object. I did
> something like this for my patch (colors only, not full textures).
> Maybe I missed some critical thing concerning the mesh2 object,
> and I wanted to know it before changing the related code.

The problem is not just with mesh2, but with the way POV handles textures on
all objects.  The issue is that the textures are computed in texture space,
which is stored in a separate matrix from object space.  For texture space
and object space to be the same, the textures must be translate with the
object.  Object transformations are applied to textures prior to rendering
the scene, not on the fly.

All of this is done for a variety of speed opminization reasons.  It is a
matter of sacraficing memory for speed. And, because it is built into the
core of POV, it is NOT AT ALL EASY to change it.  It might be changed during
the complete rerwite that is planned for POV 4.0, though.

The bottom line is that if references are used for textures, the textures
will not move when the object is moved.  Or, if they are moved, moving one
object will affect the textures for all copies of that object (which would
be very bad).  Check out POV 3.1 for an example of this problem.  Note that
this affects the per-triangle textures, and not the per-object texture.

-Nathan


Post a reply to this message

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