Jump to content
  • Advertisement
Sign in to follow this  
Sebastian Raszka

terrain and multiple textures

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

I have just started an RTS project and I have problems with terrain rendering.
I want to use tiles the same way Warcraft 3 does.
The red area around the different borders is transparent.
Then each tile in game is render out of a max of 4 tiles.

One approach I saw was to create different texture for each tileset.
This will work as long as I keep the amount of textures below 8 (I'm not sure if it is 8 but anyway I the maximum I have seen is 32 or maybe 64 on the newest machines)

I want to make sure the game work on older computers as well, so doing over 8 textures will not work.
And the problem is that I want to use more than 8, maybe even more that 32 textures on each map.
Another problem with that approach is the to store a coordinates for all textures in memory.
This should be ok for small maps (128x128) but can be problematic for bigger maps (up to 1024x1024)

Warcraft allows use of 13 tileset (not sure why it is 13 anyway) [I have checked it in map editor]
If it is possible I would like also to avoid shaders as I want the game to work also on very old computers (same as Warcraft 3 does)

What method would be best?

I have few other questions as well:
Since when shader are in use? (I want the game to run on 4/5 years old computer and I'm not sure if I can use shaders and if yes which version on shaders)
How to create fog of war most efficiently? (same as in warcraft 3: 2 layers, 1 fully black and other want for already explored terrain + visible area)
How to create multiple light sources? (for example in wacraft 3 you can place unlimited light sources working with terrain, building etc)

Share this post

Link to post
Share on other sites
If you want to support Intel chips, whether they are old or new, you probably should stick with GL 1.1 since their drivers tend to be buggy. Or just use Direct3D9 and shaders.
If you want to support nvidia and ATI from 5 years ago, that would be GL 2.1 (version of shader is GLSL 1.10)

Share this post

Link to post
Share on other sites
Ok, I have decided to use Direct3D9.
I'm just beginning to learn it, it is not as hard to move from OpenGL to D3D as I thought.
But could someone tell me how to go about binding 13+ textures to create terrain?
Just as Warcraft 3 does.

Share this post

Link to post
Share on other sites
You can do it in multiple passes. Draw the geometry with the lowest N textures in the terrain stack bound and draw, then draw with the next N textures bound, and so forth. As long as you have the fillrate available, you can draw as many as you want.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!