POV-Ray : Newsgroups : povray.general : Duplicate ? : Duplicate ? Server Time
5 Aug 2024 04:20:42 EDT (-0400)
  Duplicate ?  
From: Rafal 'Raf256' Maj
Date: 24 Nov 2002 12:02:23
Message: <Xns92D0B6F081DF6raf256com@204.213.191.226>
I have following problem - I want to cover large area (about 1000x1000 
units) by grass, each grass "leaf" tooks about 1 unit space on ground, so I 
wolud need about 1 mln leafs. 
Each leaf is build from about 500 triangles, with gives 500,000,000 
triangles - way to much to hold in memory.

So I thinked of optimisation :
1. every grass leaf is a mesh
2. organise 10x10 leafs into an union like GrassBlock
3. cover area (flat land) with same GrassBlock object

problem is with step #3 - each :
  object { GrassBlock translate <X,0,Z> }
results in duplicating GrassBlock in memory - so no memroy is saved as I 
aspected.

AFAIK if GrassBlock would be a mesh (not union of 100 meshes) then it wolud 
not be duplicated right ?

So I suggest 2 future reguests to achive this :
1. allow syntax 
mesh {
  mesh { ... rotate ... translate ... } // leaf 1
  mesh { ... rotate ... translate ... } // leaf 2
  [...]
  rotate ... translate ...
} // grass block

2. add new syntax :
  duplicate { ... } 
that will work in same way as 
  object {... }
but will re-use memory


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

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