Archived

This topic is now archived and is closed to further replies.

Terrain

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

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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-

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Anyone have any ideas on how to do terrain collision? Like so i can have a player walk over it...just some pointers to good tutes will be fine.

Thanks

Share this post


Link to post
Share on other sites
quote:
Original post by Mr Lane
Anyone have any ideas on how to do terrain collision? Like so i can have a player walk over it...just some pointers to good tutes will be fine.

Thanks


make the camera height to be the height of the terrain at that point in space.

Share this post


Link to post
Share on other sites
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


I wouldn't. Raw is extremely wasteful and hard with lods. Only sensible lod for rtns is chunked lod, which again is even more wasteful and hardly eleguent. I guess raw format is good for fiddling with textures and such, but for a real game? I don't think so.

Instead I suggest some kind of pregenerated triangulation. Does not waste memory and better to work with when lodding. More at www.vterrain.org.



[edited by - captian goatse on March 23, 2004 9:05:22 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Captian Goatse
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


I wouldn''t. Raw is extremely wasteful and hard with lods. Only sensible lod for rtns is chunked lod, which again is even more wasteful and hardly eleguent. I guess raw format is good for fiddling with textures and such, but for a real game? I don''t think so.

Instead I suggest some kind of pregenerated triangulation. Does not waste memory and better to work with when lodding. More at www.vterrain.org.



[edited by - captian goatse on March 23, 2004 9:05:22 AM]


Battlefield 1942 uses 512x512x16bit RAW files for the heightmaps and seemed to do ok

Share this post


Link to post
Share on other sites
I am doing a TGA loader now. I will use TGA''s for the data. Unreal uses them for the heightmaps.

As for the collision suggestion, i will have to think a bit more about what i need.

Share this post


Link to post
Share on other sites
quote:
Original post by Mr Lane
I am doing a TGA loader now. I will use TGA''s for the data. Unreal uses them for the heightmaps.

As for the collision suggestion, i will have to think a bit more about what i need.


your heightmap. that and you should know how the squares are divided into triangles to interpolate correctly. but besides that you just find the triangle youre in and interpolate (for simple cases (fps, small objects, etc.) for larger stuff like vehicles its getting a bit more interesting ,-)

Share this post


Link to post
Share on other sites