Masked and Alpha Texture disappears when fullscreen

Blitz3D Forums/Blitz3D Programming/Masked and Alpha Texture disappears when fullscreen

yinch(Posted 2003) [#1]
Hi,

I have a Texture which is created at runtime and then applied to an entity to produce a mask (in conjunction with another texture)

I works in windowed mode but not in full-screen mode.

thoughts?

yinch'03


yinch(Posted 2003) [#2]
Just to add to the information.

1. That texture's masking works if I load a texture (instead of generate it)

2. The masking doesn't work if I do draw operations directly to the texturebuffer - I have to draw it in the backbuffer and copy it over

3. Other masking textures (loaded ones) are working in the same scene.

yinch'03


yinch(Posted 2003) [#3]
Ok this is for anyone else who comes across this problem.
The explanation is as follows:

When in windowed mode, the 'ink' as set by the Color command has an Alpha component - so when you write to a buffer, it also sets the alpha component of that pixel.

For some reason, the behaviour changes when running in Full-Screen mode. The ink doesn't affect the alpha component.

My fix was to use a read/writepixelfast to scan the texture for black pixels and writing the alpha component directly.

that's all.


yinch'03


BlackJumper(Posted 2003) [#4]
We need more of these posts... someone who has a problem, elaborates the problem, then solves the problem with no other input.

Just thought I would chip in to show that posts do get noticed ;-)