Search Unity

Geometry Shader in Dx11 does not behave as expected.

Discussion in 'Shaders' started by Noisecrime, Apr 27, 2016.

  1. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    Hi,

    I'm hoping that some of you might be able to help out test a small project that does not behave correctly in Dx11. I've reported it as a bug to Unity, but they have been unable to reproduce. I've since updated my drivers and still the issue persists.

    The project is very simple, it renders a unity cube with a geometry shader. The geometry shader takes triangles as input and outputs the edges as lines, essentially then the desired appearance would be that of a wireframe. Though this is just a stripped down version of a more complex shader to illustrate the issue, I'm not looking for a solution to display a wireframe.

    Unfortunately in all the versions of Unity i've tested ( 5.2.2.f1, 5.3.2f1 and 5.4.0b14) the cube usually renders as solid white. However whilst viewing the scene in the scene window it tends to oscillate between a solid cube and a wireframe, this can sometime happen in the game view too, but its usually easier to see in the scene view, especially if you move the camera around. Indeed almost every time I start up the project and load the test scene I see the cube as a wireframe in the game window, but as soon as I press play it reverts back to solid or oscillating between the two states.

    Stranger still is if you switch to using openGLCore the cube renders correctly as a wireframe constantly, so its only an issue running in dx11.

    I've attached the project to this post. If anyone has 5 minutes to grab, test and reply here it i'd be very grateful. When replying please state your gpu, driver version and whether you can see the issue.

    For reference my system is using an nvidia GTX970 and i've tried with both 361.43 and 364.72 drivers.

    The project was last built in Unity 5.4.0b14, however it can be opened in Unity 5.2.2f1 with no issues, so I don't think you need a beta version to test with. Of course being a Dx11 issue it goes without saying its only worth testing on Window systems.

    Thanks.
     

    Attached Files:

  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Code (CSharp):
    1. Unity 5.3.4p5
    2.  
    3. ------------------
    4. System Information
    5. ------------------
    6.          Operating System: Windows 10 Home 64-bit (10.0, Build 10586) (10586.th2_release_sec.160328-1908)
    7.           DirectX Version: 12
    8. Microsoft Graphics Hybrid: Not Supported
    9.            DxDiag Version: 10.00.10586.0000 64bit Unicode
    10.  
    11.  
    12. ---------------
    13. Display Devices
    14. ---------------
    15.           Card name: NVIDIA GeForce GTX 650 Ti
    16.        Manufacturer: NVIDIA
    17.           Chip type: GeForce GTX 650 Ti
    18.            DAC type: Integrated RAMDAC
    19.      Display Memory: 6085 MB
    20.    Dedicated Memory: 1989 MB
    21.       Shared Memory: 4095 MB
    22.        Current Mode: 1920 x 1080 (32 bit) (60Hz)
    23.         Driver Name: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um,nvwgf2um
    24. Driver File Version: 10.18.0013.6472 (English)
    25.      Driver Version: 10.18.13.6472
    26.         DDI Version: 12
    27.      Feature Levels: 11.0,10.1,10.0,9.3,9.2,9.1
    28.        Driver Model: WDDM 2.0
    screenshot.png

    Here is the log that is printed to the Console window:
    Code (CSharp):
    1. graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
    2. graphicsDeviceID: 4550
    3. graphicsDeviceName: NVIDIA GeForce GTX 650 Ti
    4. graphicsDeviceType: Direct3D11
    5. graphicsDeviceVendor: NVIDIA
    6. graphicsDeviceVendorID: 4318
    7. graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
    8. graphicsMemorySize: 1989
    9. graphicsMultiThreaded: True
    10. graphicsShaderLevel: 50
    11.  
    12. operatingSystem: Windows 10  (10.0.0) 64bit
    13. supportsComputeShaders: True
    14. supportsImageEffects: True
    15. supportsInstancing: True
    16. deviceModel: P5K/EPU (System manufacturer)
     
    Noisecrime likes this.
  3. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    Thanks Peter for taking the time to test this.
    I assume by your lack of comments and the supplied picture that the cube remained as a wireframe for you constantly?
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Yes it did remain as a wireframe constantly, no flicker or anything spotted.
     
  5. msibrandi

    msibrandi

    Joined:
    Sep 19, 2012
    Posts:
    14
    On initial opening in Unity 5.3.4p3 it shows a wireframe, when playing it quickly switches to a solid cube.
    Sometimes when stopping, it turns into a wireframe again, but usually it stays solid.

    graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
    graphicsDeviceID: 5080
    graphicsDeviceName: NVIDIA GeForce GTX 970M
    graphicsDeviceType: Direct3D11
    graphicsDeviceVendor: NVIDIA
    graphicsDeviceVendorID: 4318
    graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
    graphicsMemorySize: 6050
    graphicsMultiThreaded: True
    graphicsShaderLevel: 50

    operatingSystem: Windows 10 (10.0.0) 64bit
    supportsComputeShaders: True
    supportsImageEffects: True
    supportsInstancing: True
    deviceModel: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (16205 MB)
     
    Last edited: May 2, 2016
    Noisecrime likes this.
  6. msibrandi

    msibrandi

    Joined:
    Sep 19, 2012
    Posts:
    14
    Oeps, I actually meant 5.3.4p3