[Solved] Coverage Maps

Paulo

19-05-2007 00:41:53

Hi,

I'm using coverage maps for splatting, i have my 4 greyscale alpha maps that i want to combine into the red/green/blue/alpha channels of a png.

Copying 3 of the maps into the red/green/blue channels is easy but how on earth can i copy one of my greyscale alpha maps into the alpha channel :shock:

I've tried everything i can think of in Paint Shop Pro/Photoshop/Gimp ...

Has anyone else got a simple way of doing this?

Jon

19-05-2007 20:55:37

From the Photoshop manual under "Creating an Alpha Channel": you need to create a new channel in your RGB image. From then on, load it like was done for the RGB channels.

I believe only TIFF and TGA support RGBA output.

Paulo

20-05-2007 01:41:05

Hi,

Fantastic, thank you very much that works a treat :)

I will share my idea, which is now working great, i have managed to squeeze out 1 base texture for colour, 12 splat textures, and 1 light map... in 1 pass using shaders.

The system i have used is:

1 base texture that covers the whole page to give colour to the terrain/textures.
12 alpha maps stored in the 4 channels of 3 coverage maps.
12 "detail textures" stored in the 4 channels of 3 splat textures
1 light map

It all fits nicely into 8 texture units and 1 pass, and seems to looks just as good as normal splats.

kungfoomasta

20-05-2007 04:31:45

Wow, 12 splat textures in 1 pass! :shock:

Will you share anything more? :wink:

Jon

20-05-2007 05:45:12

Proof that nobody reads this forum...

http://www.ogre3d.org/phpBB2addons/view ... 328d242829

Paulo

20-05-2007 07:23:02

:lol: I have been reading your posts Jon, but as far as i know that system uses far more resources, is slower to render, works on fewer graphics cards...

Cutter

20-05-2007 13:13:37

@Paulo: That sounds great, can you post screenshots and code? :D

@Jon: I also read your post, but can`t imagine a great benefit. Thinking of terrain materials I consider myself to be a noob, so I didn`t want to give a senseless answer, though.

Jon

20-05-2007 15:20:57

One pass, one shader, and the textures must be loaded. Two texture lookups in that pass. All for up to 256 textures.

How is that more resources, or slower to render? And I don't see how it limits the video cards, vs 8 shaders. But each to their own.

kungfoomasta

21-05-2007 18:28:46

Sorry Jon, I visit many forums and there are a lot of threads that I overlook. I guess I should just do a search next time instead of being supportive and showing interest. :P

You're somewhat right that these forums don't have so much activity. I only glance at this forum since I don't actually use the PLSM2 plugin.

Guess I'll go back to lurk mode for these forums.

Paulo

22-05-2007 16:22:53

Hi,

Must admit Jon it does sound interesting, i am totally new to shaders (this is the first time i've tried anything with shaders, im mainly just modding other peoples code) i was persuming because you are using volume textures the shader code would be more complex than usual, hense slower to render.

Resource wise i ment the fact im using detail textures, which means i can store 4 textures in 1 2d rgba dds.

Another plus point is im finding detail textures more versatile than normal textures because the actual colour comes from the base texture, which means a simple grass texture can have different types/shades of green blending over the surface, it really helps to get rid of the tiling effect and single textures can be used in different ways.

Compatibility, i was presuming again :oops: i wonder when volume textures became standard, would they be a problem on some cards?

Q. Would it be possible to use detail textures with index splatting, your 16 texture would turn into 64.

Q. With index splatting do you get the nice blends/mixing of textures that you get with alpha splatting? if not this would be a BIG downside.

As for my system i will post some screenshots and all the shader code once i get it 100%

Paulo

22-05-2007 21:33:19

Here are some screen shots, this is the "demoterrain2" from pnp terrain editor loaded into my engine, its not at all optimized for the detail splats but it still looks OK.

www.peslauncher.com/Image1.jpg
www.peslauncher.com/Image2.jpg
www.peslauncher.com/Image3.jpg

Jon

23-05-2007 04:26:10

Nice screenshots Paulo. Having real textures and applying them sure beats my color gradient.

I am kinda tied up with this paging problem I mentioned in another post, but will try to respond to your post for a few minutes.

I don't think the shader code is that much more complex than the splat5 code, but will post it when I've finished testing and folks can decide for themselves.

Your detail textures are indeed using less texture memory than my volume texture. But the texture memory usage hasn't been an issue for me yet. I suppose there is no reason why both regular textures and detail textures couldn't be used by the same shader program in the future.

As for the standardization of volume textures, perhaps someone else can chime in here. I was under the impression that ps_20 standardized these, and I am assuming :oops: that the vast majority of installed cards will soon support ps_20 or greater. If that becomes an issue, one can flatten the volume to a 2d texture and have a max of 64 256x256 texture in a 2kx2k tiling.

Q. Would it be possible to use detail textures with index splatting, your 16 texture would turn into 64.

The current implementation does not do this. But I can see where it would be possible. The 16 texture image was just a test case, the actual limit is 256 (ie 8-bit index), which would turn into 1024. I imagine that 256 will keep *me* happy for a bit.


Q. With index splatting do you get the nice blends/mixing of textures that you get with alpha splatting? if not this would be a BIG downside.


Yes, however I'm still working on that. The index texture provides for two 8-bit texture indexes and two 8-bit alpha values in a single RGBA value per vertex. This is using one texture unit for the index, and one for the volume of up to 256 textures. Allocation of additional texture units for more splats would be trivial.

Cutter

23-05-2007 15:05:16

One pass, one shader, and the textures must be loaded. Two texture lookups in that pass. All for up to 256 textures.

I must have missed the "up to" part :( So I thought you wanted to use all those 256 Textures, which didn`t sound very reasonable^^

Now this is truly great and I`m looking forward to your enhancement to the existing scene managers :D

Paulo

23-05-2007 16:20:28

But I can see where it would be possible. The 16 texture image was just a test case, the actual limit is 256 (ie 8-bit index), which would turn into 1024. I imagine that 256 will keep *me* happy for a bit.

Yeah i realised that you can go up to 256, but i thought you had settled on 16 because of memory.

With my implementation i'm forced to the 12 detail textures if i want one pass, restrictions are never a good thing... so i would love to see your code.

It sounds like with your implementation the the decision to use detail textures would be more personal preference (do i want to squeeze more into the same memory? / do i want to increase the resolution of the textures and use details instead... etc)

As for the paging issues, i have the same problems... it seems PLSM doesnt page very well :S maybe its an Einhort problem, for instance if i use 3x3 or more pages it really starts to cause problems, it crashes after a while under direct3d.

It's typical that all this time people have been stuck using 4 splats and then two alternatives come along at once :lol:

deficite

23-05-2007 18:26:33

From the Photoshop manual under "Creating an Alpha Channel": you need to create a new channel in your RGB image. From then on, load it like was done for the RGB channels.

I believe only TIFF and TGA support RGBA output.


I didn't read the whole post, but I just wanted to point out that PNG supports alpha too.