Rendering Problem

Started by
4 comments, last by Geared 13 years, 3 months ago
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]
http://img440.images...gamedevsig.jpg/

I'm not the typical programmer.
Advertisement
GDNet doesn't (currently) support the 'URL' tag, but you can use the HTML 'a' tag instead to make your links click-able.
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]
http://img440.images...gamedevsig.jpg/

I'm not the typical programmer.
PROTIP:upload images in .png format (or .jpg for photos). Never use .bmp ever
you notice you guys haven't given an actual helpful tip thus far? thanks anyways.
http://img440.images...gamedevsig.jpg/

I'm not the typical programmer.
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.

This topic is closed to new replies.

Advertisement