Jump to content
  • Advertisement
Sign in to follow this  
lomateron

multiple render targets with different blending op

This topic is 1761 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
Advertisement
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!