Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neonstar

funky alpha fading problem

This topic is 6193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

howdy folks, I''m trying to do various alpha fades in my game engine, such as fading a big quad over the screen for screen fades and fading enemies out when they die. it works, but i have this funky effect during the fade. when i decrement the alpha level in the D3DCOLOR variables of the vertices, the fade goes down as it should to zero, but the visual of the effect seems to jump right to zero around 100 or below. this makes the fade look really crappy cause it fades and then all of a sudden dissapears. for the screen fade-ins, it makes the screen fade in a bit and then pop right into view. anyone know how i could fix this problem? am i just going about it the wrong way? ah, also: i was playing black and white yesterday and i noticed something cool about their screen fades. there seems to be some kind of diamond pattern that appears on the screen, but you can''t really see it. it just blends things better, i guess. i''m assuming that it''s mip-mapping or dithering in effect for a stretched logo or something... thoughts? anyway, i''d appreciate any help here cause i''m winding down to the loosely tenative publisher demo release date and i''d love to have things looking amazing thanks, and happy holidays, dave -- david@neonstar.net neonstar entertainment

Share this post


Link to post
Share on other sites
Advertisement
basically all i''m doing is using a D3DCOLOR_RGBA variable and feeding it a decremented alpha value to do the fade effect. i''ll decrement the alpha level every 300 or so milliseconds to get the desired effect, but it gives that little jump around 100 A. and if i wasn''t clear enough, i''m decrementing like (255, 255, 255, 255) to (255, 255, 255, 0). well, that would be for a screen fade in, but you get the idea.

hope that helped.

dave

--
david@neonstar.net
neonstar entertainment

Share this post


Link to post
Share on other sites
Remember... it''s ARGB, not RGBA. Also, It should work fine. It''s kinda hard to tell what''s wrong without the code.

Share this post


Link to post
Share on other sites
are you sure, cause when I use RGBA, the alpha component works partially. whatever, though, i''ll take your advice and see how it turns out. if it works, i''ve got a lot of code changing to do.... ugh.

thanks,
dave

--
david@neonstar.net
neonstar entertainment

Share this post


Link to post
Share on other sites
nope, didn''t fix it, i''ve still got the little jump goin on. the fade works nicely to a point, but then it takes a jump right to the extreme to which i''m fading to (0 or 255).

any other ideas? maybe there''s some alpha flag i set wrong?

dave

--
david@neonstar.net
neonstar entertainment

Share this post


Link to post
Share on other sites
G''day!

That sounds really odd. Have you tried it on the Reference rasterizer to see if it''s a driver bug?

What are your texture stage states set to?

If you set the alpha to 100 manually does it still disappear?


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
aha, figured it out. apparently i just had to change this:

m_D3DD->SetRenderState(D3DRS_ALPHAREF, 0x7F);

to this:

m_D3DD->SetRenderState(D3DRS_ALPHAREF, 0x00);

i knew it had to be a renderstate

thanks,
dave


--
david@neonstar.net
neonstar entertainment

Share this post


Link to post
Share on other sites
apparently you are using alpha testing somewhere, since alpharef should default to 0 (and alpha testing default is allow all pixels).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!