Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 02:26:01 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Front and Back clip - z-buffer size
Pages: [1]
Print
Author Topic: Front and Back clip - z-buffer size  (Read 1142 times)
badboyboogey
Enjoying the stay
*
Offline Offline

Posts: 40



View Profile
« on: 14. December 2007, 08:48:03 pm »

It's me again Smiley

What are the front-back clip ratio capabilities of xith?

eg. With J3d you are recomended to stick to 16bit zbuffers that gives ratios of 1/3000 so a frontclip of 0.1f would mean a backclip of 300.0f, I use alot higher ratios with j3d with no problems (1/30000) even ratios of 0.1/100000.0 with moderate success.
does xith support 24 or 32bit zbuffers? (I guess this is an opengl question really).
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 15. December 2007, 12:13:19 am »

Xith3D uses a 16 bit z-buffer. Don't know the "ratio" available with 16 bit. You seem to know. But AFAIK it's the precision, that is affected by the size of the z-buffer. So, if you use a smaller z-buffer, you will face z-fighting more often for large depth values. But I have never seen users complaining about a too smal z-buffer in xith3d. You should better consider using a smaller scene scale than raising the z-buffer.

So, if you're placing one shape at depth 10 and one at depth 10000 you should better place them at 1 and 1000 and adjust the view appropriately. This will give you the same result and you don't have to raise the z-buffer size. Maybe I'm wriog, but isn't this better?

Marvin

PS: Please start a new thread for a new topic next time Wink
Logged
badboyboogey
Enjoying the stay
*
Offline Offline

Posts: 40



View Profile
« Reply #2 on: 15. December 2007, 12:51:38 pm »

Quote
So, if you're placing one shape at depth 10 and one at depth 10000 you should better place them at 1 and 1000 and adjust the view appropriately. This will give you the same result and you don't have to raise the z-buffer size. Maybe I'm wriog, but isn't this better?
Yes i think it is generally better, However when you have a small object lets say 0.2 from view and a large object 10000.0 from view and you want to be able to see them both (FrontClip 0.1 and BackClip 10000.0), adjusting the scene scale makes no difference, the near object then would be at 0.02 and the far at 1000.0 (so front clip would have to be 0.01 and backclip 1000.0, the ratio between the 2 is the same.
Normally not a problem except when trying render large objects at long distances in scenes along with small objects at short distances (like in space simulation).
But have been playing around with multipass rendering and i think it will do what i want so i  can overcome this Smiley
Is there a way to specify larger (24 or 32bit) z-buffers (Just so i can play around with them)
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 15. December 2007, 01:44:10 pm »

Yes i think it is generally better, However when you have a small object lets say 0.2 from view and a large object 10000.0 from view and you want to be able to see them both (FrontClip 0.1 and BackClip 10000.0), adjusting the scene scale makes no difference, the near object then would be at 0.02 and the far at 1000.0 (so front clip would have to be 0.01 and backclip 1000.0, the ratio between the 2 is the same.
Normally not a problem except when trying render large objects at long distances in scenes along with small objects at short distances (like in space simulation).

Well, if you're rendering one object very close to the camera and one very far away, you could consider the far away one as being rendered at infinity. So putting it into a Background Node and prescaling the shape so that it looks as of it was far away would not stress the z-buffer precision.

But have been playing around with multipass rendering and i think it will do what i want so i  can overcome this Smiley
Is there a way to specify larger (24 or 32bit) z-buffers (Just so i can play around with them)

No. Unfortunately not. Well, you could just change the source of the CanvasPeerImplXXX, which you're using, where the z-buffer-depth is set up.

Marvin
Logged
badboyboogey
Enjoying the stay
*
Offline Offline

Posts: 40



View Profile
« Reply #4 on: 16. December 2007, 02:07:28 pm »

Can i layer Backgrounds?
ie:- can i have 3 backgrounds and guarantee they will render in order over the top of one another?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 16. December 2007, 02:21:43 pm »

Can i layer Backgrounds?
ie:- can i have 3 backgrounds and guarantee they will render in order over the top of one another?

Unfortunately this is not yet possible. But when I transfer all the Background/Foreground Node functionality to the RenderPass system, it will be possible.

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #6 on: 16. December 2007, 11:32:29 pm »

Shouldn't whis be possible to do just by rendering three render passes and clearing the depth buffer between them? (isn't there already a "layered" mode or something?)
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #7 on: 17. December 2007, 12:19:32 am »

Shouldn't whis be possible to do just by rendering three render passes and clearing the depth buffer between them? (isn't there already a "layered" mode or something?)

No. Currently all Background Nodes are internally merged in one RenderPass. So you cannot clear anything between them, since they are sorted in the same RenderBin. Of course this is subject to be changed.

Marvin
Logged
badboyboogey
Enjoying the stay
*
Offline Offline

Posts: 40



View Profile
« Reply #8 on: 17. December 2007, 11:07:28 pm »

Found a good page on z-buffer ratio's for anyone who's interested.
Had a look around and it seems nearly all 3d graphics cards produced in last few years have 24bit z-buffer, am going to set depth bits in CanvasPeerImplAwt and play around Smiley
Might be worth you adding a z-buffer size var to canvas constructor.
Just a thought.....

http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html

John
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #9 on: 01. January 2008, 07:44:22 pm »

I have done the move from Background/Foreground Nodes to Background-/ForegroundRenderPass. This way you can exactly say, in which order things are rendered. This should help you with your z-buffer size problem.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic