Yet another newbie terrain renderer ...
I started to learn opengl and c++ a couple of weeks ago, and now i have made my first terrain renderer!
It's heightmap based (257 * 257 verts), multitextured and has quadtree frustum culling, no LOD as of yet. Use the arrow keys and pageup/pagedown to navigate.
http://users.pandora.be/manny/opengl/terrain.zip
For starters, I would like to know if it works :-) . Then I would like to know what the fps is at several "block counts". If you don't feel like doing them all, just give me the fps at the beginning (200 blocks visible).
For example I get (Athlon 500, 128 RAM, Matrox G400 32MB):
beginning = 4 fps
0 blocks = 304
+-64 blocks = 13
+-128 blocks = 7
256 blocks = 3
thx in advance!
oh yeah BTW, opengl rocks !!!
PS : go underwater for a "neat" fog effect
EDIT:
it has come to my attention that the font may not be showing on some cards, can somebody confirm this ? Some text should be visible in the lower left corner.
[edited by - Manny on August 21, 2002 1:03:15 PM]
[edited by - Manny on August 21, 2002 2:40:07 PM]
Viva la Révoluçion !
Well, i can confim that with the text. On my GeForce 2 GTS i don''t see but the rest I''ve seen was really really good!!
The underwater fog was cool!!
The underwater fog was cool!!
Looks Awesome and I only have Intel 815 Graphics chip (work comp). Unfortunatly I cant say fps because I also dont get any text displaying. Another thing, how do you change the "block count"?
quote:
Original post by glnefugio
Well, i can confim that with the text. On my GeForce 2 GTS i don''t see but the rest I''ve seen was really really good!!
The underwater fog was cool!!
Damn, with my matrox G400 I can see it perfectly, and it obviously is able to load the texture because otherwise it would give an error message and exit. Maybe it''s the blending or the multitexturing that''s the problem ...
I''m wondering did everything seem (somewhat) fluid on a GF2 ?
Viva la Révoluçion !
quote:
Original post by ISOPimp
Looks Awesome and I only have Intel 815 Graphics chip (work comp). Unfortunatly I cant say fps because I also dont get any text displaying. Another thing, how do you change the "block count"?
You don''t change the block count manually, it changes when you move around on the terrain. It represents the number of visible blocks drawn on screen (max = 256).
Viva la Révoluçion !
this is the code I''m using for the font drawing (it''s from NeHe tut 17 I think, slightly adapted)
void TexFont::Print(int x, int y, int set, char *text, ...) // Where The Printing Happens{ char string[256]; // Holds Our String va_list ap; // Pointer To List Of Arguments if (string == NULL) // If There''s No Text return; // Do Nothing va_start(ap, text); // Parses The String For Variables vsprintf(string, text, ap); // And Converts Symbols To Actual Numbers va_end(ap); if (set>1) { set=1; } gllActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); // Enables texturing glDisable(GL_DEPTH_TEST); // Disables Depth Testing glEnable(GL_BLEND); // Enables blending glBlendFunc(GL_SRC_ALPHA,GL_ONE); // Type Of Blending To Perform glBindTexture(GL_TEXTURE_2D, texture[0]); // Select Our Font Texture glColor4fv(color); // Sets the font color glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,640,0,480,-1,1); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslated(x,y,0); // Position The Text (0,0 - Bottom Left) glListBase(base-32+(128*set)); // Choose The Font Set (0 or 1) glCallLists(strlen(string),GL_BYTE,string); // Write The Text To The Screen glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix}
Viva la Révoluçion !
Cool, love the fog
Can't tell you the FPS, occasionally what I think is the text flashes on the screen as white rectangles though
How did you make the big texture, looks really nice
BTW framerate never dropped to less than about 15fps (guess) even when looking at most of the terrain from one corner
Duron 1200
Geforce 2mx
512mb PC133
(I hope you don't mind, I've 'borrowed' that detail texture for my own terrain renderer, so much nicer than my old one!
)
[edited by - bluecat on August 21, 2002 4:54:33 PM]
Can't tell you the FPS, occasionally what I think is the text flashes on the screen as white rectangles though

How did you make the big texture, looks really nice
BTW framerate never dropped to less than about 15fps (guess) even when looking at most of the terrain from one corner
Duron 1200
Geforce 2mx
512mb PC133
(I hope you don't mind, I've 'borrowed' that detail texture for my own terrain renderer, so much nicer than my old one!

[edited by - bluecat on August 21, 2002 4:54:33 PM]
______________________________DGDev - The Delphi Games Development Community
quote:
Original post by BlueCat
Cool, love the fog
Can't tell you the FPS, occasionally what I think is the text flashes on the screen as white rectangles though
How did you make the big texture, looks really nice
that's interesting (white flashes)
about that texture, I have to admit I didn't make it myself. I found it while looking for a cool looking heightmap i could use. When it's stretched over the entire terrain it's pretty washed out though, that's why I use the detail texture (also found on the net. I'm not much of an artist

[edited by - Manny on August 21, 2002 4:57:28 PM]
Viva la Révoluçion !
You can see your texture in action here!
It's my first engine too, you always remember the first one
Good luck with yours
[edited by - bluecat on August 21, 2002 5:34:06 PM]
It's my first engine too, you always remember the first one

Good luck with yours
[edited by - bluecat on August 21, 2002 5:34:06 PM]
______________________________DGDev - The Delphi Games Development Community
quote:
Original post by BlueCat
You can see your texture in action here!
I get massive texture corruption and other graphical abnormalities with your engine, but it''s probably due to my G400. It doesn''t have the best OpenGL drivers to say the least.
Oh well, time to upgrade me thinks !
Viva la Révoluçion !
Viva la Révoluçion !
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement