Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Z-test problem  (Read 1655 times)
0 Members and 1 Guest are viewing this topic.
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Posted 2006-09-06 18:05:41 »

1st image : everything looks fine, the white plane is under the grass one
2nd image : the camera is a bit lower and the white plane appears over the grass one (though it's still under).

What's *that* ?  Shocked Shocked Shocked

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline bohdan

Junior Member




Java-positive...


« Reply #1 - Posted 2006-09-16 15:19:03 »

Did you get it sorted?

Strange things like that did happen to me too, well not exatly your case, but as you saing - just move a camera a bit - and it got wrong rendered, move it back - everything fine.... and the movent is so little, that actually nothing changes in the scene really, same nodes in your view and same order...

I going to open new topic with very simple yet killing me test case with that sort of thing happening, but this time it would be regarding transparency...
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #2 - Posted 2006-09-16 15:22:39 »

In fact it may be due to a lack of precision of the Z-buffer : when the farPlane value is too far the precision is reduced, thus leading to some mistakes in rendering. Is 3000 really too high for a back-clip distance ?

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline bohdan

Junior Member




Java-positive...


« Reply #3 - Posted 2006-09-16 15:28:16 »

In fact it may be due to a lack of precision of the Z-buffer : when the farPlane value is too far the precision is reduced, thus leading to some mistakes in rendering. Is 3000 really too high for a back-clip distance ?

Well, yes, but only when your nodes are very close, my test case will be sort of "general", objects will be far from each other, and another thing is - I have triyed to make farPlane of relatively little distance (200), and nearPlane of (1) - didn't help.
BTW, nearPlane distance - would be something to worry about first of all, since depth buffer resolution is much more sensitive to it than to farPlane.
Don't make nearPlane too close...

But anyhow, it doesn't seems to be the depth test problem...

Edit: What about 3000, well... sounds a bit too big, do you realy need it to be so big? Always try to make farPlane as close as your scenario allows, and nearPlane - as far as it is acceptable (1 or 0.5 should be fine, don't do 0.001 etc, as people tend to do)...
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #4 - Posted 2006-09-16 15:31:32 »

In fact it may be due to a lack of precision of the Z-buffer : when the farPlane value is too far the precision is reduced, thus leading to some mistakes in rendering. Is 3000 really too high for a back-clip distance ?

Well, yes, but only when your nodes are very close, my test case will be sort of "general", objects will be far from each other, and another thing is - I have triyed to make farPlane of relatively little distance (200), and nearPlane of (1) - didn't help.
BTW, nearPlane distance - would be something to worry about first of all, since depth buffer resolution is much more sensitive to it than to farPlane.
Don't make nearPlane too close...

But anyhow, it doesn't seems to be the depth test problem...
Can't wait to see the test case. Each bug is a chance to understand more the rendering code.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #5 - Posted 2006-09-16 16:15:33 »

Just my three cents...

Can't you simply put your whole scene into a TransformGroup, which scales it down such that a farplane of any smally value would be sufficient?
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #6 - Posted 2006-09-16 16:37:05 »

Just my three cents...

Can't you simply put your whole scene into a TransformGroup, which scales it down such that a farplane of any smally value would be sufficient?
Yeah of course.

Anyway the I don't have two planes which are rendered as close in my game : the white plane was there for debugging purposes only.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline bohdan

Junior Member




Java-positive...


« Reply #7 - Posted 2006-09-16 18:23:04 »

Quote
Can't wait to see the test case. Each bug is a chance to understand more the rendering code.

See here http://www.java-gaming.org/forums/index.php?topic=14898.0.
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #8 - Posted 2006-09-16 22:03:30 »

Quote
Can't you simply put your whole scene into a TransformGroup, which scales it down such that a farplane of any smally value would be sufficient?

Well, you could, but you would lose even more accuracy through floating point transformations. A multiplication with the scale, followed by the depth comparion...

So its not a good idea....

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (88 views)
2013-05-17 21:29:12

alaslipknot (96 views)
2013-05-16 21:24:48

gouessej (128 views)
2013-05-16 00:53:38

gouessej (123 views)
2013-05-16 00:17:58

theagentd (131 views)
2013-05-15 15:01:13

theagentd (119 views)
2013-05-15 15:00:54

StreetDoggy (161 views)
2013-05-14 15:56:26

kutucuk (184 views)
2013-05-12 17:10:36

kutucuk (185 views)
2013-05-12 15:36:09

UnluckyDevil (191 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.13 seconds with 22 queries.