Jump to content
  • Advertisement
Sign in to follow this  
bartiss

Additive composition & D3DXVec3Project()

This topic is 4522 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, I've just added some lens flares to my game, but Ihave 2 problems: 1. The effects seem to be rendered as multiplied with framebuffer and I would like it to add. How do I do it? 2. I use D3DXVec3Project() to get flare location in screen-space. But the location is projected in both directions, so I have two flares oposing each other. What do I have to do to project from one direction only? Thanks Bartiss

Share this post


Link to post
Share on other sites
Advertisement
Have you got a screenshot?

I believe this simply boils down to you setting a different texture for the one that you don't want to be visible, typically one that is completely transparent.

Dave

Share this post


Link to post
Share on other sites
Quote:
Original post by bartiss
1. The effects seem to be rendered as multiplied with framebuffer and I would like it to add. How do I do it?
Your D3DRS_SRCBLEND and D3DRS_DESTBLEND render states control this part. Changing them both to D3DBLEND_ONE should give you additive blending. Check out the various D3DBLEND enumerations - try them and see which one you like [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Which part of question did you answer? (1 or 2)

I don't have any screenshots here (at work :) ) Taking a screenshot of two opposing sunflares would be quite a challenge ;)

But I don't know if you got me right. I am not changing textures (and I don't want to)

I want an additive render and I am not using any shaders (yes, I know, I'll learn to use them next week ;-) ) so I need some old-fashioned SetRenderState() :)

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!