POV-Ray : Newsgroups : povray.general : Mesh2 & textures memory problem Server Time
2 Aug 2024 14:16:44 EDT (-0400)
  Mesh2 & textures memory problem (Message 1 to 4 of 4)  
From: Vaclav Cermak
Subject: Mesh2 & textures memory problem
Date: 24 Oct 2004 10:02:05
Message: <417bb5dd@news.povray.org>
Hello,

   I'am using mesh2 for creating bush into terrain visualisation. I have 
one mesh2 bush object and I need to place several tens of thousands of 
instances into the scene. When I use mesh2 without textures, I have no 
problem with memory. But when I try to assign some textures to mesh2 
object, memory requirements are very high (several hundreds of MB). I 
have nine textures predefined before and they are randomly assigned to 
leaves in the bush.

   When I'am thinking about it, it looks like all nine textures are 
copied for each instance of my mesh2, but I'am unable to see any reason 
for it.

   Is anowhere some way how to solve this?

Thanks for any advices :)

Vaclav


Post a reply to this message

From: FlyerX
Subject: Re: Mesh2 & textures memory problem
Date: 24 Oct 2004 14:11:06
Message: <417bf03a@news.povray.org>
Vaclav Cermak wrote:
> 
> Hello,
> 
>   I'am using mesh2 for creating bush into terrain visualisation. I have 
> one mesh2 bush object and I need to place several tens of thousands of 
> instances into the scene. When I use mesh2 without textures, I have no 
> problem with memory. But when I try to assign some textures to mesh2 
> object, memory requirements are very high (several hundreds of MB). I 
> have nine textures predefined before and they are randomly assigned to 
> leaves in the bush.
> 
>   When I'am thinking about it, it looks like all nine textures are 
> copied for each instance of my mesh2, but I'am unable to see any reason 
> for it.
> 
>   Is anowhere some way how to solve this?
> 
> Thanks for any advices :)
> 
> Vaclav

This is what I use in PoseRay (http://user.txcyber.com/~sgalls/) to 
decrease the amount of memory required if several materials use the same 
map.

Declare the map once like this:

#declare map1=pigment{image_map{jpeg "your image.jpg" interpolate 2}}

then declare the material:

#declare mat1=texture{pigment{map1}}//add a finish if you want

then use the material in mesh2{}:

texture_list{
1,
texture{mat1}} //add more if you use more materials

This should allocate room for the map once.

good luck,

FlyerX


Post a reply to this message

From: Warp
Subject: Re: Mesh2 & textures memory problem
Date: 24 Oct 2004 17:15:30
Message: <417c1b72@news.povray.org>
Are you using a texture_list or are you defining a texture global to
the entire mesh?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Vaclav Cermak
Subject: Re: Mesh2 & textures memory problem
Date: 25 Oct 2004 04:11:59
Message: <417cb54f@news.povray.org>
I'am using texture_list.

Warp wrote:
>   Are you using a texture_list or are you defining a texture global to
> the entire mesh?
>


Post a reply to this message

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