Skip to main content
GameDev.net gamedev.net
🔒 Locked

Particle Problems

Started by nes8bit Mar 20, 2000 at 9:04 PM 9 replies 850+ views
Original Post
nes8bit
nes8bit
I have my particle engine running, but D3D does something weird. Some particles are semi-transparent and some aren''t. When the particles have an object that is not a particle then it renders fine. When It doesn''t the particles show their black area. I am using sprites to represent particles and am trying to get round ones. I have a z-buffer. I have the proper renderstates, I think. I was wondering if I have to arrange my sprites using the painters algorithm or something like that. I have looked at other peoples code like The Particle Chamber in D3D and NEHE''s Tutorial in OpenGL.
Spiff
Spiff
What blending modes are you using, D3DBLEND_ONE?

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
Speuger
Speuger
What I usually do is disable z-writes when rendering the particles (leave z-test on). Try using D3DBLEND_ONE for the source and destination blend modes.


-Steve
-Steve
Spiff
Spiff
While we''re still on this topic, there isn''t a good way of controlling the blend values right? Like specify a number between 0 and 100 for how "transparent" the textures appear.

I guess this needs some kind of alpha value, doesn''t it?

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
Lars W.
Lars W.
Hi

There is a way, you can specify an Diffuse Color, that way, you can blend your texture with this diffuse color. The other way is using an Texture with alpha Channel. But with this amnipulating the alpha in runtime is complicated.

Lars
Spiff
Spiff
But I want to blend it with the destination pixel color, nothing else. But maybe I can just specify one alpha value for the whole texture instead of one for every pixel, since I want to have the same blending all over it...

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
nes8bit
nes8bit
Thanks guys. I figured it out anyway. I tried ordering the sprites and noticed that viewing from the side still has the same visual errors and tends to be very slow. Earlier today in math class it just hit me. THE Z-BUFFER!!! I disabled it with d3ddev.setrenderstate...

I am using Speuger''s method by the way.
Keebler
Keebler
FYI, here is my D3D particle system demo with full source.

Particle Chamber

Keeb


Edited by - Keebler on 3/21/00 7:32:29 PM
nes8bit
nes8bit
Hey keeb, you made THE particle chamber? I saw it somewhere and thought it was really really cool. I used some code as a refrence.

Edited by - nes8bit on 3/21/00 8:39:21 PM
Speuger
Speuger
"While we''re still on this topic, there isn''t a good way of controlling the blend values right? Like specify a number between 0 and 100 for how "transparent" the textures appear.
I guess this needs some kind of alpha value, doesn''t it?"

You could specify the transparency in the vertex''s alpha component. Or in the case of the D3DBLEND_ONE for both, you can specify the color - white blends full, falling to black fades the blended polygon from view.

-Steve
-Steve
Keebler
Keebler
nes8bit, yup I wrote Particle Chamber :)

Keeb ( richbenson @ gmail . com )

[Edited by - Keebler on February 12, 2008 2:32:18 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.