Jump to content
  • Advertisement
Sign in to follow this  
UBrothers

Blood particle problems - Bad antialiasing when rotating a sprite

This topic is 4493 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

Hi all, i am rendering all sprites (and particles also) in my game using ID3DXSprite interface of DirectX9 and I have this problem. I am trying to create green blood particle effects, so i have solid green color sprites of blood particles of different sizes and shapes and i am drawing (using scale and rotation) a lot of these little blood sprites in one location of the screen and I want to blend all sprites together (that no edge of single sprite can be seen), but if i use rotation or scale, then sprite edges are automaticaly antialiased (blured) and this causes that my blood particles are not smoothly blended. Here is the screenshot of my problem: I want to get rid of these edges of each particle Maybe my problem can be solved by setting some render state by using SetRenderState, but i do not know which. Thanx for your help

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Your problem is that you have black in your color channel where the alpha is zero. You need the green color to extend outwards a bit. Easiest way for you would be to simply fill your color channel with pure green and leave the alpha as-is :)

Share this post


Link to post
Share on other sites
What colour are the transparent (alpha < 100%) parts of your texture?

The colour of the transparent/semi-transparent texels should be roughly the same as the colour of the opaque texels. This is true even if you're simply trying to use alpha-test/colour-key, since texture filtering will sample in neighbouring texels (such as those neighbouring the ones outside the edge of your blood splat pattern).

Share this post


Link to post
Share on other sites
Thank you very much guys. That sounds very good. It is true, that i have black color around all blood sprites, i will try to make it green. I will let you know the result.

Share this post


Link to post
Share on other sites
An alternative, which is often better, is to draw the sprites green-on-black, and then blend them using pre-multiplied alpha. This means that your SRCBLEND is ONE and your DESTBLEND is INVSRCALPHA. It turns out that pre-multiplied alpha is actually more mathematically correct when doing multiple stages of blending. Plus you can use it to create particles that "add light" to a scene, by painting colors with no alpha (which ends up doing additive blending).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!