Terrain texture with alpha image

I am trying to get my world to have painted sidewalks.  I have run into a few problems.  It seems I cannot get my images to work.  I am using "sidewalk.jpg" as a texture and using "sidewalk_alpha.png" as the alpha image.  Both images are attached.



Here is part of the original code from jmetest.terrain.TestIsland:


196        TextureState ts5 = createSplatTextureState(
197                "jmetest/data/texture/terrain/road.jpg",
198                "jmetest/data/texture/terrain/roadalpha.png");




Here is what I tried to change too see if my texture worked:


196        TextureState ts5 = createSplatTextureState(
197                "vtour/data/terrain/sidewalk.jpg",
198                "jmetest/data/texture/terrain/roadalpha.png");


It just displayed not and where it should be the terrain says "MISSING TEXTURE"

This is the more important part.  Here what I changed to see if my alpha image worked:


196        TextureState ts5 = createSplatTextureState(
197                "jmetest/data/texture/terrain/road.jpg",
198                "vtour/data/terrain/sidewalk_alpha.png");


It was like the alpha image was completely transparent because the entire terrain was my the road.jpg texture.

If a texture is missing, it uses a missingtexture picture.  This is also true for any alpha maps.  MissingTexture has 0 alpha at every pixel, which is why you're seeing your road everywhere.



Check your file names and locations.  If it's loading missingtexture instead of yours, it means you probably have them under a different directory, name, or extension.

Thanks,



sometimes you need someone to point out the obvious.  I feel so dumb.

Shard said:

MissingTexture has 0 alpha at every pixel

Maybe we should change that? It would certainly have helped ggreve in this case to spot the problem.
Is somebody with good enough image editing skills reading this and willing and able to change the missing texture image to display it's text opaque?

It's already all opaque.  I'm sure he meant that the alpha is 255 at even pixel.

renanse said:

It's already all opaque.  I'm sure he meant that the alpha is 255 at even pixel.

I don't really object to the 0 or 255 part, but rather the "at every pixel" part.
The texture should be easier to identify when used as alpha map if the writing on it would be reflected in the alpha channel as well, not only the color channels.

I always get confused between 0 and 1 (or 0 and 255) in alpha, i just code something and if it doesnt work, switch it lol.



Anyone with GIMP can easily change the red (pink) color channel to an alpha layer.