Idea: q3map_alphaImage


(Shaderman) #1

Hi mates :smiley:

I got this idea while doing some alphamod experiments over the last days. My target was to make some shaders for simple terrain blending while trying to re-use some very nice looking and existing (ET) textures. Problem: Most textures (in ET) don’t have an alpha channel :confused: Possible solution: I could add an alpha channel to thoses textures and put them in my pk3. But there are two things I don’t like: First I think, modifying and re-using existing textures of a game isn’t legal and secondly it would unnecessarily inrease the pk3 size because the RGB channels of a TGA need to be packed in my pk3, even if they’re existing in the game.

Every channel in a TGA seems to use 256kb. This means 768kb (RGB channels) need to be packed again in my pk3 for each texture, even if they’re already accessible :confused: Ok, the size seems to be reduced by about 50-60% when being ZIP- compressed, but there are still ~300k wasted for a single texture, blowing up the pk3.

My idea is to leave alone the original game texture (not offending any license and saving some kb/mb) and work with an additional greyscale TGA for the alpha channel which must be added / used with the original texture in some way. I searched for a way to realize this and found q3map_lightImage doing something similar:

You can even use a light image with a different alpha channel for blurrier alpha shadows.

This keyword seems to require a full RGB (+alpha) image and won’t help here. But I think it should be technical possible to use existing textures with a separate alpha channel image (greyscale TGA (or even JPG?)), only using 256kb (compressed ~100kb) for alphamod and other purposes with an additional q3map- keyword like ā€œq3map_alphaImageā€, putting the original texture and the alpha image together.

What do you think of this idea? If it seems to be useful and possible, I’d like to rename this idea and call it feature request :wink:


(nUllSkillZ) #2

Great idea.
I’ve had some similar thoughts after reading sock’s article.

Hmm, would be great if it would also be possible to use the RGB (the red- or the green- or the blue- or an average-value) as alpha.
May be with some kind of factor (brighten / darken).
So you haven’t got to add any new texture to you’re pk3.


(ratty redemption) #3

on topic: I concur, this is an excellent idea, as I too have been copying the original games rgb channels and making my own alpha channels (for the same game) …although Im also making some rock textures from scratch but they wont be for public release, as their going in my demo project.

off topic: I havent posted in hear for a while as Im still recovering from my recent op, which is taking longer to heal then I anticipated and seems to of sapped my energy so Im sleeping a lot, although my vision is pretty good so Im not complaining :slight_smile:

kind of back on topic: and when I am working, I`m slowly producing a couple of et and ja sample maps of various terrain and water sections, including their brush work, shaders and textures.

some of which have been updated with sock and ydnar`s excellent dp2 and alpha volume blending method, although using my own shaders.

I`ll release these when their ready, although probably without any documentation… someone else can do that :wink:

but it`s less confusing to learn then the previous methods of alpha volume decal blending (overlapping brushes with polygonoffset shaders) I was demonstrating a while back …so anyone who can understands socks article on terrain blending should be able to work with my sample maps.