Terrain

Started by
14 comments, last by Mr Lane 20 years ago
Hi people I was wondering how one would go about textuing a terrain. I have a large terrain running now of flat shaded triangles, but i was wondering how i would go about texturing it. The thing is, the one texture map needs to cover the entire terrain (and tile of course), but how would i go about texturing the whole lot as opposed to each triangle...like i dont want any seaming between polygons. I know the texture will streach on steep surfaces, but that is cool. Another thing, the height now uses a sin wave, but i want to use a greyscale heigh map that i can edit. What format do people reccomend? I have heard of this RAW format, but what is it, and how can you edit it in a program like photopaint?
Advertisement
I would recommend a greayscale image in RAW format (all color value are equal).

http://www.bellsouthpwp.net/n/i/ninquenor/shots.htm
http://www.gamedev.net/community/forums/topic.asp?topic_id=149064
http://www.cbloom.com/3d/techdocs/splatting.txt
Personally i use an 8-bit one-channel raw bitmap for the heightmap. To open it in photoshop you just specify the dimensions and nr of channels.
To texture it, have 2 sets of UV''s. One that range from 0-1 over the entire terrain, this is for your base-texture. And one that goes from 0-
quote:Original post by Duekiller
I would recommend a greayscale image in RAW format (all color value are equal).

http://www.bellsouthpwp.net/n/i/ninquenor/shots.htm
http://www.gamedev.net/community/forums/topic.asp?topic_id=149064
http://www.cbloom.com/3d/techdocs/splatting.txt

Cool thanks for the info you posted, I have alot of reading to do. Another thing, i was just wondering performance wise (roughly what i should be getting). I dont have a frame rate counter in yet mind you but will soon.

My terrain, flat shaded 20,000 polys is smooth frame rate, but the app is slow at 160,000 triangles...but i am not sure if it is just because my key inputs have slowed down as the app slows down...

On a Duron 1000, with 480 RAM and a GF2MX400 32mb what type of thoughput are we talking here. I know it can be difficult to give a figure, but what is your best estimate?
Yeaha terrain rendering is a pain in the ass.
The terrain will be slow if you use brute force ( rendering every triangle). To speed things up i would recommend using frustrum culling(removing things that you cant see).

ps: my first terrain engine ran at 98fps on radeon9800xt my new one with culling runs at around 600fps.
quote:Original post by Duekiller
Yeaha terrain rendering is a pain in the ass.
The terrain will be slow if you use brute force ( rendering every triangle). To speed things up i would recommend using frustrum culling(removing things that you cant see).

ps: my first terrain engine ran at 98fps on radeon9800xt my new one with culling runs at around 600fps.
Doesnt OpenGL remove things that are outside the view volume anyway?

I am not going to go into hardcore optimization here with Unreal style antiportals and what not this is only a university project and I want to pack the engine full of features rather than have industry standard optimization.

Having said that, the polygons are rendering both sides...i dont know how to select one side of a poly for rendring in OpenGL (I am fairly new to it). How does Quake, Unreal etc decided only to render one side of their polygons?
you can enable and disable face culling and specify which side to cull.

>Doesnt OpenGL remove things that are outside the view volume anyway?

yes, AFTER sending and transforming every single vertex and performing pointless clipping for every single triangle. opengl cant magically tell what will end up on screen or not without doing lots of useless math first.

also, i dont consider frustum culling as "optimizing" and doing nothing but that (ie no occlusion culling, lod, etc.) is still nothing but brute force to me.

dont worry, a gf2mx is slow enough and after adding a few nice textures youre probably lucky if it does 3mill/second. my gf3 got about 12, 8 after blending a bunch of textures. my radeon 9800 is happily pushing around 100 if you keep texturing simple (so "brute forcing" a 2048x2048 terrain at 11fps is quite ok and simply says that without reducing visibility a lot or using lod thats just not the way to do it).
f@dzhttp://festini.device-zero.de
quote:Original post by Mr Lane
Having said that, the polygons are rendering both sides...i dont know how to select one side of a poly for rendring in OpenGL (I am fairly new to it). How does Quake, Unreal etc decided only to render one side of their polygons?

Enable with glEnable(GL_CULL_FACE)
Specify which faces to cull with glFrontFace with GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

Front/back facing-ness is determined by polygon winding order, clockwise or anti-clockwise when looking at the front. Specify this with glFrontFace with GL_CW (clockwise) and GL_CCW (counter clockwise, crazy yanks).
Hmm, alternating triangles are specified in different orders in my terrain so alternating triangles are visible on one side an not the other...this means i have to go back and change order that i read vertexes out of my arrays dont I?

Say i have a square made up of 2 triangles, the first one vertexes I have ordered (X, Z) (0,0),(0,1),(1,1) and the opposing triangle is (0,0),(1,0),(1,1)...I guess i need to make it (0,0),(1,0),(1,1)
Done, easy.

Thanks alot!

This topic is closed to new replies.

Advertisement