Search Unity

MeshTopology.Point Geometry not displaying in WebGL Builds

Discussion in 'Web' started by Sajextryus, Jul 4, 2017.

  1. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    I'm using point meshes to render point-cloud sorta effects and visuals, but for some reason when compiling builds in 5.6.2f1, the points never show up in the actual build. They do show up in the profiler via inflated Tris count when I connect the build to it however, so I believe it's still being rendered, just not drawn.
    upload_2017-7-4_9-19-31.png



    It does appear to work in the Editor, and I've tried getting it to render by writing native GLSL shaders and defining gl_PointSize to high numbers just in case they were just being rendered really small or whatever, but still no luck.

    upload_2017-7-4_9-23-57.png


    MeshTopology.Lines and Linestrips don't seem to be affected at all however, they render just fine in WebGL builds.


    upload_2017-7-4_9-38-36.png


    I assume it could be an error with how Unity is compiling the shader or something but I honestly have no idea.


    Is this a glitch with Unity? And is there a way to get this working currently, or am I going to have to wait for a patch/fix?
     
    Last edited: Jul 4, 2017
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    IIRC, there is a webgl1.0/gles2.0 limitation in regards to gl_PointSize.

    Could you try to launch the editor specifying to use gles20: Unity.exe -force-gles20
    to see if you can repro the same problem in the editor.
     
  3. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    no dice: still renders the same in the editor. upload_2017-7-5_2-52-28.png

    What's weird is I've gotten points and point size to render before, a while back in another version of Unity. Unfortunately I lost the files for that, but I have seen it work before in a WebGL build.
     
    Last edited: Jul 5, 2017
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    do you get the same results in both webgl1.0 and 2.0?
     
  5. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    yeah.
     
  6. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    Any updates on this?
     
  7. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    None yet, can you be so nice to send a bug report with your repro project attached? And then ping the case number here please.
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Thanks for the bug report.

    Your shader fails to compile, that's why nothing renders. Have a look at the browser log to see the errors.
     
  9. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    Code (CSharp):
    1. UnityLoader.js:235 run() called, but dependencies remain, so not running
    2. printErr @ UnityLoader.js:235
    3. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:444 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
    4. read @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:444
    5. UnityLoader.js:235 pre-main prep time: 7354 ms
    6. printErr @ UnityLoader.js:235
    7. doRun @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427419
    8. run @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427434
    9. runCaller @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427362
    10. removeRunDependency @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:1570
    11. (anonymous) @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:11
    12. doCallback @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:5634
    13. done @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:5645
    14. reconcile @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4743
    15. (anonymous) @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4533
    16. UnityLoader.434c1f51e2af1c2a162a462394f9b403.IDBFS.getRemoteSet.IDBFS.getDB.index.openKeyCursor.onsuccess @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4621
    17. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 PlayerConnection initialized from  (debug = 0)
    18.  
    19. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Connecting directly to [192.168.0.18]...
    20.  
    21. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Connected to [192.168.0.18]
    22.  
    23. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Initialize engine version: 5.6.2p1 (8a29de46e0a0)
    24.  
    25. UnityLoader.js:234 Creating WebGL 1.0 context.
    26. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Renderer: WebKit WebGL
    27.  
    28. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Vendor:   WebKit
    29.  
    30. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Version:  OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))
    31.  
    32. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 GLES:     2
    33.  
    34. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ANGLE_instanced_arrays GL_ANGLE_instanced_arrays EXT_blend_minmax GL_EXT_blend_minmax EXT_disjoint_timer_query GL_EXT_disjoint_timer_query EXT_frag_depth GL_EXT_frag_depth EXT_shader_texture_lod GL_EXT_shader_texture_lod EXT_sRGB GL_EXT_sRGB EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic WEBKIT_EXT_texture_filter_anisotropic GL_WEBKIT_EXT_texture_filter_anisotropic OES_element_index_uint GL_OES_element_index_uint OES_standard_derivatives GL_OES_standard_derivatives OES_texture_float GL_OES_texture_float OES_texture_float_linear GL_OES_texture_float_linear OES_texture_half_float GL_OES_texture_half_float OES_texture_half_float_linear GL_OES_texture_half_float_linear OES_vertex_array_object GL_OES_vertex_array_object WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc WEBKIT_WEBGL_compressed_texture_s3tc GL_WEBKIT_WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_debug_shaders GL_WEBGL_debug_shaders WEBGL_depth_texture GL_WEBGL_depth_texture
    35.  
    36. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335  WEBKIT_WEBGL_depth_texture GL_WEBKIT_WEBGL_depth_texture WEBGL_draw_buffers GL_WEBGL_draw_buffers WEBGL_lose_context GL_WEBGL_lose_context WEBKIT_WEBGL_lose_context GL_WEBKIT_WEBGL_lose_context
    37.  
    38. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level  <OpenGL ES 2.0> ; Context handle 1
    39.  
    40. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: 0:37: '[]' : Index expression must be constant
    41. ERROR: 0:39: '[]' : Index expression must be constant
    42.  
    43.  
    44. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Note: Creation of internal variant of shader 'Hidden/ConvertTexture' failed.
    45.  
    46. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    47. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/ConvertTexture' - Pass '' has no vertex shader
    48.  
    49. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    50. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/ConvertTexture' - Setting to default shader.
    51.  
    52. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    53. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Pass '' has no vertex shader
    54.  
    55. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    56. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Setting to default shader.
    57.  
    58. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: 0:40: 'GL_EXT_gpu_shader4' : extension is not supported
    59. ERROR: 0:71: 'gl_VertexID' : undeclared identifier
    60. ERROR: 0:75: '=' : dimension mismatch
    61. ERROR: 0:75: 'assign' : cannot convert from 'highp 4-component vector of float' to 'PointSize mediump float'
    62.  
    63.  
    64. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Note: Creation of internal variant of shader 'Unlit/PointMapper1' failed.
    65.  
    66. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    67. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Unlit/PointMapper1' - Pass '' has no vertex shader
    68.  
    69. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: Shader
    70. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    71. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
    72. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Unlit/PointMapper1' - Setting to default shader.
    73.  
    74. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 UnloadTime: 29.750000 ms
    75.  
    76. blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:5627 warning: 2 FS.syncfs operations in flight at once, probably just doing extra work
    Still curious why MeshTopology.Point geometry would render in WebGL builds made with older versions of unity (IE 5.4 and prior, possibly 5.5) and not current versions (5.6+).
     
  10. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    Has any progress been made with identifying the cause for this bug in this/current versions?
     
  11. Sajextryus

    Sajextryus

    Joined:
    Jan 6, 2013
    Posts:
    10
    It's been about two months and I've still had no luck with this issue. Reverting to older versions of Unity does fix this, but it's extremely unreliable if it'll build at all with any projects in WebGL compared to 5.6+.
     
  12. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    Are you able to provide your point rendering shader by any chance? The application I work on displays a large quantity of point cloud data, I've written a GLSL shader specifically for WebGL as the original shader relies on geometry shaders. This shader works fine for me on all the recent Unity versions I've tried.

    In your log posted in July I see it fails on gl_vertexID - are you able to refactor your shader to remove this? If you're using this because you absolutely need to know the unique index of a particular point in the shader you could try using another data type instead, e.g. UV.x. (gl_MultiTexCoord0.x in GLSL)

    For reference this is the shader I use which works fine.
    https://pastebin.com/raw/qRT14N4x
     
  13. Echo____G

    Echo____G

    Joined:
    Dec 30, 2015
    Posts:
    6
    It is still not fix at 2018.2.14