DX11 render to texture issue...

Started by
12 comments, last by Hodgman 9 years, 12 months ago

The issue started with the initial render texture, so all the other passes compounded the problem. I narrowed it down by displaying that first render texture as if it was the last "composite" texture. Let me say it another way: When I was trying to find the problem, I took out EVERYTHING except the first render texture and ONLY displayed it by rendering it as a sprite to the backbuffer.

Rendering the image as a sprite has no blending because the image has an alpha of 1.0...... Not to mention, the issue wasn't present in the rest of the image, just the quads that had the transparency. When I render all the objects(including the transparent ones) to a texture, blending occurs where appropriate. After that, the objects are no longer rendered-- it's just a texture that I apply to a quad.

Advertisement

took out EVERYTHING except the first render texture and ONLY displayed it by rendering it as a sprite to the backbuffer.

Rendering the image as a sprite has no blending because the image has an alpha of 1.0......

It won't have an alpha of 1 in each pixel if you've rendered objects who's alpha is less than 1 into it. You need to set a blend state with blending disabled.
What blend state is active when you render this sprite?

There is a solid object in the background (a plane) with a texture using alpha of 1.0f. The objects (with the transparency) are rendered on top and therefore each pixel they affect is "blended" according to the blend state. The final pixel may or may not have some transparency (due to the blend state). This is the whole reason I posted my problem. I don't know what blend states to use to make it work for both render methods and therefore I tried different ones until I could get two different ones to work-- one for each phase of rendering. All I am asking is "is there a single blend state method that will work for both RTT and render to back buffer?".....


All I am asking is "is there a single blend state method that will work for both RTT and render to back buffer?".....
Yes, there is no difference between the back buffer and RTT (every render-target works the same way), so your problem is elsewhere.

With back-buffer:

Set back-buffer as render-target

Set blend mode

Draw scene

With RTT:

Set texture as render-target

set blend mode

Draw scene

SET NEW BLEND STATE (ensure blending is disabled)

Set back-buffer as render-target

Draw quad using texture

With your RTT method, are you doing the bolded step?

This topic is closed to new replies.

Advertisement