Sign in to follow this  

Additive composition & D3DXVec3Project()

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

This topic is 4302 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this