alpha splatting sample
-
- Gnoblar
- Posts: 4
- Joined: Wed Jun 09, 2004 6:24 am
- Location: Atlanta, GA USA
alpha splatting sample
For those interested in experimenting with terrain alpha-splatting, I have a small sample package online. You can get it at
http://edgarapoe.home.mindspring.com/qu ... atting.zip
It mainly includes a couple of materials for Ogre's terrain plug-in (OctreeSceneManager). If you are unfamiliar with alpha splatting, in short it is an efficient method for making terrain meshes appear more varied and detailed using high resolution textures. Charles Bloom has a fine explanation at his website http://www.cbloom.com.
This is meant only to be a quick introduction to one way to do alpha-splatting. There are other, and likely much better, ways of doing alpha-splatting. For instance, I notice that the most recent version of the PagingLandscape plugin uses splatting, which appears to be generated programmatically, although I have not thoroughly investigated it. In the end, if you want alpha-splatting, it will be necessary to somehow generate the alpha splats according to your needs.
The alpha_splat_test.material contains two techniques: alpha_splat_test_1_pass, which applies 4 textures (+ 3 alpha splat masks ) in one pass; and alpha_splat_test_4_pass, which applies 4 textures (+ 3 alpha splat masks ) in 4 passes.
Instructions:
I am assuming you have the latest (June 2004) cvs version of the terrain in OctreeSceneManager.
1) Put the textures including the alpha masks in your texture directory
2) Put the alpha_splat_test.material in your material directory
3) Put terrain.cfg in your working directory, or modify your current one with the last line referencing the desired material. I.e.,
CustomMaterialName=alpha_splat_test_1_pass
Good Luck!
http://edgarapoe.home.mindspring.com/qu ... atting.zip
It mainly includes a couple of materials for Ogre's terrain plug-in (OctreeSceneManager). If you are unfamiliar with alpha splatting, in short it is an efficient method for making terrain meshes appear more varied and detailed using high resolution textures. Charles Bloom has a fine explanation at his website http://www.cbloom.com.
This is meant only to be a quick introduction to one way to do alpha-splatting. There are other, and likely much better, ways of doing alpha-splatting. For instance, I notice that the most recent version of the PagingLandscape plugin uses splatting, which appears to be generated programmatically, although I have not thoroughly investigated it. In the end, if you want alpha-splatting, it will be necessary to somehow generate the alpha splats according to your needs.
The alpha_splat_test.material contains two techniques: alpha_splat_test_1_pass, which applies 4 textures (+ 3 alpha splat masks ) in one pass; and alpha_splat_test_4_pass, which applies 4 textures (+ 3 alpha splat masks ) in 4 passes.
Instructions:
I am assuming you have the latest (June 2004) cvs version of the terrain in OctreeSceneManager.
1) Put the textures including the alpha masks in your texture directory
2) Put the alpha_splat_test.material in your material directory
3) Put terrain.cfg in your working directory, or modify your current one with the last line referencing the desired material. I.e.,
CustomMaterialName=alpha_splat_test_1_pass
Good Luck!
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
You dude! This was something on my list to do, although I don't actually need it for the project I'm working on right now so I might not have got around to it.
I haven't downloaded yet, do you also do the single-texture approximation in the distance, which can also serve as the base texture (Bloom mentions this in his paper)?
I haven't downloaded yet, do you also do the single-texture approximation in the distance, which can also serve as the base texture (Bloom mentions this in his paper)?
- houssem_bdioui
- Kobold
- Posts: 31
- Joined: Tue May 11, 2004 8:09 am
- Location: Tunisia
- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
- leedgitar
- OGRE Community Helper
- Posts: 61
- Joined: Wed Jan 22, 2003 1:58 am
- Location: Baltimore, MD
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Hehe.
Well, you obviously know it involves enhancing the standard terrain manager, but beyond that I can't elaborate. It's a bit of commercial work, I'll be back on Ogre full time (well, full time of my part time) at the beginning of August. In the meantime I'm largely just doing bugfixes on Ogre except for things that naturally make their way back here from that work. And answering all your persistent questions, of course.
Well, you obviously know it involves enhancing the standard terrain manager, but beyond that I can't elaborate. It's a bit of commercial work, I'll be back on Ogre full time (well, full time of my part time) at the beginning of August. In the meantime I'm largely just doing bugfixes on Ogre except for things that naturally make their way back here from that work. And answering all your persistent questions, of course.
-
- Gnoblar
- Posts: 4
- Joined: Wed Jun 09, 2004 6:24 am
- Location: Atlanta, GA USA
I'm glad I could help carry some weight, if true.
I have not implemented "single-texture approximation" for Ogre (indeed, I've only added materials). In my pre-Ogre engine, remnants of which are still visible at http://edgarapoe.home.mindspring.com/qu ... ixotic.htm, I had attempted to collapse layers into a base texture for distance, but I could never get it to look right without gobs of fog. Instead, I decided to fade out a few layers for very distant pieces, which gained a few frames per second.
Note, again, that the PagingLandscape plugin does some "single-texture approximation" and maybe the excellent programmers there can help, but I think their method is still heavily dependent on fog--which I personally have grown to dislike intensely.
I have not implemented "single-texture approximation" for Ogre (indeed, I've only added materials). In my pre-Ogre engine, remnants of which are still visible at http://edgarapoe.home.mindspring.com/qu ... ixotic.htm, I had attempted to collapse layers into a base texture for distance, but I could never get it to look right without gobs of fog. Instead, I decided to fade out a few layers for very distant pieces, which gained a few frames per second.
Note, again, that the PagingLandscape plugin does some "single-texture approximation" and maybe the excellent programmers there can help, but I think their method is still heavily dependent on fog--which I personally have grown to dislike intensely.
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
Here is the tool we use for paginglandscape2 :
http://tuan.kuranes.free.fr/paginglandscape2.zip
(not yet in ogreaddons cvs)
There is surely some common code for the 2 scene manager
It can generates the alpha maps you need for splatting.
(and much more... normal maps, lightmaps, pvs, etc...)
In the plugin there is now multiple ways of splatting, all with a lod distance that use a single texture (base texture) in distance. Try splatting2, splatting3, etc...
If your scale is not too high, you can use the Colormap generated (though it need some work too, to scale the splats texture...)
Check the source code or the thread for more info.
http://tuan.kuranes.free.fr/paginglandscape2.zip
(not yet in ogreaddons cvs)
There is surely some common code for the 2 scene manager
It can generates the alpha maps you need for splatting.
(and much more... normal maps, lightmaps, pvs, etc...)
In the plugin there is now multiple ways of splatting, all with a lod distance that use a single texture (base texture) in distance. Try splatting2, splatting3, etc...
If your scale is not too high, you can use the Colormap generated (though it need some work too, to scale the splats texture...)
Check the source code or the thread for more info.
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
Here's one with shadows,
generated with mappsplitter.
(should be unzipped on the poe's zip data )
http://tuan.kuranes.free.fr/alphasplat.zip
It even has the single texture approximation using lod_distance, but doesn't seems to work.
(Lightmap data could go into RGB data of the "alpha splatting map", therefore be used with a color_op_ex modulate... and save all passes that it added. ( and finally uses all bits of 32 bits alpha splatting maps))
generated with mappsplitter.
(should be unzipped on the poe's zip data )
http://tuan.kuranes.free.fr/alphasplat.zip
It even has the single texture approximation using lod_distance, but doesn't seems to work.
(Lightmap data could go into RGB data of the "alpha splatting map", therefore be used with a color_op_ex modulate... and save all passes that it added. ( and finally uses all bits of 32 bits alpha splatting maps))
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
Zip updated with the lightmap idea.
http://tuan.kuranes.free.fr/alphasplat.zip
So same number of TU and number of pass, but lighted.
( this one also updated with generation of "alphasplatlightmap" http://tuan.kuranes.free.fr/paginglandscape2.zip)
Opengl doesn't give any result with those material files...
http://tuan.kuranes.free.fr/alphasplat.zip
So same number of TU and number of pass, but lighted.
( this one also updated with generation of "alphasplatlightmap" http://tuan.kuranes.free.fr/paginglandscape2.zip)
Opengl doesn't give any result with those material files...
- spookyboo
- Silver Sponsor
- Posts: 1141
- Joined: Tue Jul 06, 2004 5:57 am
- x 151
- Contact:
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
- spookyboo
- Silver Sponsor
- Posts: 1141
- Joined: Tue Jul 06, 2004 5:57 am
- x 151
- Contact:
- spookyboo
- Silver Sponsor
- Posts: 1141
- Joined: Tue Jul 06, 2004 5:57 am
- x 151
- Contact:
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
- Falagard
- OGRE Retired Moderator
- Posts: 2060
- Joined: Thu Feb 26, 2004 12:11 am
- Location: Toronto, Canada
- x 3
- Contact:
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am