Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Probuilder bug: Unexpected Token with standard vertex colors

Discussion in 'World Building' started by LMichelle, May 31, 2018.

  1. LMichelle

    LMichelle

    Joined:
    Mar 10, 2018
    Posts:
    10
    Hello there,

    I am using Windows 10, Unity 2018.1.2f1. Also occurred in 2018.1.0b13.
    Probuilder worked fine until I started it up today and when I clicked on any of the parts, it became like this:
    upload_2018-5-31_10-13-39.png

    This is the error:
    "
    Shader error in 'ProBuilder/Standard Vertex Color': syntax error: unexpected token ';' at line 288 (on d3d11)

    Compiling Vertex program with POINT LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
    "

    Also, if it matters, I have realtime global illumination and baked global illumination both turned off. No fog either.
    The shader shows up under 'failed to compile'; If I select Probuilders Diffuse Vertex Color, I get back colors but it looks a little less good than the standard vertex colors.

    I'm sorry, but I have no idea how to recreate the error. Also, I came here from the closed progrid bug report forum, so I thought this was the place to go.
     
  2. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi! :) Thanks for posting here, this is the right place yep!

    Just to make sure I understand 100% -

    1) Everything was fine
    2) You closed the project
    3) You opened up the project- stuff broke

    Can you think of anything that might have changed? Did you perhaps open the project in a different version of Unity, vs the version you last saved it in? That would be my first guess. Or did you have a git/dropbox/other change in the background between closing and re-opening the project?
     
  3. MallNinjaMax

    MallNinjaMax

    Joined:
    Apr 17, 2017
    Posts:
    25
    Getting this problem as well. I started using ProBuilder from the Asset store (it puts it, and the other parts of ProCore in one folder instead of making a mess of my assets folder) and I was getting tons of errors and warnings. I closed Unity, came back later, and now the PB shader fails to load.

    The only problem I can think of is that I can't remember the order I installed the ProCore tools in from the asset store. Not sure if that matters, but I'm going to try some different installation methods. I did also change the Gloss property of the shader. I don't like specularity when I'm prototyping.
     
    Last edited: May 31, 2018
  4. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi Deaden- can you define what versions you are comparing when you say "instead of making a mess of my assets folder"? Thanks!

    Also, I highly recommend using Unity 2018.x and above, with the Package Manager version of ProBuilder. The Asset Store version is only receiving critical updates.
     
  5. MallNinjaMax

    MallNinjaMax

    Joined:
    Apr 17, 2017
    Posts:
    25
    The Package Manager version, last time I tried using it, puts PB in it's own folder. It was only a mild annoyance. If the PM version works better, I guess I'll switch to that one. I just preferred having all PC tools in one folder. I didn't know the versions were different other than that, thanks.
     
  6. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Package Manager: that sounds odd, because you actually shouldn't see any folder at all when using this version. I'd give it another try, just in case! :)
     
  7. LMichelle

    LMichelle

    Joined:
    Mar 10, 2018
    Posts:
    10
    Hi there! I'm so sorry for the late reaction, I didn't get any e-mails so I thought it never got answered!

    You got that completely right: I opened it after it used to be fine, then suddenly this error occurred. I think I indeed switched from 2017.2 to 2018.1.0b13, but I got the problem as I switched to 2018.1: although I am quite sure I already used 2018.1 fine for a couple of times before the error. When I open new projects, it's all fine, so maybe there is a way I can import the scene into a new project? I'm not sure how I do that though...

    I am sure I didn't use any git or dropbox!

    Also, if it helps: if I save the project using another shader, then open it up and change it back to Standard Vertex Color, it keeps working. If I however save using the Standard Vertex Color after it worked, then close and open it up, then as soon as I click on it it becomes pink again.
     
  8. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    Hi! No worries of course :)

    Are you using the Package Manager version of ProBuilder? If not, can you do that upgrade and see if it helps?
     
  9. mikaeloutside

    mikaeloutside

    Joined:
    Aug 15, 2017
    Posts:
    1
    Hello!

    I just ran into the exact same problem after upgrading from ProBuilder 2.7 to 2.9.8f3.

    The issue seems to be the way LIGHT_ATTENUATION is defined is some cases.

    For example (not saying this is the code path that is taken, but it could be) the AutoLight.cginc contains this:

    Code (cg):
    1. #ifdef POINT
    2. #   if !defined (UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS)
    3. #       define DECLARE_LIGHT_COORDS(idx)
    4. #       define COMPUTE_LIGHT_COORDS(a)
    5. #       define LIGHT_ATTENUATION(a)
    6. #   else
    7. #       define DECLARE_LIGHT_COORDS(idx) unityShadowCoord3 _LightCoord : TEXCOORD##idx;
    8. #       define COMPUTE_LIGHT_COORDS(a) a._LightCoord = mul(unity_WorldToLight, mul(unity_ObjectToWorld, v.vertex)).xyz;
    9. #       define LIGHT_ATTENUATION(a)    (tex2D(_LightTexture0, dot(a._LightCoord,a._LightCoord).rr).UNITY_ATTEN_CHANNEL * SHADOW_ATTENUATION(a))
    10. #   endif
    11. #endif
    12.  
    If POINT is defined and UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS is not, the following code:

    Code (cg):
    1. float attenuation = LIGHT_ATTENUATION(i);
    will result in
    Code (cg):
    1. float attenuation = ;
    which the error message seems to imply.

    Seeing how LIGHT_ATTENUATION is defined, I can't understand how it's supposed to be used.
    Maybe it should be defined to 1.0 or something tangible instead of an empty statement.

    Edit: Just wanted to add that I'm on Unity 2018.1.6
     
    Last edited: Aug 9, 2018