Fade objects in & out

is it possible to make any arbitrary spatial transluent, no matter what its current alphastate is?

I think there is a gamestate for that (TransitionGameState)… the only prob is that you would have to put your disappearing stuff in that state.

You would need to have some AlphaState set on the object as there's no other way to blend. To make it as consistent as possible, you would probably want to use a MaterialState with the alpha value set somewhere in the colors (not sure but it might work in emission, which is rarely used, try it out).

Can you add an alpha state to it whilst fading, then remove the state and update the scenegraph

the object might already have an alphastate itself (non-opaque blood)

mh :confused: bad

HamsterofDeath said:

the object might already have an alphastate itself (non-opaque blood)
mh :/ bad

That doesn't matter, unless the set alphastate does not use alpha values. If it already has an alpha set then don't do anything.
Momoko_Fan said:

That doesn't matter, unless the set alphastate does not use alpha values. If it already has an alpha set then don't do anything.

Shouldn't that read "unless the AS does not use blending"? For alpha killing, leaving the existing AS could give unexpected results as well.

I bet you could extend AlphaState to create a wrapper AlphaState that bases the resulting AlphaState on values of its child (or children) and the outter alpha state values.  So if it was 0.5f alpha for the child then 1.0f alpha for the wrapper would bet 0.5f and 0.5f for the wrapper would equate to 0.25f…just a thought. :wink:

my idea was to use a pseudo meta alphastate that disabled all childrens alphastates and combines them in itself. there might be contradicting alphastates, but i'll deal with it when the time has come.