POV-Ray : Newsgroups : povray.general : Is it possible to render only a sub-set of a scene? Server Time
26 Nov 2024 05:21:41 EST (-0500)
  Is it possible to render only a sub-set of a scene? (Message 1 to 9 of 9)  
From: John Ratcliff
Subject: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 12:25:01
Message: <web.4dde7de7d2743ccb90ae49fd0@news.povray.org>
I want to use POVRay to do some pre-computed baked in radiosity solutions.

What I need to be able to do is upload my entire 'game level' into POV Ray but,
when I render, render only a sub-section of that game world.

Since the 'scene' seems to be a global concept; I'm not quite sure how to have
it render only a sub-section of the scene.

Could this be done by setting a no-draw material property on the portion of the
level I want ignored while still having the raytracer take the entire world into
consideration for shadows, etc.?

I'm brand new to POVRay so forgive the naivete.

Thanks,

John


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 12:55:00
Message: <web.4dde84f3e70c3bc79c4fb0ad0@news.povray.org>
"John Ratcliff" <jra### [at] gmailcom> wrote:
> I want to use POVRay to do some pre-computed baked in radiosity solutions.
>
> What I need to be able to do is upload my entire 'game level' into POV Ray but,
> when I render, render only a sub-section of that game world.
>
> Since the 'scene' seems to be a global concept; I'm not quite sure how to have
> it render only a sub-section of the scene.
>
> Could this be done by setting a no-draw material property on the portion of the
> level I want ignored while still having the raytracer take the entire world into
> consideration for shadows, etc.?
>
> I'm brand new to POVRay so forgive the naivete.
>
> Thanks,
>
> John

What you're asking for is very complex.  There is a concrete limit on the size
of a given scene which makes scaling necessary for large scenes, so there's a
trade-off between scope and detail.  I'm not entirely sure what the limit is,
but I know it's there.

As for only rendering part of a scene, you might try combining no_image,
no_reflection and no_shadow which, if I understand correctly, might give you the
effect you're looking for but you have to decide whether or not the effects
you're cutting out are significant enough to consider.

You could try dividing your world into sectors with #if statements:

#if(SECTOR1)

// sector one definitions

#end

and have a global switch block like this:

#declare SECTOR1 = on;

....

you could even separate each sector into its own include file for modularity.

This would certainly limit which sectors are rendered, but I don't know how it
will effect radiosity.

I hope this helps.

A.D.B.


Post a reply to this message

From: Alain
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 12:56:38
Message: <4dde8646$1@news.povray.org>

> I want to use POVRay to do some pre-computed baked in radiosity solutions.
>
> What I need to be able to do is upload my entire 'game level' into POV Ray but,
> when I render, render only a sub-section of that game world.
>
> Since the 'scene' seems to be a global concept; I'm not quite sure how to have
> it render only a sub-section of the scene.
>
> Could this be done by setting a no-draw material property on the portion of the
> level I want ignored while still having the raytracer take the entire world into
> consideration for shadows, etc.?
>
> I'm brand new to POVRay so forgive the naivete.
>
> Thanks,
>
> John
>
>


Obviously, any object will mask whatever is behind it.
An object with the no_shadow attribute will not cast any shadow, it will 
not interfere with shadows cast by other objects.
One such object can be used to mask parts of the scene while leaving 
shadows cast still visible.

Something similar can be acheived with the no_reflection attribute 
relative to reflections. That object becomes invisible in reflective 
surfaces.

Then, there is the no_image that makes the affected object only visible 
through reflections and cast shadows. To use this in your case require 
to compute the distance from the camera for every object and 
conditionaly apply the attribute. Doable but tedious, especialy for an 
existing scene.

For what you want, the first two should be the "ticket" in allowing you 
to create masking screen(s) that still allow shadows and reflections.
Have those "screens" location be relative to the camera's location this way:
Early in the scene.
#declare Camera_location = Some_Place;
#declare View_distance = 1000;

Then, anywhere convenient:
#declare World_mask = sphere{0, View_distance pigment{Sky_Texture} 
hollow no_shadow no_reflection no_radiosity translate Camera_location}

"hollow" allow media to exist within. Mandatory if your scene have ANY 
media or use fog.
"no_radiosity" make the object invisible to radiosity computations. ONLY 
available with version 3.7.

camera{location 0 look_at Look_Point translate Camera_location}



Alain


Post a reply to this message

From: John Ratcliff
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 13:45:01
Message: <web.4dde9173e70c3bc790ae49fd0@news.povray.org>
Thanks for the feedback.  The thing is, what I want do do is actually super
trivial from the standpoint of C++.  That may be the best way to approach the
problem.

What I'm trying to do is compute a lightmap projection for certain triangles in
the scene.  The raytracer needs to consider the entire scene but not *render*
the entire scene; just the sub-section.

I'll take a crack at doing this at the C++ level.  Maybe I'll even add a script
binding so other people can easily do the same kind of culling.

Thanks,

John


Alain <aze### [at] qwertyorg> wrote:

