Just reporting some strange behaviour, it made me go " ", but maybe that’s the way it works…
I was testing some clouds textures and I came up with this:
The texture I’m using:
On a plane used as a alpha texture:
On a plane used as a alpha texture, with a pure white diffuse 32x32 texture:
On a plane used as a alpha texture, with a pure white diffuse 256x256 texture:
Is this all normal? Is is the way it should work?
afaik alpha values are defined as
i guess calling them “opacy” or “inverse transparency” map makes more sense to the brain. but thats the way it’s working , i guess*
[size=75]*(if i’m not totaly messing things up)[/size]
The thing is that when no other maps are there I get black where there’s no transparency, when I use a color/diffuse texture in a different resolution it looks like the alpha map is also being downcast to that res.
well for the black color with no texture. i could imagine, i dont know for sure but it might be.
loading a new texture creates an image inside your ram.
the texture is read and written into the ram-image.
to prevent old garbage-data in the ram to show up as texture, the ram-image is most likely cleared (and it looks like it’s cleared using zeros)
so the texture would be all black by default. if you now load an alpha image. that wont magically turn your black ram texture into something else.
about the resolution thing… simmilar thing might happen. thought i could imagine this behaviour is changeable. with 2 different input resolutions but only one output res. there are only 2 coices. upscale the low-res one. or downscale the high-res one. looks like the later one is default.
just in case you want to use different resolution textures. this is possible using texture-stages and combine modes.
I’d expect that when there’s no texture than vertex color would be used.
As far as the texture size goes… I just wanted to use a smaller one because it takes less memory to load. I’ll just make them all the same if I’m using transparency and leave texture-stages until the next time I’ll be doing terrain
Did you load the alpha map as second argument to loader.loadTexture? Then it’s size is probably adjusted to match the color texture’s.
If you don’t want that behavior, you should create an additional texture stage which performs the blending.
The best way i round is just to create the proper texture in apps like gimp, this way you know how it looks before you get it in to the system and it works same in game.
Didn’t use loader.loadTexture at all. I’ve added it in my modelling software.
I’ve actually made it with GIMP (well ok, maybe “made” is not the right word, I’ve found it an the net, made it grayscale and seamless) and it is (more or less) the way I wanted it. The third screen is what I wanted to have in the first place, I was just surprised that my two first shots at this were… well glancing shots.