Sign in to follow this  
lomateron

multiple render targets with different blending op

Recommended Posts

lomateron    491

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

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