Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Graphics OpenGLCore shader error - bug?

Discussion in '5.3 Beta' started by Foxxis, Nov 10, 2015.

  1. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    Hi,

    Starting in b4, we get an error on this line in a cube reflection shader:

    o.reflDir = reflect(float3(mul(modelMatrix, v.vertex) - float4(_WorldSpaceCameraPos, 1.0)), normalDir);

    The error is
    "
    Shader error in 'Mobile/OceanCR': incorrect number of arguments to numeric-type constructor at line 91 (on glcore)
    Compiling Vertex program"

    I can see nothing weird with the instruction. Granted, I am no shader ninja and the shader is old. But it has worked fine during 5.0 -> 5.3b3. I have logged the error, case 743488. Did not submit a repro project though, but can if needed.
     
    Last edited: Nov 10, 2015
  2. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    Actually, now that I look at it again it is weirdly constructed since it feeds a float4 into a float3 constructor, which might well throw the error. But it might be worth a look since it did not throw the error in earlier versions.
     
  3. strandborg

    strandborg

    Joined:
    Dec 8, 2014
    Posts:
    32
    Hi,

    This is probably expected. For GL core, we use the new shader compilation pipeline as described in http://blogs.unity3d.com/2015/05/26/dx11-features-on-mobile/ , which means that now we pass the shader first to DirectX shader compiler, and the error you are seeing comes from the Microsoft HLSL parser. You would probably have seen the same error in 5.0 or earlier versions as well if you try it on Windows, as the shader would then be compiled for DirectX bytecode. Looks like the older hlsl2glsl compiler was being more lax on the syntax. Not sure if there's anything for us to do in this case, but thanks for reporting it anyway!

    --Mikko
     
  4. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    Thanks for the reply! Suspected as much after the second look, but better safe than sorry. :)