Original Post
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]
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]