Is it possible to 'hide' part of the map ?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

everything that is too far from your units is hidden (it is just black and you don't see what is there).
Maybe this a primitive solution, but it might be worth considering. What about telling the device use black as the background color and just setting the camera far clip plane at a respectable distance.

Of course this wouldn't work if you had geometry a long ways away that you wanted to draw, but it sounds like this is not going to be the case.

Travis
Ced666
Posts: 86
Joined: Fri Jan 13, 2006 10:29 am
Location: Belgium

Post by Ced666 »

Maybe I have found I solution for the terrain done with tiles. It's far from being perfect but it's a first try:

I could generate the texture for my terrain at the begining of the level, by generating a texture. This texture will be filled with the small tiles ordered in a certain manner.
The advantages of this technique are: not a lot of 'low-level' modifications in the engine, I 'just' have to override the TerrainSceneNode to add some specific functions (for generating the texture). The rest will be handled by the CTerrainSceneNode. Another advantage is that I will be able to do some 'pre-processing' on the terrain that is have some specific processing on the tiles transitions (I can use several methods, maybe I will implement several of them). It will also be as fast as a normal terrain rendering because once the texture has been generated (could take a little bit of time but it is just once), it is a normal terrain rendering processing.

But (and there is a but, unfortunately :cry: ), there are some (and one major) disadventages. The biggest disadventage will be the memory used to store this texture: it could be quite big, depending on the terrain size (for example, a terrain of 100X100 tiles of 64X64 pixels, calculate, that makes a huuuuge amount of memory). And 100 X 100 is not that excessive. Another disadventage (more from a coding point of vue): the ITexture and IImage classes of the engine doesn't provide a lot of support for this kind of operation so the processing will require pixel by pixel copying (from small texture to the big texture) but this could be done without too much problems.

So, what do you think of this approach ? I know, because of the texture size it won't be probably feasible unfortunately. OR maybe do you have another suggestion for that part ?

Thanks for all the help, if I manage to find a solution to that, I will surely give it back to the community :D
Post Reply