splatting7.material error

gedimaster

30-10-2005 01:44:51

hi, in splatting7.material, the base texture is commented out, when i tried uncommenting it and using a valid texture, the program crashed with exception at:

function:image:load
description: unable to load image 'none' - invalid extension

i didn't use any other image but exactly the same texture used in texture unit that is just below it i.e. splatting_sand.jpg

1. why is base texture commented out in the first place?

2. it was explained in the wiki that alpha masks are used, but where are the alpha textures?

tuan kuranes

30-10-2005 04:33:34

uncommenting won't work as it make all texture unit position to change in texture unit array when accesed in plsm2 texture mode object.

1. Doesn't change that much rendering.
2. The "none" textures are replaced at runtime by masks. (see splatting7 texturemode object code.). those mask are generated in mapsplitter and stored with splitted maps as map.alpha.tu.x.z.png

gedimaster

30-10-2005 07:33:03

1. so for splatting7, does it mean it's actually 3 textures and 3 masks in 1 pass?

2. what is the generation of masks by the mapsplitter based on? the supplied colormap? if so, the colormap has rgba channels, so there shd be 4 masks right?

3. what if i'd like to have 4 textures and 4 masks?

tuan kuranes

30-10-2005 07:43:35

1. yes
2. based on height and slope of terrain (slope is rock texture)
3. you make a multipass or you have the card that support 8 TU.

gedimaster

30-10-2005 09:27:50

2.how we tweak the mask generation ?

3. how can I make a 6 texture + 6 mask splatting ?

4. How I can I add that to plsm2 ?

[edited by tk : sorry edited your post instead of replying]

tuan kuranes

30-10-2005 09:37:16

2.height => scale in config files and slope parameters => check mapsplatter.cpp around line 370 in mapsplitter sources.

3. 0-7 TU are the actual boundaries for all cards, no ?
Besides I recall that Oge has a define in OgreConfig.h or something about max TU.

Check your card in the database or using glinfo from here http://www.delphi3d.net/hardware/index.php

4. write a material file and a texturemode object that you add to plsm2.

gedimaster

30-10-2005 15:24:09

2. how can i tag a certain height range to a certain texture? scale in conf file is only a number. same question for slope...

3. recent cards can support 16 TUs. my question is again if i have my own masks, how can i specify in the shader?

4. ok

tuan kuranes

30-10-2005 16:29:11

2. for height it's in config file .gen.cfg or .cfg for dynamic masks

#
# Splatting
# We are allowing 4 textures to build the terrain texture
# MaterialHeight to change alpha weights ( using percentage )
MaterialHeight1=12
MaterialHeight2=50


in percentage.

But that does limit at 4 mask resulting. (MaterialHeight1)
you would have to patch mapsplatter.cpp around line 370 to make it work with 6 mask, and therefore

3. splatting7 is without shader, but in a shader you would just access it like other textures, but reusing same texture coordinates.

Jon

30-10-2005 21:37:14



#
# Splatting
# We are allowing 4 textures to build the terrain texture
# MaterialHeight to change alpha weights ( using percentage )
MaterialHeight1=12
MaterialHeight2=50


I haven't taken the time to look at the code for this yet, but have looked through the wiki and forums without finding a better explaination. What does the above mean?

If I have four textures (SplatFilename0-3), I expected to provide four thresholds. But there are two material heights listed?

Best guess comes up short: SplatFilename0 from 0%-12%, SplatFilename1 from 12%-50%, SplatFilename2 from 50%-100%. Hmm, that isn't correct.

Now I see these SplattingMaterial files in the plugin directory (hmm, Cg programs with splatting :) ) and they appear to have the same names as various TextureModes.

tuan kuranes

31-10-2005 08:23:08

Best guess comes up short: SplatFilename0 from 0%-12%, SplatFilename1 from 12%-50%, SplatFilename2 from 50%-100%.
Good guess.

Have in mind that It compute an interpolation valure between heights.
With heights[indx] > height > heights[indx- 1]


interpol = (height - heights[indx - 1]) / (heights[indx] - heights[indx- 1]);

Then we get 4 splat maps.

gedimaster

31-10-2005 12:49:54

apart from height, can we use custom alpha masks - e.g. swamp lands, dirt tracks?

tuan kuranes

31-10-2005 13:04:56

Just have to replace those generated by yours.

Next mappsplitter version will have option to split user mask too (was requested).

Jon

31-10-2005 17:17:23



interpol = (height - heights[indx - 1]) / (heights[indx] - heights[indx- 1]);

Then we get 4 splat maps.


Please forgive me if I'm being dense...
How does this tie in with the two Material heights in the .gen.cfg file?

I am still stuck on the idea that somewhere one determines that all heights below x% will have a particular texture, perhaps this is where I am going wrong.

tuan kuranes

03-11-2005 09:06:43

How does this tie in with the two Material heights in the .gen.cfg file?

height[0]= 0
height[1]= Material heights[0]
height[2]= Material heights[1]
height[4]= maxTerrainheight

one determines that all heights below x% will have a particular texture, perhaps this is where I am going wrong.
if you mean, that one of the four splat texture will only be a exact height texture enabled, then it might be. other will be an interpolation between two texture.