POV-Ray : Newsgroups : povray.general : large city models in povray Server Time
31 Oct 2024 19:31:01 EDT (-0400)
  large city models in povray (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: christian
Subject: large city models in povray
Date: 18 Nov 2015 17:45:01
Message: <web.564c88fa77681a2fc45346000@news.povray.org>
Hello

I'm new here and in using povray.

I will use povray to render scenes from a large city model. Each object of the
city model is a single wavefront obj-file. There are about 4'500 objects. The
objects are mapped with an image.
I wrote a python-script to convert the files into pov-scenes. Each object in a
single include-file. In the scene-file i include all of this files. When i will
render the scene (just a small section in the camera definition) i have a
problem with the memory, while povray is parsing the scene. It works when i
leave out the image mapping. The Objects are then the just "grey".

Can anybody give me a tip, how i can solve this problem? Is it possible to say
povray, that it should just parse the section in the cameraview?

Thanky you for your help.

Best regards, christian


Post a reply to this message

From: Stephen
Subject: Re: large city models in povray
Date: 19 Nov 2015 01:53:34
Message: <564d71ee$1@news.povray.org>
On 11/18/2015 2:19 PM, christian wrote:
> Can anybody give me a tip, how i can solve this problem? Is it possible to say
> povray, that it should just parse the section in the cameraview?

I think that the quick answer is no.
The long answer is it is possible to do it yourself.
A few years ago there was a post of a fly through over a forest. The 
trees were billboards (Image map on a box, with transparency) and they 
were pre-computed to load when they were in view.
It can be done but it involves more work. :-)

-- 

Regards
     Stephen


Post a reply to this message

From: clipka
Subject: Re: large city models in povray
Date: 19 Nov 2015 03:46:47
Message: <564d8c77$1@news.povray.org>
Am 18.11.2015 um 15:19 schrieb christian:

> I will use povray to render scenes from a large city model. Each object of the
> city model is a single wavefront obj-file. There are about 4'500 objects. The
> objects are mapped with an image.
> I wrote a python-script to convert the files into pov-scenes. Each object in a
> single include-file. In the scene-file i include all of this files. When i will
> render the scene (just a small section in the camera definition) i have a
> problem with the memory, while povray is parsing the scene. It works when i
> leave out the image mapping. The Objects are then the just "grey".
> 
> Can anybody give me a tip, how i can solve this problem? Is it possible to say
> povray, that it should just parse the section in the cameraview?

There are several approaches you could try:

(1) Re-use some objects in multiple places to reduce the number of
objects (and textures) to load. Make sure to load each such object into
POV-Ray only once, using "#declare Foo = mesh2 { ... }", and then
instantiate it multiple times using "object { Foo }".

(2) Re-use the same image maps on multiple objects to only reduce the
number of textures to load. Again, make sure to load each image map only
once, using "#declare Foo = image_map { ... }", and then instantiate it
multiple times using "image_map { Foo }".

(3) Make use of "#if(...) #include "Foo_HighDetail.inc" #else #include
"Foo_LowDetail.inc" #end" to load low-detail versions of your objects
and/or textures if they're far from the camera position (note that
you'll need to provide the low-detail versions yourself), or even
exclude them objects entirely.


Post a reply to this message

From: Thomas de Groot
Subject: Re: large city models in povray
Date: 19 Nov 2015 03:47:28
Message: <564d8ca0@news.povray.org>
On 18-11-2015 15:19, christian wrote:
> Can anybody give me a tip, how i can solve this problem? Is it possible to say
> povray, that it should just parse the section in the cameraview?
>

The quick answer is yes. ;-)

There is indeed a possibility to only render what is shown by the 
camera. For this you need to test if a given object is visible within 
the camera view field. Gilles Tran developed a macro which allows you to 
do this.

Play with the attached scene file. The objects are tested against a 
'screen'. I purposefully left this screen smaller than the camera view 
so that you can play and learn to use it.

-- 
Thomas


Post a reply to this message


Attachments:
Download 'utf-8' (5 KB)

From: Stephen
Subject: Re: large city models in povray
Date: 19 Nov 2015 04:26:35
Message: <564d95cb$1@news.povray.org>
On 11/19/2015 8:47 AM, Thomas de Groot wrote:
>
> The quick answer is yes. ;-)
>

:-)

> There is indeed a possibility to only render what is shown by the
> camera. For this you need to test if a given object is visible within
> the camera view field. Gilles Tran developed a macro which allows you to
> do this.

I did not know that. Thanks Thomas.

-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: large city models in povray
Date: 19 Nov 2015 07:16:14
Message: <564dbd8e$1@news.povray.org>
On 19-11-2015 10:26, Stephen wrote:
> On 11/19/2015 8:47 AM, Thomas de Groot wrote:
>>
>> The quick answer is yes. ;-)
>>
>
> :-)
>
>> There is indeed a possibility to only render what is shown by the
>> camera. For this you need to test if a given object is visible within
>> the camera view field. Gilles Tran developed a macro which allows you to
>> do this.
>
> I did not know that. Thanks Thomas.
>
A smart little trick, isn't it?

