hmm seems like u use the same idea, that i wanted to use. so i have to check my code^^ with "popping" i meant that new parts of the terrain (a new 33x33 tile) is shown instantly instead updating the height data of the geometry data in a smooth way. the best would be a carpet-like terrain which follows ur feet while the heighdata is streamed out of a buffer which get filled by information with the new loaded heightmaps. so u have a smooth loading between tiles.
the texture splatting works with a glsl shader. for every tile u define a data set of different materials, which get packed in a new big texture (for 4 512px diffuse maps u would need a (2*512) * (2*512)= 1024* 1024 texture). now this texture gets into the shader. the next thing to do (in the shader) is scaling ur current uv coordinates down to the coordinates of a single texture in the big one. then u are able to decide which diffuse texture u want to use for this single texel by scaling this uv with a fixed integer (for example multiplying it with (2,3) to get the second horizontal and the third vertical texture). there are some problems with the mipmaps which can be avoided using texture2DLod instead of texture2D (with some tricky calculation for the seams. that article describes a good working method: http://www.gamedev.net/community/forums ... cyear=2008). another problem is that there is no blending in this technique (u will have sharp edges between the single texels - watch the final result in the article mentioned above). depending on how u set the criteria for single materials (heightscale, slope, rgba value of a blendmap) the solution is repeating the procedure and blend the new texel with the old one. if u want to blend more than 2 textures u will have to do it again. but it will get slower the more texture lookups u have for one texel. (a older version of my shader which dealt with 8 texture lookups slowed down my fps from 200 to 50. the new version runs constantly at 150-160).
in my version there will be a package for every terrain tile which consist of a heightmap, a data table for the diffuse-materials and a data table for the connection between diffuse materials and blendmaps. so u will have to generate an atlas texture for the diffuse maps and the blend maps every time u load a new tile. (its not an optimal solution. im currently working on an optimization). if u open a .mpq file of blizzards world of warcraft u can see that they use similar techniques for their terrain (packing blending data, height data etc. together for every small patch). but they also use simple colormaps for geometry far away and use different lods of heightmaps together for the geometry where i dont know how they do it.
a nice article describing many interesting techniques dealing with huge high detailed environments is this one: http://ati.amd.com/developer/SIGGRAPH07 ... stbite.pdf
i hope u could understand my explanation as im not feeling well writing much in english language^^
Paged-editable terrain
Thanks a lot, I will start working on it as soon as I find the huge memory leak generated by Bullet (259 bytes/ frame becomes a lot very fast :p )
For the "popping" you could use a shader to create a "fade" effect, I won't use one since I will use fog and I load a huge area ( 20km diameter ) so I suppose that players won't be able to see the end of the world ^^ just like in real life you will never see a mountain that's far even if the terrain is flat.
I will also add a procedural terrain system for people who want to create huge terrains in a few seconds.
For the "popping" you could use a shader to create a "fade" effect, I won't use one since I will use fog and I load a huge area ( 20km diameter ) so I suppose that players won't be able to see the end of the world ^^ just like in real life you will never see a mountain that's far even if the terrain is flat.
I will also add a procedural terrain system for people who want to create huge terrains in a few seconds.
Update !
Now supports texture splatting and comes with a UI (Qt powered).
Here is the video :
http://www.youtube.com/watch?v=cueoFrDNU4Q
Now supports texture splatting and comes with a UI (Qt powered).
Here is the video :
http://www.youtube.com/watch?v=cueoFrDNU4Q
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
That's cool Yamashi. Really looking nice. But can you save and retrieve the changes?
You're talking that you use bullet to change the terrain geometry. Are you saving the vertices as a data file? Or you are using the vertices position and "bake" the ITexture so it can be saved and retrieved back?
For this I was simply thinking of modifying the ITexture and change it with a bruhs (as we could do in Adobe Protoshop or any other paint tool) and update the terrain from the texture. Then it would be easy to paint the mask for the texturing since they would use the same functions.
You're talking that you use bullet to change the terrain geometry. Are you saving the vertices as a data file? Or you are using the vertices position and "bake" the ITexture so it can be saved and retrieved back?
For this I was simply thinking of modifying the ITexture and change it with a bruhs (as we could do in Adobe Protoshop or any other paint tool) and update the terrain from the texture. Then it would be easy to paint the mask for the texturing since they would use the same functions.
I used to use a heightmap system but it's very limited especially when you want to make caves and irregular geometry.
So I just use a raw file.
The terrain system saves each tile once they are being deleted.
For the textures you should use an alpha map and then texture splatting, it's easier than baking a texture per tile from other textures and I would think that it's faster.
So at first it was the original irrlicht terrain but now I am adding my own loading system for complex geometry and serialization to broadcast the modifications over network.
So I just use a raw file.
The terrain system saves each tile once they are being deleted.
For the textures you should use an alpha map and then texture splatting, it's easier than baking a texture per tile from other textures and I would think that it's faster.
So at first it was the original irrlicht terrain but now I am adding my own loading system for complex geometry and serialization to broadcast the modifications over network.
-
- Posts: 16
- Joined: Thu Jun 15, 2006 8:45 pm