Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Is Geometry Shader supported in Unity3D?

Discussion in 'Editor & General Support' started by dormouse, Mar 1, 2011.

  1. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    72
    hello geeks

    I would like to know whether geometry shader can be used in Unity3D? like GLSL, some GPU programming...
    is there any tutorial based on this topic?

    use Cg snippets or others? Anyone try with Geometry shader like OpenGL 3.2 or 4.0?
    Does it work in Unity3D...if this is supported i should be coool...


    Thanks~
    Dormouse
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No

    Unity supports only up to Shader Model 3. (OpenGL 2.1 as thats the highest what OSX supports, DX9 on windows)
     
  3. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    72
    A geometry shader is supported in Direct3D 10 and in OpenGL 3.2 (or OpenGL 1.1 using the EXT_geometry_shader4 extension).

    Does Unity3D support EXT_geometry_shader4 extension???
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No
    Only Pixel Shader and Vertex shader

    Unity uses DirectX9 on windows which makes it SM3 max (and I'm unsure if OSX would support this extension)
     
  5. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    72
    OK~~

    Thanks a lot
    ~ dreamora~
     
  6. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    72
    Can we use OpenGL instead of DirectX9 in Unity3D? like in other 3D engine, we can change the Render device..
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You can enforce it for the client through the -opengl command line argument
    but it does not impact the supported functionality at all, its still the same limits. You are just exposed to more good hope that the drivers are not trash.

    The only case where it reallly makes a difference if is you write a plugin which you don't want to port to both APIs.
    just be aware that the editor on windows is ALWAYS directx, you can't force opengl, nor can you force it for the webplayer
     
  8. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    72
    Ok, thanks all the same, because I want to program on GPU with Geometry Shader...
    It seems that Direct9 supported Unity3D could not achieve that...OK~~~~~
    Mayby, in the future Unity3D will support Dx10 and shader model 4 which has geometry shader..
    thanks dreamora
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Fully understand you, wouldn't mind seeing DX10+ support myself, be it just for the sake of performance on deferred and AA in deferred
     
  10. Dan-the-Man383

    Dan-the-Man383

    Joined:
    May 24, 2011
    Posts:
    23
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You are like weeks to late
    Unity 4 will support DX11 and in consequence pretty surely also geometry shader (domain, hull and compute shaders were already mentioned)

    On DX9 / OpenGL 2.1 there is no such thing so keep that in mind as it means Windows PC with Vista+
     
  12. Dan-the-Man383

    Dan-the-Man383

    Joined:
    May 24, 2011
    Posts:
    23
    No way man! That's awesome! So it will support tessellation too, I assume.

    Will all that work on OpenGL too?

    What about a programmable pipeline?
     
    Last edited: Jul 2, 2012
  13. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No it will not work with OpenGL.
    Its Windows Vista+ exclusive (ie where DX11 is available).

    Aras mentioned that there are currently no plans to bring it to OpenGL as OSX has no OpenGL 4 which would be the DX11 counterpart and required to go there. As a matter of fact, not even the stuff thats part of OpenGL 3.2 does work fully yet on OSX.

    And yupp tessellation is gonna become possible from what mentioned if you can write the shaders for it (unless I missunderstood him, its possible that no inbuilt support for it might happen due to the various different algorithms and users needs for one or the other)

    Not sure what you mean about programmable pipeline, but you could write shaders for the programmable pipeline (pixel - vertex shaders) since Unity 1.x some small eternity ago


    If you mean ComputeShaders then thats a thing that so far was not mentioned yet either but that does not mean anything as just the 'hype graphical stuff' was asked so far.
     
    Last edited: Jul 3, 2012
unityunity