Sign in to follow this  

multiple render targets with different blending op

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

I want to render to 2 render targets at the same time

the first RenderTarget will have this blending op:      ValueAlredyInPixel*NewValue + NewValue

the second RenderTarget will have this blending op: ValueAlredyInPixel + NewValue

The documentation in how to create a blend state is telling me that i can't do this kind of different blendings OP on different render targets, can I?

 

Now when rendering to the second render target I will always set NewValue to 1

So you will think that I could just use the blending OP used in the first render target because:

(ValueAlredyInPixel*1.0f+ 1.0f) = (ValueAlredyInPixel + 1.0f)

but the problem is that the format of the second render target is 8 UNORM per pixel, so to render NewValue=1(in 8 bit UNORM format)=0.00392f(in 32 bit FLOAT format)...so I will have to render:

(ValueAlredyInPixel*0.00392f+ *0.00392f) .....................  0.00392f = 1/255 

 

Will this 0.00392f value be tranformed to 1 before the blending operation takes place?

 

So will ValueAlredyInPixel*NewValue + NewValue work in the second render target?

Edited by lomateron

Share this post


Link to post
Share on other sites

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