1
\$\begingroup\$

Lets just assume I have some simple OpenGL ES 2.0 code that renders a box with depth writing / testing. Is it possible to put this box in a middle of a Direct3D11 scene using angle?

The MS angle page https://github.com/Microsoft/angle/wiki/Interop-with-other-DirectX-code says that we can render to a texture, and I have tried that and it works fine. But this only allows for 2D integration, not 3D integration, as far as I can tell. I render my OpenGLES content to a texture (in 2d or 3d), but now I can only put a texture in the DirectX scene. How can I have my OpenGL ES code write / read from the same depth/color surface that the DirectX11 portion is using?

\$\endgroup\$
  • \$\begingroup\$ This question doesn't really make sense - content is not dependent on the API. \$\endgroup\$ – Maximus Minimus Aug 24 '17 at 15:36
  • \$\begingroup\$ updated the question. Removed "content" and replaced with "API" calls. \$\endgroup\$ – default Aug 24 '17 at 15:41
  • \$\begingroup\$ What do you mean with 'this only allows for 2D integration'? You can use buffers or textures that contain your depth and color data, calculated and set using DirectX, and use these in your OpenGL ES code. If you are thinking about injecting generated hlsl to your shaders, this would probably not work with ANGLE. Please be more specific or better yet show an example of what you are trying to accomplish. \$\endgroup\$ – George Hanna Aug 31 '17 at 8:03
  • \$\begingroup\$ As an example, lets say there is a Directx11 Engine that provides hooks for arbitrary render code to be executed at the end of a frame. I want to be able to insert some content into the scene, respecting the existing scene depth buffer, using OpenGL ES / Angle. \$\endgroup\$ – default Aug 31 '17 at 12:37
  • \$\begingroup\$ As I wrote previously, it is possible for you to render all the data you need to textures or buffers and use this on the other end to add your content... \$\endgroup\$ – George Hanna Aug 31 '17 at 13:17
2
+50
\$\begingroup\$

It would be possible to render to textures from either the ANGLE or Direct3D and then using that texture to produce the final content that is inserted in the FBO that is drawn on the screen.

Read more here: ANGLE Interop with other DirectX code

Since ANGLE is basically just translating your OpenGL ES calls to DirectX the answer should be: Yes it is possible.

But it all depends on the engine you're using.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.