Splatting Techniques and Editing

Falagard

20-03-2006 22:57:39

I'm looking at Splatting2Edit and Splatting7Edit trying to figure out what's going on in the splatting code.

Splatting2Edit looks like this:

It splats 4 textures and does a render pass per texture.
Each pass also has its own alpha texture.

Splatting7Edit splats 4 textures in a single pass but requires support for 7 texture units. Three alpha textures are required.

The rest of the splatting techniques I'm not sure of, but they don't have edit modes yet.

My questions are as follows:

I was under the impression that splatting2edit was being done in a single pass, but I was wrong, at least as far as I can tell. I also thought that the editing was modifying channels in a single alpha texture, but in fact it's modifying 4 different alpha textures, right?

Do we have a technique that can be used with only 4 texture units in a single pass for 3 texture splats, where 3 textures are used + a 4th texture that has the alpha textures in two of its channels, and a pixel shader that can render this?

If so, to have an "edit" mode that worked I'd need to be able to modify individual channels of a single alpha texture.

Assuming I allow the user to paint the splatting textures, do we have a way of creating a single merged texture that can be used on older cards? I know that MapSplitter has some code for creating a base texture, but this is slightly different because I'm taking a bunch of textures that are already split and wanting to create a merged base texture. Also, I would hope that this merged texture code be used for distant pages instead of using a pixel shader on those distant pages, so it has to look the same as the pixel shaded version of the terrain.

I think I mentioned this before, but I believe the best way to do this would be to render to texture the pixel shaded version and then just save that out as a merged texture.

This kinda brings up another question - let's say I've already split up my terrain into pages, then I do things like modify the terrain using morphing. Now I want to generate a normal map for the terrain, or do something else that the map splitter does on a single large map. Can I do this using the map splitter on already split textures? I assume the answer is yes - I would just pass it each page individually and set it up not to split, just to generate a normal map, or whatever.

Thoughts on all of this?

To recap - here are my questions:

1. Is there a splatting technique that can work with 4 texture units in a single pass.

2. Am I right about my investigations regarding the splatting techniques currently using multiple alpha textures?

3. A merged texture that can be used both on low end machines and on distant pages.

4. Map splitter used on already split pages.

Clay

tuan kuranes

21-03-2006 09:22:10

In fact it's modifying 4 different alpha textures, right?
Yes, as all alpha factor sum should always equal one, you cannot change just one.


Do we have a technique that can be used with only 4 texture units in a single pass for 3 texture splats, where 3 textures are used + a 4th texture that has the alpha textures in two of its channels, and a pixel shader that can render this?

"SplattingShader" does this, "alpha" are in Coverage files.
Do you want an edit mode on SplattingShader ?

If so, to have an "edit" mode that worked I'd need to be able to modify individual channels of a single alpha texture.

you mean breaking the "sum(alpha) == 1.0f" law ?

Assuming I allow the user to paint the splatting textures, do we have a way of creating a single merged texture that can be used on older cards? ... be used for distant pages ...

InstantBaseMaterial is the base material edit, just have to merge the edit part with splatting shader ?

I think I mentioned this before, but I believe the best way to do this would be to render to texture the pixel shaded version and then just save that out as a merged texture.
that could be tried.

Can I do this using the map splitter on already split textures?
Idea would be to queue all page modified on a session, and at session End deform others "TextureMode" textures use would choose (alpha, coverage and base), alongs with regenerating needed map.

So recap is :

1. yes
2. yes, but don't forget the Law.
3. BaseTexture does this, not sure if a "rendered pixel shader" shot would give better results, but that could be tried.
4. Todo. (Next Mapsplitter version should anyway work on splitted heightmap to make it possible to split VeryHuge map, without killing host Swap file.)

Falagard

21-03-2006 23:47:24

Thanks for the answers.


In fact it's modifying 4 different alpha textures, right?

Yes, as all alpha factor sum should always equal one, you cannot change just one.


That's not what I meant. I know that it modifies all 4 textures, not just one, because it adds to one and subtracts from the others. I'm just saying that it does use 4 separate textures instead of 1.


you mean breaking the "sum(alpha) == 1.0f" law ?


Again, I mean that currently it uses 4 different alpha textures. Alpha[PageX][PageZ]1.png, Alpha[PageX][PageZ]2.png, Alpha[PageX][PageZ]3.png, and Alpha[PageX][PageZ]4.png for for each page, instead of using a single alpha[PageX][PageZ].png and modify R,G,B and A channels within a single texture.

Right?

Anyways, I'm thinking that I'll allow the user to paint only 4 textures per page and use the current Splatting2Edit code for now, and then maybe have a post process that will convert it into a coverage map for the SplattingShader, and a BaseTexture at the same time.

tuan kuranes

22-03-2006 09:07:19

Ok, misunderstood.
The 1 textures instead of 4 separated is indeed the Coverage[PageX][PageZ].png which is used by "splattingShader"

Anonymous

23-03-2006 02:45:37

Now I want to generate a normal map for the terrain.
A bit off-topic, but have you ever seen normal mapping done well on outdoor terrain before? We were curious as to the possibility, of defining fine detail on terrain using normal maps but were worried of the "plastic" effect you often get with it. Haven't had a chance to delve into it yet, so I thought I'd ask. :wink:

tuan kuranes

23-03-2006 12:25:20

A bit off-topic, but have you ever seen normal mapping done well on outdoor terrain before?
yes but not alone
- with detail normal splatting (look at "far cry" sand splat.)
- with atmosphere scattering. (look at "instanbaseshadowed" texture mode)

tuan kuranes

23-03-2006 12:25:56

@ Falagard : CVS will soon have a splattingShaderEdit. (coverage editing.)

Falagard

23-03-2006 20:09:40

Okay cool I'll keep that in mind, sounds great.

tuan kuranes

23-03-2006 20:38:52

it's in cvs and sdk now.