POV-Ray : Newsgroups : povray.newusers : Clipping macro Server Time
13 Nov 2024 03:48:19 EST (-0500)
  Clipping macro (Message 1 to 8 of 8)  
From: Nekar Xenos
Subject: Clipping macro
Date: 20 Apr 2001 03:09:41
Message: <3adfe0b5@news.povray.org>
I'm not sure if I'm posting this in the right place - let me know.

I want to do an animation that I think would be quite difficult to do
because it would take to long to render. It involves a scene going through a
forest. I've been thinking it might be plausible in this way: If I have a
highly detailed scene and a low detail scene and merge the two in such a way
that only the nearby stuff are rendered in detail, the rest of the rendering
would be on the low detail scene.

Maybe I can explain it like this: If there was an 'invisible' sphere around
the camera that clips the detailed scene to show only the near stuff and at
the same time clipping the low detail scene to cut out the near stuff,
wherever the camera goes. The other problem would be that there would
probably be a visible edge where the high and low detail scenes meet and
some sort of fading/transparency or blurring would be needed to make it look
good.

Is this plausible and is there someone that could make a macro like this for
me?

Thank you,

Gerhard

--
_______________________
J-Print
"We set the pace in colour"

329 Pretorius St., Pretoria
Momentum City Walk
(Opposite State Theatre)

Tel:           012 - 320 7250
Tel & Fax: 012 - 322 3877
Cell: 082 853 4711 - Nici


Post a reply to this message

From: Christoph Hormann
Subject: Re: Clipping macro
Date: 20 Apr 2001 04:14:21
Message: <3ADFEFE2.FB59FD29@gmx.de>
Nekar Xenos wrote:
> 
> I'm not sure if I'm posting this in the right place - let me know.
> 
> I want to do an animation that I think would be quite difficult to do
> because it would take to long to render. It involves a scene going through a
> forest. I've been thinking it might be plausible in this way: If I have a
> highly detailed scene and a low detail scene and merge the two in such a way
> that only the nearby stuff are rendered in detail, the rest of the rendering
> would be on the low detail scene.
> 
> Maybe I can explain it like this: If there was an 'invisible' sphere around
> the camera that clips the detailed scene to show only the near stuff and at
> the same time clipping the low detail scene to cut out the near stuff,
> wherever the camera goes. The other problem would be that there would
> probably be a visible edge where the high and low detail scenes meet and
> some sort of fading/transparency or blurring would be needed to make it look
> good.
> 

Since i don't know any applicable method to 'fade' objects i see no way to
avoid this visible border.  But if you do something like a forest, you
could use a low detailed and high detailed version of the single trees
depending on the distance to the camera.  

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Nekar Xenos
Subject: Re: Clipping macro
Date: 20 Apr 2001 05:10:58
Message: <3adffd22@news.povray.org>
> Since i don't know any applicable method to 'fade' objects i see no way to
> avoid this visible border.  But if you do something like a forest, you
> could use a low detailed and high detailed version of the single trees
> depending on the distance to the camera.

You're right.

Is there anyone that could help me with a macro to do this? I'll also be
needing it for other scenes so the basic principle would be to replace low
detail objects with detailed objects when they are within a certain radius.

Thanks

Gerhard aka Nekar


Post a reply to this message

From: Chris Colefax
Subject: Re: Clipping macro
Date: 20 Apr 2001 05:37:27
Message: <3ae00357@news.povray.org>
Nekar Xenos <vir### [at] iconcoza> wrote:
> Is there anyone that could help me with a macro to do this? I'll also be
> needing it for other scenes so the basic principle would be to replace low
> detail objects with detailed objects when they are within a certain
radius.

This shouldn't be difficult to do, using the camera position and the vlength
() function.  Begin by declaring a Tree object (with the full detail you
want), and a QuickTree object (a simpler version, such as a box with an
image-map created by rendering the full detailed tree with the alpha option
enabled).  Then when you place your trees, check each tree's position
against the camera location, e.g.:

    #declare camera_location = <-10, 20, -30>;
    camera {location camera_location}

    #declare R1 = seed(0);
    #declare Count = 0; #while (Count < 1000)    // 1000 random trees
        #declare TreePosition = (<rand(R1), 0, rand(R1)>-0.5)*<2000, 0,
2000>;
        #if (vlength(TreePosition - camera_location) < 100)
            object {Tree translate TreePosition}
        #else
            object {QuickTree translate TreePosition}
        #end
    #declare Count = Count + 1; #end

Any tree closer than 100 units to the camera uses the full details,
otherwise the quick version is used.  You could also use the #switch and
#range functions if you wanted more than two levels of detail, or use macros
to create the trees in different ways depending on the distance to the
camera.


Post a reply to this message

From: Nekar Xenos
Subject: Re: Clipping macro
Date: 20 Apr 2001 07:30:38
Message: <3ae01dde@news.povray.org>
Thanks. I'll give it a try.

Nekar


Post a reply to this message

From: John VanSickle
Subject: Re: Clipping macro
Date: 20 Apr 2001 14:42:40
Message: <3AE083E9.312C3CEA@erols.com>
Nekar Xenos wrote:
> 
> I'm not sure if I'm posting this in the right place - let me know.
> 
> I want to do an animation that I think would be quite difficult to do
> because it would take to long to render. It involves a scene going
> through a forest. I've been thinking it might be plausible in this
> way: If I have a highly detailed scene and a low detail scene and
> merge the two in such a way that only the nearby stuff are rendered in
> detail, the rest of the rendering would be on the low detail scene.

Calculate the distance from the camera to each object.  Declare the
object according to that distance (high detail for near, low for far).

If there are no reflective surfaces in the anim, you can also use
some math to figure if the object is in the camera view at all, and
not declare it if it isn't.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Ron Parker
Subject: Re: Clipping macro
Date: 20 Apr 2001 14:51:34
Message: <slrn9e119o.1ik.ron.parker@fwi.com>
On Fri, 20 Apr 2001 20:46:01 +0200, John VanSickle wrote:
>Calculate the distance from the camera to each object.  Declare the
>object according to that distance (high detail for near, low for far).
>
>If there are no reflective surfaces in the anim, you can also use
>some math to figure if the object is in the camera view at all, and
>not declare it if it isn't.

Something that hasn't been mentioned in this discussion is that if you
have certain kinds of refractive or reflective curved surfaces, this 
algorithm might give substandard results due to the old "objects in mirror
may be closer than they appear" problem.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: John VanSickle
Subject: Re: Clipping macro
Date: 21 Apr 2001 12:49:40
Message: <3AE1BAF1.B77A14F4@erols.com>
Ron Parker wrote:
> 
> Something that hasn't been mentioned in this discussion is that if you
> have certain kinds of refractive or reflective curved surfaces, this
> algorithm might give substandard results due to the old "objects in
> mirror may be closer than they appear" problem.

That was my favorite Far Side cartoon...
-- 
ICQ: 46085459


Post a reply to this message

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