POV-Ray : Newsgroups : povray.binaries.programming : POV Memory Server Time
18 Apr 2024 22:14:46 EDT (-0400)
  POV Memory (Message 1 to 10 of 21)  
Goto Latest 10 Messages Next 10 Messages >>>
From: majucatur
Subject: POV Memory
Date: 21 Feb 2002 16:51:22
Message: <3c756bda@news.povray.org>
Hi.

   I have a question for you, well, I'm developing a ray-tracing program and
I need help with the aspect of the memory allocation. I define my objects in
special structures, each object is allocated in memory dynamically, you
know, with memalloc and free, but the question is: How can I optimize this?,
I want to use the less memory possible, because with objects like mesh or
series of thousand objects consumes a lot of RAM memory, I don't know how
POV-Ray uses the memory to its objects, but certainly it can trace scenes
with a lot of complex objects without problem...

   Should I put everything in memory?, primitives, mesh, textures, etc. or
exist a technique to use more efficiently my resources.

Thanks for your time and patience.


Post a reply to this message

From: Warp
Subject: Re: POV Memory
Date: 22 Feb 2002 03:04:40
Message: <3c75fb98@news.povray.org>
You didn't mention the programming language you are using ('memalloc' is
not a C nor C++ function; at least not a standard one).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: majucatur
Subject: RE: POV Memory
Date: 22 Feb 2002 13:09:57
Message: <3c768975@news.povray.org>
Sorry, malloc is the function, I'm writting my program in C, but what I want
to know is the Algorithm or procedure to distribute the memory, for example:

sphere needs 3 coordinates for the center and a radius, each variable takes
4 bytes of memory, well, I need 16 bytes for a sphere, but for a box I need
24 bytes...

sphere    16 bytes
box          24 bytes
cone        28 bytes
cylinder   28 bytes
plane       16 bytes
torus          8 bytes

this are without transformations, they need more memory, that's the problem,
my memori not is infinite


Post a reply to this message

From: Vahur Krouverk
Subject: Re: POV Memory
Date: 22 Feb 2002 19:58:55
Message: <3C76EA1E.2060303@comtrade.ee>
majucatur wrote:
> Hi.
> 
>    I have a question for you, well, I'm developing a ray-tracing program and
> I need help with the aspect of the memory allocation. I define my objects in
> special structures, each object is allocated in memory dynamically, you
> know, with memalloc and free, but the question is: How can I optimize this?,
> I want to use the less memory possible, because with objects like mesh or
> series of thousand objects consumes a lot of RAM memory, I don't know how
> POV-Ray uses the memory to its objects, but certainly it can trace scenes
> with a lot of complex objects without problem...
> 
>    Should I put everything in memory?, primitives, mesh, textures, etc. or
> exist a technique to use more efficiently my resources.
If you want to render more geometry than fits into memory, then only
option is to cache it (if you don't want to leave it to op. sys. swapping).
One paper I know about it could be found:
http://graphics.stanford.edu/papers/displace/
Google should help in finding similar papers.
Other option is to optimize geometry. Latest Siggraph papers ('00 IIRC) 
have number of various optimizations described.


Post a reply to this message

From: Warp
Subject: Re: POV Memory
Date: 23 Feb 2002 13:25:19
Message: <3c77de8f@news.povray.org>
majucatur <maj### [at] yahoocom> wrote:
> sphere needs 3 coordinates for the center and a radius, each variable takes
> 4 bytes of memory, well, I need 16 bytes for a sphere, but for a box I need
> 24 bytes...

  So in 10 Megs of memory you can store almost 437000 boxes. I don't see
the problem.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From:
Subject: Re: POV Memory
Date: 4 Mar 2002 10:57:54
Message: <3c839982$1@news.povray.org>
> box          24 bytes

so you use only 4 bytes for the float number storage?
IMHO a box needs 6 float parameters to be defined...
regards
SY


Post a reply to this message

From: Warp
Subject: Re: POV Memory
Date: 4 Mar 2002 11:52:27
Message: <3c83a64b@news.povray.org>

> IMHO a box needs 6 float parameters to be defined...

  In fact, 2 is enough. See the box syntax for an example. (Of course with
2 floats it's axis-aligned, but that doesn't matter; the transformations of
a box are not made by moving its vertices anyways.)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Ron Parker
Subject: Re: POV Memory
Date: 4 Mar 2002 21:10:54
Message: <slrna88a9i.la6.ron.parker@fwi.com>
On 4 Mar 2002 11:52:27 -0500, Warp wrote:

>> IMHO a box needs 6 float parameters to be defined...
> 
>   In fact, 2 is enough. See the box syntax for an example. (Of course with
> 2 floats it's axis-aligned, but that doesn't matter; the transformations of
> a box are not made by moving its vertices anyways.)

floats or vectors?

-- 
#macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron### [at] povrayorg


Post a reply to this message

From:
Subject: Re: POV Memory
Date: 5 Mar 2002 03:29:31
Message: <3c8481eb@news.povray.org>
>   In fact, 2 is enough. See the box syntax for an example. (Of course with
> 2 floats it's axis-aligned, but that doesn't matter; the transformations
of
> a box are not made by moving its vertices anyways.)


how do you define a box with 2 floats? even length, height and depth would
already need 3!
regards
SY


Post a reply to this message

From: Warp
Subject: Re: POV Memory
Date: 5 Mar 2002 06:53:17
Message: <3c84b1ad@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
> floats or vectors?

  Floats. (Of course that will create a cube, but as I said, transformations
can make it a box of any shape, and place and orient it in any way.)

  Thinking about it, it actually doesn't need any floats at all. Just
create a unit-cube by default and let the transformations do the rest.
  So in fact it requires 0 floats.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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