polycode different renderers [sugestion]

  1. last year

    Since polycode has OpenGL at the moment and will be getting es 2.0 in the future. Would it be better to have different renderers for what ever platform you are building to? Like for instance if it is a windows game then it will use DirectX and OpenGL for Linux and mac and es 2.0 for mobile.

  2. fodinabor

    6 Jul 2015 Administrator

    actually I think: yes. But it is ~3 times the work to maintain all 3 renderers.
    Another problem is that you will need to write your shaders in both: GLSL and HLSL..
    So I think for performance and integrity it would be nicer to have different renderers but it will be by far more work for us ("the polycode team") and for someone who wants to write a cross-platform app..
    well I know there are GLSL to HLSL converters but I don't know whether there exists something we could include into polycode..

  3. Maybe in the future Polycode could do this When more people are willing to help with Polycode. There is also a GL2DX wrapper but i don't know if it is still relevant since it looks like it hasn't been worked on for a few years.

  4. Would it be alright if i gave a shot at the DirectX renderer for windows? I would like to try.

  5. I have a directx 11 renderer that i made. I would like to test and see if i can get it up and running with polycode. I am looking at the PolyWin32Core.cpp file to do this. I was looking at the Win32Core constructor and saw that the variable renderer is was initializes the openglrenderer is it as simple as replacing that with the initialization of my directx renderer? It sounds a little to simple to be true.

  6. fodinabor

    9 Aug 2015 Administrator

    hey..
    I personally really would wait for the renderer rewrite to be finished or already look at how thinks work at https://github.com/ivansafrin/Polycode/tree/new_renderer
    It should make some things easier (I've been told ;))

  7. Ivan

    9 Aug 2015 Administrator

    Hey hey!

    So two things. One is you should use the new renderer infrastructure if you want to implement a DX11 renderer. The branch that is now the main development branch for that is "goodbye_cmake".

    https://github.com/ivansafrin/Polycode/tree/goodbye_cmake

    As you can tell by the name, this branch is also restructuring the entire Polycode repo to make it easier to work with across platforms and getting rid of CMake altogether.

    The other thing is that I am writing a DX12 renderer for the new UWP core that's going to be part of the new rewrite, though that will likely stay UWP-only! It would be nice to have a general DX11 renderer for win32 apps as well!

  8. Ivan

    9 Aug 2015 Administrator

    Also, in the new renderer structure, to implement a new renderer, you have to implement the GraphicsInterface class and initialize it in the Core. Look at the CocoaCore implementation and how it's handled there.

    You can see its virtual skeleton here:
    https://github.com/ivansafrin/Polycode/blob/goodbye_cmake/include/polycode/core/PolyRenderer.h

    As far as shaders go, yes, you would need to reimplement all the shaders in HLSL until we have some sort of shader compiler. All of the old Polycode shaders are being rewritten to work with the new OpenGL ES2 renderer anyway though, so I will most likely write HLSL versions of them too for the DX12 renderer.

  9. Sweet!
    I will look into that and see if i can get directx 11 running with polycode this week. With time permitted.

  10. Ivan

    9 Aug 2015 Administrator

    Actually the only issue is that the win32 core hasn't been updated to work with the new system yet. There are a couple of new virtual methods that the Core has to implement, as well as registering FileProvider sources (look at CocoaCore once again).

  11. fodinabor

    13 Aug 2015 Administrator

    Is createRenderContext defined in the source anywhere?!

  12. 8 months ago

    Hello!
    Is there any news on this topic?

    I'm planning to cross-grade from OGRE3D and D3D support is highly important to me, since the app I'm working on uses WPF frontend. The only way to do a smooth integration, I'm aware of, is to use D3D's offscreen render surface.

  13. fodinabor

    21 Oct 2016 Administrator

    nope, afaik there are no plans to to integrate DirectX in the near future.

 

or Sign Up to reply!