> > I want to use POVRay to do some pre-computed baked in radiosity solutions.
> >
> > What I need to be able to do is upload my entire 'game level' into POV Ray but,
> > when I render, render only a sub-section of that game world.
> >
> > Since the 'scene' seems to be a global concept; I'm not quite sure how to have
> > it render only a sub-section of the scene.
> >
> > Could this be done by setting a no-draw material property on the portion of the
> > level I want ignored while still having the raytracer take the entire world into
> > consideration for shadows, etc.?
> >
> > I'm brand new to POVRay so forgive the naivete.
> >
> > Thanks,
> >
> > John
> >
> >
>
>
> Obviously, any object will mask whatever is behind it.
> An object with the no_shadow attribute will not cast any shadow, it will
> not interfere with shadows cast by other objects.
> One such object can be used to mask parts of the scene while leaving
> shadows cast still visible.
>
> Something similar can be acheived with the no_reflection attribute
> relative to reflections. That object becomes invisible in reflective
> surfaces.
>
> Then, there is the no_image that makes the affected object only visible
> through reflections and cast shadows. To use this in your case require
> to compute the distance from the camera for every object and
> conditionaly apply the attribute. Doable but tedious, especialy for an
> existing scene.
>
> For what you want, the first two should be the "ticket" in allowing you
> to create masking screen(s) that still allow shadows and reflections.
> Have those "screens" location be relative to the camera's location this way:
> Early in the scene.
> #declare Camera_location = Some_Place;
> #declare View_distance = 1000;
>
> Then, anywhere convenient:
> #declare World_mask = sphere{0, View_distance pigment{Sky_Texture}
> hollow no_shadow no_reflection no_radiosity translate Camera_location}
>
> "hollow" allow media to exist within. Mandatory if your scene have ANY
> media or use fog.
> "no_radiosity" make the object invisible to radiosity computations. ONLY
> available with version 3.7.
>
> camera{location 0 look_at Look_Point translate Camera_location}
>
>
>
> Alain


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 14:00:55
Message: <4dde9557$1@news.povray.org>

> What I'm trying to do is compute a lightmap projection for certain
> triangles in the scene.  The raytracer needs to consider the entire
> scene but not *render* the entire scene; just the sub-section.

   Do you know you can bake textures/lightmaps with the new mesh_camera?
As long as your subsection is a separate mesh, you can render only the
lightmap for that mesh, while taking into account the rest of the scene
(i.e. the scene will cast shadows/radiosity on your lightmap). Look up
the basic example on scenes/camera/mesh_camera/baking_demo.pov, it
should get you started...

   Regards,

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From: John Ratcliff
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 14:45:01
Message: <web.4dde9eeae70c3bc790ae49fd0@news.povray.org>
Thanks Jaime,

This describes pretty much exactly what I want to do.  Could you send me a small
sample script that shows the semantic for doing this?

Thanks,

John

Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:

> > What I'm trying to do is compute a lightmap projection for certain
> > triangles in the scene.  The raytracer needs to consider the entire
> > scene but not *render* the entire scene; just the sub-section.
>
>    Do you know you can bake textures/lightmaps with the new mesh_camera?
> As long as your subsection is a separate mesh, you can render only the
> lightmap for that mesh, while taking into account the rest of the scene
> (i.e. the scene will cast shadows/radiosity on your lightmap). Look up
> the basic example on scenes/camera/mesh_camera/baking_demo.pov, it
> should get you started...
>
>    Regards,
>
> --
> Jaime Vives Piqueres
>
> La Persistencia de la Ignorancia
> http://www.ignorancia.org


Post a reply to this message

From: Le Forgeron
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 17:01:42
Message: <4ddebfb6$1@news.povray.org>
Le 26/05/2011 18:20, John Ratcliff nous fit lire :
> I want to use POVRay to do some pre-computed baked in radiosity solutions.
> 
> What I need to be able to do is upload my entire 'game level' into POV Ray but,
> when I render, render only a sub-section of that game world.
> 
> Since the 'scene' seems to be a global concept; I'm not quite sure how to have
> it render only a sub-section of the scene.
> 
> Could this be done by setting a no-draw material property on the portion of the
> level I want ignored while still having the raytracer take the entire world into
> consideration for shadows, etc.?

no_image option on any object will remove it from direct view, but
unless you also provide no_shadow and no_reflection, it will still
create shadow and reflect itself in mirror...

Have a nice day.


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 26 May 2011 17:09:09
Message: <4ddec175@news.povray.org>

> Thanks Jaime,
>
> This describes pretty much exactly what I want to do.  Could you
> send me a small sample script that shows the semantic for doing
> this?

   Apart from the bundled demos, I've posted a Java lightmapping tool at
p.b.utilities, which includes a demo scene. It is aimed at automating
the baking process for a whole scene, composed of meshes for every
material. If the Java app doesn't suits your needs, just disregard it
and look at the output it produces: it should give you enough pointers
to start your own baking mechanism.

   Regards,

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From: John Ratcliff
Subject: Re: Is it possible to render only a sub-set of a scene?
Date: 27 May 2011 10:35:01
Message: <web.4ddfb68de70c3bc790ae49fd0@news.povray.org>
Thanks!  I got my game level into POVRay yesterday and it was so cool to see it
working.  My plan is to generate 6 lightmaps for each game level, using 6 flat
projections.  I'm going to take all of the mesh data which corresponds to the
dominant normal axis of +X/-X, +Y/-Y, and +Z/-Z. (I.e. all ceilings, floors,
etc.)

My goal is to get as crisp a projection as possible and maximize as much texture
real-estate as I can.  I'm also going to algorithmically generate thousands of
lights for the interiors too.  It's going to look so awesome!

John

Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:

> > Thanks Jaime,
> >
> > This describes pretty much exactly what I want to do.  Could you
> > send me a small sample script that shows the semantic for doing
> > this?
>
>    Apart from the bundled demos, I've posted a Java lightmapping tool at
> p.b.utilities, which includes a demo scene. It is aimed at automating
> the baking process for a whole scene, composed of meshes for every
> material. If the Java app doesn't suits your needs, just disregard it
> and look at the output it produces: it should give you enough pointers
> to start your own baking mechanism.
>
>    Regards,
>
> --
> Jaime Vives Piqueres
>
> La Persistencia de la Ignorancia
> http://www.ignorancia.org


Post a reply to this message

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