Alpha blending Question and some screenshots from my particle engine
Screenshots have gone offline due to hosts bandwidth limit sorry!
[Edited by - Bitem2k on July 30, 2005 3:05:10 PM]
Quote:Original post by Bitem2kDoes anyone know how to load a smoke texture in direct3d? When i try and load it (black on a white background) the alpha blending (i think) seems to be
removing the wrong colour! Does this having anything to do with settings the blend modes?
Yeah, it is probably your blend modes. Someone around here probably knows what blend modes you need...(I am at school and don't have any of my source handy).
Before anyone can help I think it would be helpful if you at least showed us the part where you are setting your alpha blending mode. For smoke you likely do not want an additive blend (which is probably what you have set for these particles you are showing above) since you don't want to make the smoke look like its glowing. Would you consider using a texture format like targa and creating an alpha channel for the smoke. Its easy enough to make -- just create your smoke texture and clone the same image into the alpha channel. You will need to set D3DRS_SRCBLEND and D3DRS_DESTBLEND to the appropriate values. It should be
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA);
(correct me if I'm wrong -- I don't have my source with me atm). In any case it should be something like that.
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA);
(correct me if I'm wrong -- I don't have my source with me atm). In any case it should be something like that.
Thanks for your replies.
I have created a tga file in photoshop and set an alpha channel. I have changed my blend modes as suggested however still no luck!
here is the tga file i have created.
I have created a tga file in photoshop and set an alpha channel. I have changed my blend modes as suggested however still no luck!
here is the tga file i have created.
Could you post the result, as well as the exact settings?
Your textures are cool, post them if you may.
Quote:If anyone's intrested i'll post the source and textures
Your textures are cool, post them if you may.
Ive just got home from work(The time is 05.21 GMT ,now i need a beer and much much sleep!) I will post project and textures asap ( however as stated before this code is horrendous! you have been warned.)
Also before i post i need to implement an easy way for you to change the texture used for the point sprite particle, at the moment you have to hardcode it.
As for the exact settings for the screenshots, i cant help you! you must experiment with my test particle engine yourself ( the screenshots are a product of about 2 mins fiddling; which is good fun anyway.
The final screenshot from my last post is the window that allows you to control the particles dynamically( so a change to a slider will be updated in realtime(cool!))
Id say Ill try and post it tommorow(today! when I wake up, anyway), and ill start a new thread for it and post a link in this one, ok?.
Also before i post i need to implement an easy way for you to change the texture used for the point sprite particle, at the moment you have to hardcode it.
As for the exact settings for the screenshots, i cant help you! you must experiment with my test particle engine yourself ( the screenshots are a product of about 2 mins fiddling; which is good fun anyway.
The final screenshot from my last post is the window that allows you to control the particles dynamically( so a change to a slider will be updated in realtime(cool!))
Id say Ill try and post it tommorow(today! when I wake up, anyway), and ill start a new thread for it and post a link in this one, ok?.
I can't help you here (I haven't worked with DX for long), but I just wanted to say that those particle effects are very cool looking IMO. Great job!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement