Drawing to RenderTargets on MacOSX

Howdie folks, I’m hoping someone can give me some pointers here. I’ve been scouring the interwebs and plunder through trail after trial in code but have no progress.

I’m on a mac trying to test out rendertargerts but not getting much success. I’m using DesktopGL at the moment and im trying to draw a texture to a render target and then draw the render target to the screen.

Code look something like this:

My target instantiation looks like this:

_target1 = new RenderTarget2D(_gameManager.Game.GraphicsDevice, _screen.Width, _screen.Height, false, SurfaceFormat.Color, DepthFormat.Depth24);

When I run the program I get a black screen.

Is there any feedback on rendertargets in general on Mac using DesktopGL ? Is a use case like this supposed work ?

Thank you in advance.

If you clear the rendertarget with full red, do you still see a black screen when rendering it to the backbuffer ?
And what is the render2 effect supposed to do ?

Does it work when you render the vertices to the back buffer?

trying out some more changes does not seem to work still. I change the clear to red and this is what I get:

You can see the code in the background, if I clear with red then the display is red

@JJagg, if I render to the back buffer its works great. In fact anything render to back buffer on Mac is cool. Its just with RenderTarget, seem to have issues:

This for example works fine:

I moved on from the above and tried rendertargets out on iOS targeting my iPad. After some playing around I kinda got rendertargets working on my iPad device but had to do some strange stuff in my Draw call and make one of the SamplerStates methods public. I’m not sure if this is feasible though or maybe a bug or incorrect implementaion somewhere, some info on how the switching of rendertargets / activation occurs here will be helpful to understand why the below is needed to get it to work.

It feels like this should be happing in Monogame somewhere- SetRenderTarget or on ApplyState somewhere and not happening in Draw.
The lines above are what I had to add to get the rendertargets to work on iPad. The change involved setting the Graphics Texture[0] and Texture[1] explicitly to the targets. Then I make GraphicsDevice.SamplerStates.PlatformSetSamplers public and call into it before using the targets in my shaders.

This seems to make render targets usable in subsequent shaders for iPad. It could be related to some order / incorrect activation of textures when using render targets but I’m am not sure. Any folks that can shed some light on whats happening here, why I’d need to do this to get my targets usable in shaders and if there is correct way or workaround I can use without making PlatformSetSamplers public ?