Blood particle problems - Bad antialiasing when rotating a sprite
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
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 :)
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).
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).
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.
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement