|
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Large object in OpenGL look ugly??? |
|
![]() |
![]() Lode GDNet+ Member since: 3/29/2002 From: Brasschaat, Belgium |
|||
|
|
||||
| I finally started the development of
a 3D space game, I can move around the spaceship with real Newtonion
acceleration/velocity physics already But of course a space game will require large planets, and I took an OpenGL unit of "1" to be 1 meter. So a realistic planet will have to be around the 20.000.000 OGL units. But just to test I made some cube-planets, and even if they're only 1000 units they're uglier than the EXACT same scene 1000 times smaller! This picture shows the difference: note the pink pixels on the right picture, that is another side of the cube that should be invisible. But for bigger scenes with more cubes at larger distances, it looks even worse that this. What can I do against that? EDIT: this pic shows it when I made the cubes 1.000.000 OGL units [edited by - Lode on July 30, 2002 7:24:44 AM] |
||||
|
||||
![]() |
![]() Shrew GDNet+ Member since: 3/4/2002 From: Kingston Upon Thames, United Kingdom |
|||
|
|
||||
| Do backface culling - what you are
seeing is a classic symptom of no backface culling. This is (probably)
compounded by the fact that your near and far clipping planes will have
to be displaced to a much greater degree in the larger scene, leading
to a lower resolution in the zbuffer at greater distances and showing
the effect of not backface culling. |
||||
|
||||
![]() |
![]() Lode GDNet+ Member since: 3/29/2002 From: Brasschaat, Belgium |
|||
|
|
||||
| Hmm, better for size 1000 already but still not good for size 1.000.000 I use glCullFace(GL_BACK); glEnable(GL_CULL_FACE); And the sides of the cubes are oriented correctly, and if the cubes have size 1.000.000 it looks like this (two times a screenie of the same): Am I doing something totally stupid here? |
||||
|
||||
![]() |
![]() MadKeithV Moderator Member since: 2/18/2000 From: Hasselt, Belgium |
|||
|
|
||||
| You're overflowing the precision of the Z-buffer. What bit depth do you have it set at? |
||||
|
||||
![]() |
![]() Lode GDNet+ Member since: 3/29/2002 From: Brasschaat, Belgium |
|||
|
|
||||
| Hmm I don't know :/ I use basecode from nehe to initialize OpenGL, so probably the same as nehe's basecode... Is it even possible to use extremely big worlds or is that at the cost of small details? I mean, even if I'd use a LOD system so that detailed spaceships are only drawn if they're close to me and only big undetailed planets are drawn far away, would it be possible? |
||||
|
||||
![]() |
![]() MadKeithV Moderator Member since: 2/18/2000 From: Hasselt, Belgium |
|||
|
|
||||
| Check your pixelformat structure
(PIXELFORMATDESCRIPTOR), and check the cDepthBits member. Try setting
it to 32 if it's not, and see if that improves your problem. |
||||
|
||||
![]() |
![]() rapso Member since: 10/25/2000 From: Germany |
|||
|
|
||||
| the way it works in spacegames is: without z buffer you have to sort your scene and polys, maybe you can draw the nearest highdetail objects with a zbuffer (and a near farclipping plane). there are some algorithms which might help you. BSP - to sort the polys inside a object multiple indexlist- make at leats 6 indexlist which have different polygone order, so depending on the view of the camera you can use the best matching one. of course, first you have to sort the objects. rapso->greets(); [edited by - rapso on July 30, 2002 9:23:01 AM] |
||||
|
||||
![]() |
![]() Lode GDNet+ Member since: 3/29/2002 From: Brasschaat, Belgium |
|||
|
|
||||
| Hmm 32 bits depth buffer didn't seem to help I guess I'll have to look into it further and try BSP... |
||||
|
||||
![]() |
![]() Lode GDNet+ Member since: 3/29/2002 From: Brasschaat, Belgium |
|||
|
|
||||
| BTW what I want to achieve is that
there's no skybox at all, all stars, planets, ... should be real 3D
objects (well I'll turn them into a simple point if they're far away
but you can fly to it if you want to and then they become spheres), and
at the same time relatively detailed ships, spacestations, ... should
be visible. Does there exist an open source project like this somewhere that I can take a look at maybe? |
||||
|
||||
![]() |
![]() Ut Member since: 3/30/2000 |
|||
|
|
||||
| You're trying to be too ambitious.
You can't accurately represent the size of astronomical units
seamlessly. Check out gamasutras three articles on rendering a
procedural universe. It talks about pitfalls and solutions of trying to
render planets, systems, and galaxies to scale. Ut |
||||
|
||||
![]() |
![]() phueppl1 Member since: 7/11/2000 From: Alkoven, Austria |
|||
|
|
||||
| You might run into floating precision
problems doing so.. not only for z-buffer errors, but also for object
detail.. polys might start jumping around at far distance from the
origin. you might wanna try doubles instead of floats. ok, hope that helped, cya, Phil Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|