Quantcast
Viewing all articles
Browse latest Browse all 6821

Screen cleared when changing RenderTarget(s) on GraphicsDevice (MonoGame 3.6.0.1625)

@SamEleven wrote:

Hi guys,

I was just trying to add some glowing effect to my UI and was wondering, why the background always gets black.
After some graphics debugging and a lot of try & error I found out, that changing the RenderTarget(s) of GraphicsDevice the screen will be cleared. (Appears black, obviously it's transparent, which my graphics debugger showed me.

RenderTargetBinding[] originRenderTargets = GraphicsDevice.GetRenderTargets();
GraphicsDevice.SetRenderTarget(glowRenderTarget[0]);
GraphicsDevice.SetRenderTargets(originRenderTargets);

Removing the second line will cause no changes and my scene is drawn as it should be.
I also tried out, what happens using a RenderTarget object from beginning (e.g. screenshot) and found out that it really doesn't matter, if the originRenderTargets are null or not.

Is this a bug? Or is it just necessary to do it in another way?
In current my project's drawing the UI between setting RenderTarget to glowRenderTarget and Setting it to origin (which used to be null)

System Information:
Windows 10 Pro
MonoGame 3.6.0.1625
Graphics Card:
- Notebook: Intel® HD Graphics 4400
- Tower: NVIDIA Gtx 970

Thanks for helping

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles