Page 1 of 1

EMT_TRANSPARENT_ADD_COLOR question

Posted: Tue Aug 26, 2008 8:18 am
by Bear_130278
Hello there 8)))
Is there any possibility to make
EMT_TRANSPARENT_ADD_COLOR
to use not the black color as transparent?
I really need it to be vice versa, white transparent and black opaque.

Posted: Tue Aug 26, 2008 8:41 am
by JP
look at IVideoDriver::makeColorKeyTexture().

Then you should be able to use EMT_TRANSPARENT_ALPHA_CHANNEL instead.

Posted: Tue Aug 26, 2008 9:10 am
by Bear_130278
Maybe i need to specify the subject 8))
with EMT_TRANSPARENT_ADD_COLOR i'm getting nice half transparent color effect, that is what i need, but not with white, but with black.

Now i'm trying to play with EMT_TRANSPARENT_ALPHA_CHANNEL and the texture with AC.

Posted: Tue Aug 26, 2008 11:12 am
by jontan6
how about invert the color of ur texture?

Posted: Tue Aug 26, 2008 11:43 am
by torleif
jontan6 wrote:how about invert the color of ur texture?
+1

It's always easier to edit the art files than go hacking around the engine for a function that doesn't really exist.

Paint even has an invert funtion...

Posted: Tue Aug 26, 2008 12:02 pm
by JP
But then it's going to be the wrong colour when rendered isn't it? ;)

Posted: Tue Aug 26, 2008 1:02 pm
by jontan6
sorry, yes it will be different color. but seems difficult... since its add color black should be the transparent :(

Posted: Tue Aug 26, 2008 1:18 pm
by Bear_130278
JP another question.
How can i make a semi-transparency with TAChannel material?
It looks, like it still makes pixels or transparent or opaque.

BTW, i'm still using 1.1 version of the engine... due to my usage of .x files for all geometry.
With 1.3 i can not see any geometry rendered, but meshes are loading, 1.4.1 is not working with my MS VC++ 6.0 8)))

Posted: Wed Aug 27, 2008 9:47 am
by arras
Just provide semitransparent image in png format and use EMT_TRANSPARENT_ALPHA_CHANNEL

Posted: Wed Aug 27, 2008 10:55 am
by Bear_130278
Nah.. i tried it first..
the object is fully opaque, no semi transparency 8((

Posted: Wed Aug 27, 2008 2:00 pm
by arras
You can set alpha of each pixel, so it is possible to get semitransparency.

Posted: Wed Aug 27, 2008 3:46 pm
by Bear_130278
Made it 8)))
Hacked the engine a little bit, with render states 8)))