Search Unity

[Unity 4] Shader fails under DX11, works under DX9

Discussion in 'Shaders' started by ronan-thibaudau, Nov 4, 2012.

  1. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Any tips? I have a shader rendering just fine under DX9 and failing with the clasical pink render on DX11. What surprises me is that:
    It has #pragma target 3.0 so i don't think it should be treated diferently
    DX11 is working as the tesselation shaders demo scene works just fine
    Could really use some help.
     
  2. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Did you make your Shaders under strumpy? They are not compatible with Unity 4. You can tweak the code to have them working again, but not in Strumpy.
     
  3. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Nope, hand written and it "works" in unity 4, just not in DX11 mode.
     
  4. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    By Unity 4 I meant DX11. They work under OpenGL and DX9.

    Now for people to better understand your issue, you should post the error message and maybe a simple example of a failing shader. Without this information we can't help.
     
    lemon_pan likes this.
  5. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    The error is as follow: "no subshaders can run on this graphics card"
    However if every shader made by strumpy fails in DX11, i'm assuming something breaks between DX9 11, do you have a link to an explanation? It's very likely to be the same for me.
     
  6. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    I started this thread a while ago and nobody really helped. I had to remove the custom lighting and vertex shaders. At that point I started coding my own shader and never encountered this issue again.

    Maybe there are some specifications about this in the U4 DX11 documentation.
     
  7. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I followed the advice from your other thread and when i got to removing the vertex:vert function it worked again (broken, but did compile / render something). However obviously i can't just drop the vertex shader part! Any idea what could've changed there?
     
  8. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Fixed, apparently DX11 is less forgiving, had to add
    UNITY_INITIALIZE_OUTPUT(Input,o);
    in my vertex function
     
  9. Artimese

    Artimese

    Joined:
    Nov 22, 2009
    Posts:
    794
    So even after a few months stramit hasn't updated SSE for DX11? Thats a shame... really got attached to SSE seeing that shader coding is so nerve-wrecking.... I hope he decides to patch it up ):
     
  10. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    He said he would patch it, but didn't. Anyway he now works for Unity Danemark, maybe there's an official visual editor coming in a future release...

    *crossing fingers* :)
     
  11. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    THANK YOU !!
    You just saved me HOURS of frustration and online searching!!
    In my case, it did compile, but simply ignored the vertex shader code!
    Putting this initialization as the first line inside my vertex shader fixed everything!
    THANKS AGAIN!

    here, take a kitten thanks xD
    $thank%u00252Byou%2Bkitty.jpg