Jump to content
  • Advertisement

Archived

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

fallex

Terrain texture

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

Tell me please which method of texturing huge terrains is the best? Now i''m working on my project RTS. And i want to make a lot of different levels, but I don''t know what is the best way to texture them? Splatting textures or simple tile-sprites (like in Warcraft III). I want to make very realistic terrain, but splatting textures with high quality eat a lot of memory... simple sprites look like crap. Screen A Screen B Screen C Screen D It needs upgrade - some kind of LOD, maybe geomipmapping and good texturing method. Can somebody tell me the best texturing way?

Share this post


Link to post
Share on other sites
Advertisement
The "best" texturing method is completely subjective.

Here''s what I''m doing:

The geometry in my level is stored as a series of vertices and faces.

Faces are made up of:

1.) The "Material" (not as in API-specific materials) that the surface is made of.

2.) indices into the array of vertices (can really be any number, but I''m sticking with 3 currently so that I don''t have to handle triangle calculating triangles)

3.) A face normal

Each face is sorted by material when it''s placed inside a node in the octree/quadtree structure.

I render using dynamic index buffers / static vertex buffers.

Each material contains the following information:

1.) Textures used (up to 8)
2.) Surface lighting properties (ala a d3d-style "material")
3.) Vertex shader (optional)
4.) Pixel shader (optional)
5.) Various rendering flags
6.) Various flags used for physics.

This allows me to build levels (using a level editor) that have any number of "materials", each of which can be rendered in any way I like.

For example, if a particular surface is using the "terrain" material, it uses a vertex shader that assigns weights for each texture used, and displaces certain vertices slightly in accordance with the textures used at that location (which helps a lot with making the rocks look rockier and the dirt look dirtier). The associated pixel shader does a texture blend using those weights.

This gives me the flexibility to really texture any particular area of the map in any way I''d like. If one area needs to have an overlay of clear, animated water, I simply add enough faces to fill that section, assign it a vertex shader that deforms the water according to time, and give it a pixel shader that provides a water like appearance. If the area just needs a simple stone texture, i leave the vertex & pixel shaders out of the equation and just assign a texture.

I''m very, very pleased with this method as it allows me to render any type of geometry (indoor or outdoor) without using any kludges like multiple rendering pipelines or something similiar. A single map seamlessly blend between indoor and outdoor environments without having to do anything special. I can do caves in the terrain rendering, and I don''t have to worry about having perfectly grid-aligned maps for everything I do.

Share this post


Link to post
Share on other sites
Thanks
And how huge is terrain, rendered using this method. How many FPS? Configuration?

Share this post


Link to post
Share on other sites
I''m at work, so I don''t have any screens.

So far as speed is concerned, it''s fairly fast, though I''m still working on optimizing some things, but using just 1 big vertex buffer, which is COMPLETELY unoptimized, I''m getting about 200fps using a 1024x1024 heightmap as a basis for creating the level + about 2500 polys worth of walls and whatnot.

There''s an obvious optimization of using seperate VB''s for each node in the octree in order to better optimize vertex data, but I haven''t implemented that quite yet due to storage issues.


The system it''s running it on is an Athlon XP 2000+ (down clocked to 1.5Ghz due to some fan / heat issues I''ve been having), GeforceFX 5900 128MB, and 1GB of system ram.

For the map as specified above, about 200MB of ram is used during runtime.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!