Terrain splatting, deforming and painting?

viblo2

09-08-2006 00:05:58

I have a couple of questions regaring plsm2 and splatting, deforming and painting. I cant get them to work correct (if it is at all possible): The plan is to have realtime deformations, realtime painting and finally have the realtime deformations affect the terrain splatting (raise some ground -> might turn to snow). Is this a realistic goal? If so:
1. Terrain painting. From the wiki and a couple of posts here, it seems like you need to set the TextureFormat to *Edit, e.g. SplattingShaderEdit. But then I get assertion failed on line 364 in OgrePagingLandScapeTexture.cpp. I guess it must be something simple Ive missed?
2. Deformation works ok, but it doesnt affect the splatting. I have tried most TextureFormats (except *Edit, see 1.). Is it possible to have them affect splatting?
3. Lets say I want to write my own shader, can I just take PLSplattingShaderLit and work from there, or are there any special magic thats needed?

I have tried the latest version of plsm2 from CVS. I use PyOgre, so I have created a small wrapper for plsm2, but I don't think this should affect anything? The code for painting is:

color = [0.0, 1.0, 0.0, 1.0]
r = plsm2.realVector()
for i in color:
r.append(i)
sceneManager.setPaintChannelValues( r )
sceneManager.setBrush(self.paintBrush)
sceneManager.setPaintCenter( v )

where setBrush sets the brush w/h and then setBrushArray, and the others are direct wrappers of thier Option equivalent, i.e. setOption("PaintChannelValues", p).

It feels like I have missed something very simple.. anyone got a clue?

PatrickB3

11-08-2006 23:56:30

Make sure you're .cfg has

TextureModifiable=yes

Also only one value should be 1.0 and that should be the one for the layer you are painting.

tuan kuranes

21-08-2006 20:18:34

I migh add :

1. Edit texture mode are no more valid/required. Sorry, I 'll update the wiki asap.

2. makes sure both .gen.cfg and .cfg uses same heights values.

3. yes, no other magic.

OvermindDL1

22-08-2006 15:44:56

I don't suppose that in PLSM3 you could do away with the seperate .cfg and .gen.cfg files and combine them into one? Although I'll just be plugging in everything manually since you say it will support delegates then. I tend to generate everything on the fly since there just would not be enough storage space otherwise... :)

tuan kuranes

22-08-2006 16:04:32

I don't suppose that in PLSM3 you could do away with the seperate .cfg and .gen.cfg files and combine them into one
That's the plan.

viblo2

22-08-2006 18:10:25

Aha, that explains it! :)