It is difficult to keep track of all the little utilities developed here 
over the years. I am afraid many and more are lost after their initial 
release :-(

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: large city models in povray
Date: 19 Nov 2015 09:44:33
Message: <564de051$1@news.povray.org>
On 11/19/2015 12:16 PM, Thomas de Groot wrote:
> On 19-11-2015 10:26, Stephen wrote:
>> On 11/19/2015 8:47 AM, Thomas de Groot wrote:
>>>
>>> The quick answer is yes. ;-)
>>>
>>
>> :-)
>>
>>> There is indeed a possibility to only render what is shown by the
>>> camera. For this you need to test if a given object is visible within
>>> the camera view field. Gilles Tran developed a macro which allows you to
>>> do this.
>>
>> I did not know that. Thanks Thomas.
>>
> A smart little trick, isn't it?
>

Very. :-)

> It is difficult to keep track of all the little utilities developed here
> over the years. I am afraid many and more are lost after their initial
> release :-(
>

It is, it is.

-- 

Regards
     Stephen


Post a reply to this message

From: Nekar Xenos
Subject: Re: large city models in povray
Date: 19 Nov 2015 12:39:46
Message: <op.x8czcbwfufxv4h@xena>
On Thu, 19 Nov 2015 16:44:27 +0200, Stephen <mca### [at] aolcom> wrote:

> On 11/19/2015 12:16 PM, Thomas de Groot wrote:
>> On 19-11-2015 10:26, Stephen wrote:
>>> On 11/19/2015 8:47 AM, Thomas de Groot wrote:
>>>>
>>>> The quick answer is yes. ;-)
>>>>
>>>
>>> :-)
>>>
>>>> There is indeed a possibility to only render what is shown by the
>>>> camera. For this you need to test if a given object is visible within
>>>> the camera view field. Gilles Tran developed a macro which allows you  
>>>> to
>>>> do this.
>>>
>>> I did not know that. Thanks Thomas.
>>>
>> A smart little trick, isn't it?
>>
>
> Very. :-)
>
>> It is difficult to keep track of all the little utilities developed here
>> over the years. I am afraid many and more are lost after their initial
>> release :-(
>>
>
> It is, it is.
>

IIRC  scenes\advanced\blocks also does something similar.

-- 
-Nekar Xenos-


Post a reply to this message

From: Thomas de Groot
Subject: Re: large city models in povray
Date: 20 Nov 2015 02:53:14
Message: <564ed16a$1@news.povray.org>
On 19-11-2015 18:39, Nekar Xenos wrote:
> On Thu, 19 Nov 2015 16:44:27 +0200, Stephen <mca### [at] aolcom> wrote:
>
>> On 11/19/2015 12:16 PM, Thomas de Groot wrote:
>>> On 19-11-2015 10:26, Stephen wrote:
>>>> On 11/19/2015 8:47 AM, Thomas de Groot wrote:
>>>>>
>>>>> The quick answer is yes. ;-)
>>>>>
>>>>
>>>> :-)
>>>>
>>>>> There is indeed a possibility to only render what is shown by the
>>>>> camera. For this you need to test if a given object is visible within
>>>>> the camera view field. Gilles Tran developed a macro which allows
>>>>> you to
>>>>> do this.
>>>>
>>>> I did not know that. Thanks Thomas.
>>>>
>>> A smart little trick, isn't it?
>>>
>>
>> Very. :-)
>>
>>> It is difficult to keep track of all the little utilities developed here
>>> over the years. I am afraid many and more are lost after their initial
>>> release :-(
>>>
>>
>> It is, it is.
>>
>
> IIRC  scenes\advanced\blocks also does something similar.
>

I think you are right.

-- 
Thomas


Post a reply to this message

From: christian
Subject: Re: large city models in povray
Date: 24 Nov 2015 05:35:01
Message: <web.56543c12c20c243dc45346000@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 18-11-2015 15:19, christian wrote:
> > Can anybody give me a tip, how i can solve this problem? Is it possible to say
> > povray, that it should just parse the section in the cameraview?
> >
>
> The quick answer is yes. ;-)
>
> There is indeed a possibility to only render what is shown by the
> camera. For this you need to test if a given object is visible within
> the camera view field. Gilles Tran developed a macro which allows you to
> do this.
>
> Play with the attached scene file. The objects are tested against a
> 'screen'. I purposefully left this screen smaller than the camera view
> so that you can play and learn to use it.
>
> --
> Thomas


Thank you for all your answers. I have now used this macro. I needed some time,
but now it works very well and fast. :-)

I have another question in this context. Is there a smart way to generate normal
maps and depth maps in POV-Ray. Maybe I can use fog for the depth map?

I'm sure you can help me also in this point. Thank you. :-)

Regards Christian


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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