L3DT users' community
Large 3D terrain generator

splatmaps exporting

Got a problem or need advice?

splatmaps exporting

Postby creat326 » Tue Mar 01, 2011 10:14 pm

Hi

I was checking the docs and I'm sure it's possible but I can't find it.

I can easily export the splatmap alpha texture. I get it no problem as a png.
What I don't get is the mix of the other textures. For instance, I create a splatmap with only 2 channels. So I put the 9 textures of the terrain in only 2 channels.
When I export the splatmap, I get only 1 png: the alpha. Then an xml that explains that channel 1, has x, y, z png textures in there, and that channel 2, has a,b,c

But I don't want those 9 textures separately, I want a single texture with the combination. So channel 1 textures (all the grass!) should be in one png. And channel 2 textures (all the sand) should be in a different png. Grouped together.

How can I get these 2 textures out of the combination of the alpha ids?
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: splatmaps exporting

Postby Aaron » Wed Mar 02, 2011 10:22 am

Hi Creat326,

Alpha splatting uses one channel per texture layer, so each channel in the alpha map must represent a separate texture layer. Thus, so if you want to have, say, four grass textures, you'll need to have one layer for each (how else could it be done?) Anyway, if you want grass grouped together in one RGBA image, you'll need to assign your grass layers to layer IDs of 1 through 4, or 5 through 8, etc. Does this make sense?

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: splatmaps exporting

Postby creat326 » Wed Mar 02, 2011 10:38 am

Maybe I explained myself wrong.

Yes, I group together by id... from 1 to 4 and from 5 to 8. So it creates 2 groups.
I export the alpha, and it will have those 2 groups on the alpha.

The problem that I have is with the 8 textures. I also want to combine them but I don't know how. When I export the alpha it generates only 1 png with the alpha channel. I was expecting 2 additional pngs: 1 with the first group of textures combined, and a second one with the second group of textures combined.

I don't see those. I only see the alpha splatmap.
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: splatmaps exporting

Postby creat326 » Wed Mar 02, 2011 11:33 am

so the question is... how do I generate those 2 png with the textures?
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: splatmaps exporting

Postby Aaron » Wed Mar 02, 2011 12:04 pm

Hi Creat326,

What it sounds like is that you've set all the grass layers to the same layer ID (1, I assume), and all the other layers to another ID (i.e. 2). If so, this is incorrect, and will result in only two channels in a single RGBA output map. If you want a layer to be separate in the output alpha map, you have to give it a separate layer ID that is not used by another layer. When you used the 'combine alpha layers' wizard, be sure to give your grass layers a different layer ID, going from 1 to 4, and the other land types separate layer IDs going from 5 to 8. Layers 1-4 go into the first image, 5-8 the second, 9-12 the third, etc.

If you do this, the wizard should look like this:

alpha_wizard.png
alpha_wizard.png (64.41 KiB) Viewed 12669 times

(my map had only 3 grass types, so I've padded the top four out with sand in the #4 slot)

Does this make sense?

If I've still got this wrong, can you please send me the XML file exported with your alpha maps. This will clarify the situation immensely*.






Now, once we've got past that hurdle, the next issue is that the RGBA alpha maps might appear all black and transparent in other image viewers/editors, like so:

RGBA_alpha_is_opacity.png
RGBA_alpha_is_opacity.png (76.16 KiB) Viewed 12669 times


Basically, this is a problem between how the alpha channel is used in splat maps and how it is interpreted by image editing programs. In most image viewing/editing programs, the alpha channel is interpreted as opacity, so alpha values of 0 are transparent and 255 are opaque. This is correct for viewing normal alpha-masked images, but back-to-front for viewing splat maps, where you need to interpret the alpha channel as transparency to view it properly. Consequently, in most image viewing/editing programs an RGBA alpha map will look like a combination of only black (RGBA = 0, 0, 0, 255) and transparency (RGBA = X, Y, Z, 0, where X, Y and Z may be non-zero). However, even though the transparent sections look empty, they contain valid RGB values that are present and correct. In short, these files are fine if you use them for texture splatting, but you can't easily view them in non-splatting programs. If you want to check their contents, re-import the the RGBA images into L3DT as a new map layer of type 'RGBA colour'. If you do this, you should see a result like like this:

RGBA_alpha_is_trasparency.png
RGBA_alpha_is_trasparency.png (171.71 KiB) Viewed 12669 times


This is the same alpha map as the previous example, but here it's been interpreted with alpha meaning transparency, not opacity. L3DT displays RGBA splat maps correctly because it assumes, by default, that the alpha channel means transparency. The down-side is that it doesn't display 'normal' RGBA masked images correctly by default. To switch alpha opacity/transparency modes, you can use the 'View->Display effects->RGBA alpha means opacity' option.

Cheers,
Aaron.

* no pun intended.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: splatmaps exporting

Postby Telarus » Wed Mar 02, 2011 11:47 pm

Aaaah, so that's how the combine Alpha Layers Wizard works. Thanks.
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am


Return to Help and support

Who is online

Users browsing this forum: No registered users and 13 guests