Texture Alpha

Blitz3D Forums/Blitz3D Programming/Texture Alpha

EmerGki(Posted 2007) [#1]
Have some way to me control the transparency of one texture directly in Blitz3D?


Pinete(Posted 2007) [#2]
yes, I suppose you are refering to texture splatting technique..
There exist some docs in the forums, just search for "terrain" or "vertex alpha".
you can find also the code of FLE in the code archives, a terrain editor that uses vertex alpha to make what you want.


regards


EmerGki(Posted 2007) [#3]
Hi Pinete, isn't this... What I want is: Make the texture transparent for use in Sphere map... So, I need control the oppacity of the texture.


Pinete(Posted 2007) [#4]
Hi,
As far as I know the alpha level of a texture can be modified from a painting tool but not in real time... You can modify the alpha level of an entity, but not a texture.
Maybe some of the experts of this forums can be more helpful for you... :/

regards


EmerGki(Posted 2007) [#5]
Thank you Pinete, I know that the texture can be modified from a painting program, but, In my case, I'm using a texture created in real time, this is the motive what I need to modify the alpha level in real time...


Look this image, here I'm using a Cube Map, but, My car appear like a chromed, but, the initial texture is White.



Regards


jfk EO-11110(Posted 2007) [#6]
Hi. Looks nice.

There are several Alpha options:

Texel Alpha channel (requires texture flag 2)
Brush Alpha
Entity Alpha

(EDIT: btw there's also Vertex Alpha, but this may cause troubles when your vertices are welded/optimized. It also requires to go trough all vertices (by surface handle) and set the color and alpha of the vertices. It allows to set the transparency of each Vertex individually, but is somewhat slower and more complicated than the BrushAlpha solution.

I think in your case you would best use Brush Alpha on the surfaces (usually defined by one texture) that need to be transparent.

writing to the texturebuffer, modifying the alpha Byte of the ARGB texels is very slow due to the bottleneck between Graphicscard and Ram. Additionally, if you don't use the flag 256, then the entire texture must be reuploaded to Vram each time you access it, therefor is't way to slow to be used without flag 256. At the other hand, if you use flag 256 then mipmapping will be disabled an it may look too "corny" for a chrome thing.

Anyway, using Brush Alpha is probably the easiest and most effective way. If your texture was loaded with the car mesh then you may have to track down the surfaces by the names of the textures they use (as explained in the original SaveB3D example in the archives)

Then you can use somethng simple as:
BrushAlpha brush,alpha#
BTW, I never tested this with cubemapping.