Splatting my brains out

HexiDave

11-06-2006 20:47:19

I don't think I've ever had a lot of luck getting the different MapSplitter modes to work - it usually crashes whenever I throw it anything besides heightmaps and textures. I use L3DT to create my maps and it does a fine job of giving me textures, heightfields, etc, but I'm trying to use the alpha maps for splatting.

I have had absolutely no luck.

I have a Radeon 9600 Pro, up to date graphics drivers and no issues with anything I currently run, OGRE included. However, I simply cannot find a way to do any sort of splatting using the alpha map(s) produced from L3DT.

Whether it's:

1 Alpha map, 32 bit (RGBA) ; 1 channel for each splatting texture

4 Alpha maps, 8-bit for each splatting texture

Letting MapSplitter try to create the Base, Coverage, Alpha, Light maps

None of them work - with the pre-made alpha maps from L3DT I get "unsupported" error messages and with letting MapSplitter create maps (I'm using almost identical settings from the Alpha.gen.cfg file, which split fine itself) it always crashes the splitter with no message in the log.

I fail to see why my hardware would not support any of the splatting modes as I can run WoW, HL2, Doom 3, etc without so much as a hiccup - so I have to assume it's a setting problem. The only difference between the Alpha.gen.cfg file and mine is that mine is a PNG.

How am I to use 4 splatting textures? Can I possibly get a functional splitter and/or terrain config file that uses a PNG, supports either 1 Alpha map with 4 channels or 4 Alpha maps with 1 channel each that can run on a Radeon 9600 Pro? I'm just totally confused by the different modes and what they require and how best to shift the settings over from L3DT to my project without essentially reinventing the wheel.

tuan kuranes

12-06-2006 08:21:24

CVS, SDK ?

1 Alpha map, 32 bit (RGBA) ; 1 channel for each splatting texture

Called here coverage map, usable with SplattingShader texture mode only, that you can split with mapsplitter if you name it as a color texture in the .gen.cfg.

1 Alpha map, 32 bit (RGBA) ; 1 channel for each splatting texture

should be splittable and viewable (splatting2, splatting4, splatting6, splatting7)

Letting MapSplitter try to create the Base, Coverage, Alpha, Light maps
You don't need to generate coverage and alpha if you provided them, you need to split them.

Each texture mode is described on the wiki page, along with all option for each cfg files, here's a .gen.cfg that splits heightmap, coverage map and 4 alpha maps.

LandScapeFileName=myfilename
HeightMap=yes
TextureStretchFactor=1

ColorMapName=mycoverage.png
ColorMapSplit=yes
OutDirectory=LandScapeFileName

NumSplatMapToSplit=4
SplatMapName0=myalpha0.png
SplatMapName1=myalpha1.png
SplatMapName2=myalpha2.png
SplatMapName3=myalpha3 .png

HexiDave

12-06-2006 17:09:43

Alright, I got it working now - I was under the impression that NumMatHeightSplat=4 was used for another mode, so I hadn't included it - also assumed it would read splat textures directly from the .material file.

Is there a way in the config file to tell it to go directly to the .material file for splat texture names and information instead of the .cfg file? This way I can change the UV scale of the textures on the terrain - currently they're oversized and blurry. If not, I'll find it in code.

Appriciate the help, as always.

tuan kuranes

13-06-2006 13:38:29

NumMatHeightSplat=4 is used in .gen.cfg for generating base maps mainly.
in .cfg it's used for realtime terrain modification or so.

if "splat texture" are not the alpha or coverage textures but the colored texture to splat (like splatting_sand.png), they're specified in the cfg file and their parameters (uv scale) are in material files.

HexiDave

14-06-2006 19:26:34

Well the splatting works fine, but I still have no scaling. I've tried in both the SplattingMaterialShaderDecompress and SplattingMaterialShader, tried with both compression on and off and put
texture_unit
{
texture splatting_sand.png
scale 0.005 0.005 //<-- Here
tex_address_mode mirror
}


The scale doesn't have any effect, so I'm thinking I may need to change the program to do it manually. Is that the wrong command to use in the material file (SplattingShader.material in the scripts folder)? I'm using the SplattingShader technique with my own splat images, but they just won't scale for me.

Any help would be appriciated.

Falagard

14-06-2006 19:29:24

Scaling isn't passed through to the shader yet, the fixed function scaling (which you're doing when you set texture scale in the material) doesn't work in shaders.

To fix it, change the hard coded values in the shader, or change the shader to accept scale values for each splat texture and pass them through params from the material.

HexiDave

14-06-2006 20:30:44

Ah, ok. I was starting to get confused as I just changed the plugin code to adjust scale and that didn't work either :P

Thanks - off to adjust some more code. :)

EDIT: Ha, 2 minutes of work and it's good to go now... Occam's Razor?

Falagard

14-06-2006 20:58:34

Occam's razor dude. Always. :-D