POV-Ray : Newsgroups : povray.general : question: need 2 curve memory req's for scene... Server Time
1 Nov 2024 00:24:40 EDT (-0400)
  question: need 2 curve memory req's for scene... (Message 1 to 8 of 8)  
From: Johnny Smith
Subject: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 01:10:08
Message: <39fbb130@news.povray.org>
I'm using an image AS a heightfield in several different places within a
scene.
Each time I use it..I must read it in...each time I do..it requires more and
more
memory...  Any way to read ONCE...and then assign something to it?
I guess the equivalent would be a pointer C/C++

This is used to create my RUG on the floor...

height_field { png "E:\Gizmo-sick\ceiling2.png" // smooth
                 scale <4, .19, 2>
                 texture { Carpet scale .7 finish { ambient .5 } }
                 rotate <180, 0, 0>
                 translate < -3.2, -0.809, 7.2> // Center around origin
               }

Now...to create my ceiling...I use the same image...

height_field
{
  png "ceiling2.png"  smooth
  rotate z*180 //flip it over so the points are facing the floor
  translate <0.5, 103, -0.5>
  scale <39.0, 0.06, 30.0>
   texture  { pigment { White } }
 }


    I would rather not have to duplicate this image map
in memory if I could avoid it...anybody have any ideas????


                        Thanks

                       Johnny


Post a reply to this message

From: Christoph Hormann
Subject: Re: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 01:48:34
Message: <39FBC845.A7362BB5@schunter.etc.tu-bs.de>
Johnny Smith wrote:
> 
>     I'm using an image AS a heightfield in several different places within a
> scene.
> Each time I use it..I must read it in...each time I do..it requires more and
> more
> memory...  Any way to read ONCE...and then assign something to it?
> I guess the equivalent would be a pointer C/C++
> 

Just declare it and use a reference each time:

#declare HF=height_field { png "E:\Gizmo-sick\ceiling2.png" }

object { 
    HF
    scale <4, .19, 2>
    texture { Carpet scale .7 finish { ambient .5 } }
    rotate <180, 0, 0>
    translate < -3.2, -0.809, 7.2> // Center around origin
}

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Johnny Smith
Subject: Re: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 02:11:28
Message: <39fbcda0@news.povray.org>
"Christoph Hormann" <Chr### [at] schunteretctu-bsde> wrote in
message news:39FBC845.A7362BB5@schunter.etc.tu-bs.de...

> Johnny Smith wrote:
> >
> >     I'm using an image AS a heightfield in several different places
within a
> > scene.
> > Each time I use it..I must read it in...each time I do..it requires more
and
> > more
> > memory...  Any way to read ONCE...and then assign something to it?
> > I guess the equivalent would be a pointer C/C++
> >
>
> Just declare it and use a reference each time:
>
> #declare HF=height_field { png "E:\Gizmo-sick\ceiling2.png" }
>
> object {
>     HF
>     scale <4, .19, 2>
>     texture { Carpet scale .7 finish { ambient .5 } }
>     rotate <180, 0, 0>
>     translate < -3.2, -0.809, 7.2> // Center around origin

        But every time I use it..in otherwords...I write  object { HF }
it will load ANOTHER copy right?  Meaning..for each oject...
the memory requirements will double...
I guess what I'm trying to say is there is no way to get/force povray
to only load ONCE the image  "E:\Gizmo-sick\ceiling2.png"
and then all subsequent uses refer to that ONE instance only?

                                        Johnny


Post a reply to this message

From: Christoph Hormann
Subject: Re: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 02:42:41
Message: <39FBD4F1.59642C40@schunter.etc.tu-bs.de>
Johnny Smith wrote:
> 
>         But every time I use it..in otherwords...I write  object { HF }
> it will load ANOTHER copy right?  Meaning..for each oject...
> the memory requirements will double...

No :-)

Just try it out and have a look at the memory stats

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Peter Popov
Subject: Re: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 08:15:53
Message: <ijhnvsg13q8iditfg11fnq31rk9omj4qfg@4ax.com>
On Sun, 29 Oct 2000 00:07:42 -0500, "Johnny Smith"
<joh### [at] homecom> wrote:

>
>    I'm using an image AS a heightfield in several different places within a
>scene.
>Each time I use it..I must read it in...each time I do..it requires more and
>more
>memory...  Any way to read ONCE...and then assign something to it?
>I guess the equivalent would be a pointer C/C++

Try declaring it and then reusing it. Meshes work this way but whether
this holds for HFs I can't say right now. Do a test and see.

As a side note, if using pre-declared HFs indeed makes copies of them,
would it be too hard to make POV do it the mesh way?


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Ken
Subject: Re: question: need 2 curve memory req's for scene...
Date: 29 Oct 2000 09:23:43
Message: <39FC3323.6804C47A@pacbell.net>
Peter Popov wrote:
> 
> On Sun, 29 Oct 2000 00:07:42 -0500, "Johnny Smith"
> <joh### [at] homecom> wrote:
> 
> >
> >    I'm using an image AS a heightfield in several different places within a
> >scene.
> >Each time I use it..I must read it in...each time I do..it requires more and
> >more
> >memory...  Any way to read ONCE...and then assign something to it?
> >I guess the equivalent would be a pointer C/C++
> 
> Try declaring it and then reusing it. Meshes work this way but whether
> this holds for HFs I can't say right now. Do a test and see.
> 
> As a side note, if using pre-declared HFs indeed makes copies of them,
> would it be too hard to make POV do it the mesh way?

It already does. I have used multiple (1000's) of HF's in a single scene
that used very little memory.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Peter Popov
Subject: Re: question: need 2 curve memory req's for scene...
Date: 30 Oct 2000 17:01:52
Message: <bs5qvsgn2nifhcmadmiet21bkdndcfsjuv@4ax.com>
On Sun, 29 Oct 2000 06:24:35 -0800, Ken <tyl### [at] pacbellnet> wrote:

>> As a side note, if using pre-declared HFs indeed makes copies of them,
>> would it be too hard to make POV do it the mesh way?
>
>It already does. I have used multiple (1000's) of HF's in a single scene
>that used very little memory.

I guessed that much but I really had no time to test it, thanks Ken.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Johnny Smith
Subject: Re: question: need 2 curve memory req's for scene...
Date: 30 Oct 2000 23:23:15
Message: <39fe4933$1@news.povray.org>
> >> As a side note, if using pre-declared HFs indeed makes copies of them,
> >> would it be too hard to make POV do it the mesh way?

#declare HF = height_field { .... }
    This worked by the way...
declared it ONE time...made all refernences to it as:



object { HF  translate<. . .>  rotate <. . .>  etc }

Memory requirements dropped by 1/2.

(50+meg to 25+ meg)


Post a reply to this message

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