Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lode

OpenGL Large object in OpenGL look ugly???

This topic is 5896 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Hmm 32 bits depth buffer didn''t seem to help

I guess I''ll have to look into it further and try BSP...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!