separate glowmap?

Just one question concerning performance:

I have a lightmapped shader that uses the alpha component of the lightmap texture for the glow post effect solely.

Is it better to have a separate Set Texture command that loads a smaller sized alpha texture (I could also use a grayscale image and import that one as alpha) for the glow effect?

The background is: my lightmaps are pretty big (2048x2048px) and consequently the alpha channel would possibly be too high-res for some glow that’s blurry anyways.

So what’s better: an additional high-res alpha channel in the lightmap or another SetTexture with only a small alpha texture?

If additional texture would make the lightmap’s alpha channel unused - then no, there would be no performance gains.

Lightmaps are most often not DXT compressed, hence they are RGBA. So there’s a spare alpha channel sitting there just waiting to be used… Note that none of graphics cards internally support RGB textures, so even in RGB case there’s still (unused) alpha channel sitting in the video memory.

Uh? Good to know that…

Just to get you right:
What are the RGB texture import options for? Just to explicitly exclude the alpha channel of the texture?

Yes. Also to possibly save some space in the datafile (not sure how much that saves in practice after the webplayer compression, for example).

In photoshop you can have more than one alpha channel It seems. Is there a possibile/good way to use that channel in a unity shader? Say you had an RGBA with 2 alpha channels, and the shader was a diffuse detail, with one alpha the detail, and another a mask for example?

As opposed to 2 textures?

I know this is pie in the sky stuff, but I was just curious, It may be a completely ridiculous idea for all I know…
AaronC

37800--1424--$picture_49_741.png

i’m not sure but i imagine because unity flattens compresses PSD files on export - to use another layer it’d have to make a separate image anyway - so you wouldn’t gain anything over just having a separate texture.

No. There’s no graphics hardware that supports 5 channel textures for example (RGB + two A). Graphics cards most often support four channel textures, DXT compressed textures, and in some cases two- or one-channel textures.