Jump to content
  • Advertisement
Sign in to follow this  
GMA965_X3100

OpenGL Rendering Problem

This topic is 2852 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

Story:
I have mastered the ard of rendering terrains ( simple ones )

Issue:
After writing 20 minutes worth of openGL API, and other functionalities,
fps, fonting system, image loading, etc you devs know simple stuff,
I notice the tetuxtures on my terrain are not rendering correctly at all,
and the error is unbearable:

Error images:
http://myfreefilehosting.com/f/237f3a10a4_1.38MB

http://myfreefilehosting.com/f/2bc52f0323_1.38MB

After 'porting' my terrain code to another author's code, this is how the terrain is supposed to look - I couldn't bother to code the mountain tops, so here goes same map, using same hiehgtmap and land testure:
http://myfreefilehosting.com/f/1a61338081_1.48MB

http://myfreefilehosting.com/f/1130fb1284_1.38MB


Your prompt assistance would be appreciated.
As you can all see, nothing is wrong with the terrain creation code, but something wrong with my rendering code? I also notice that when i get together a quick cube in 3d scene, it's texture appears to be alpha-transparent, without me adding any blending code to terrain program.

Here is the rendering bit from my terrain creation and rendering program:
bool project_3D ( )
{
glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glLoadIdentity ( );

....
}

The init code:

bool glProgram::init_program ( )
{
glEnable ( GL_TEXTURE_2D );

glShadeModel ( GL_SMOOTH );
glClearColor ( 0.1f, 0.1f, 0.1f, 0.1f );
glClearDepth ( 1.0f );
glEnable ( GL_DEPTH_TEST );
glDepthFunc ( GL_LEQUAL );
glHint ( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
return true;
}

There are other things in init_program ( ), like image load calls, but no colour correction code:

[Edited by - GMA965_X3100 on December 28, 2010 10:59:44 PM]

Share this post


Link to post
Share on other sites
Advertisement
GDNet doesn't (currently) support the 'URL' tag, but you can use the HTML 'a' tag instead to make your links click-able.

Share this post


Link to post
Share on other sites
it seems that when i separate the meshes, that is spearate the seaMesh,
landMesh, and mountainMesh, they display whole in entirty, leaving out a minscule area, ( rather seems to be pulsating texture as cam is rotated )...when meshes are displayed together again, i get the same thing as seen in post images...need aid.

[Edited by - GMA965_X3100 on December 28, 2010 11:01:12 PM]

Share this post


Link to post
Share on other sites
I don't really see what's going on. But when you call:
glClearColor ( 0.1f, 0.1f, 0.1f, 0.1f );

You are clearing the alpha channel to 0.1. If by chance your textures are somehow using alpha blending, then they would be almost completely transparent. You should set the alpha channel to 1.0f unless you need it to be different for a specific reason.
glClearColor ( 0.1f, 0.1f, 0.1f, 1.0f );

I suspect this isn't the issue, but something I noticed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!