I'm also working on a terrain shader for use blending textures with alphamaps and atlas texture for possibility to use more than 4 textures, but I still have some small problems so maybe on a next version :p
I'm after the same thing. I was able to do this with an engine I was working with.. I used a frag shader to blend 4 textures based on weights and distance. I used it for near and far textures. With irrlicht i I cant send multiple textures to a shader, at lease I dont see how. How are you achieving this?
int var0=0; services->setPixelShaderConstant("heightMap", (float*)(&var0), 1);
int var1=1; services->setPixelShaderConstant("tex1", (float*)(&var1), 1);
is it possible to use multiple textures for terrain?
No, just 1 solid texture and 1 detail texture on fixed pipeline per terrain.
But you can use texturing shader like splatting or anything else like that.
I'm actually working on a texturing shader with alphamaps and texture atlas to blend more than 16 texture per terrain. It works fine but need some improvment.
That sounds wicked.. Cant wait to see that! How's the progress with it?
Edit: Forgot to mention, i do have a few problems with the terrain.. I get these weird seams (take a look at the picture I've uploaded), and sometimes when i move around the terrain, the program just crashes.
Something in the constructor of CTerrain is causing a crash for me.
It seems to be corrupting memory and then after I cannot load any textures. I've narrowed it down to somewhere in the code after the comment //Create Meshbuffer but I'm still trying to find it. Given the lines shown above I'd guess somewhere something is off by one.
Any clues?
Update: via divide and conquer, Looks like this line is the culprit:
CTTileBuffer=new scene::SMeshBufferLightMap();
I guess I'll have to drill down into that constructor and see
why it would be causing an issue.
I have been playing around with this, downloaded the most recent version and adding any mesh to the scene seems to crash with a memory fault of some sort. Seems to happen when it destroys the map texture adjacent to the added mesh object.
Is there still work being done on this terrain engine? I would really like to use this to use my own terrain images.
- Lines in OPENGL Still appear as well, I have beat this code to death to try and figure this one out as well. It seems to be stuck to the colormap only but not positive.
I have been working with this for a few days now, it seems very nice, a few options however, I am working very hard to understand how I can add collision to this terrain. I have several placed objects on this terrain and have not applied any gravity yet.
I have my collision meta all setup but cannot figure how to add the newly added tiles to the meta collision data. How can this be done?
Any insight into this would surely be appreciated.
Thanks
Digz..
I have been working with this for a few days now, it seems very nice, a few options however, I am working very hard to understand how I can add collision to this terrain. I have several placed objects on this terrain and have not applied any gravity yet.
I have my collision meta all setup but cannot figure how to add the newly added tiles to the meta collision data. How can this be done?
Any insight into this would surely be appreciated.
Thanks
Digz..
may I ask what your using to place your objects; can you use irredit or is this homegrown ?
are shaders working in this latest code for multitextured terrains with alpha ?
- Added collision detection to each "zone".
- Added multithreading to load sections in the background.
- More efficiently removes old zones from memory.
Both of these still need a little bit of work. I will post code when I'm happy with it.