MeshTopology.Point Geometry not displaying in WebGL Builds

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.
3132718--237345--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.

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

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?

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.

no dice: still renders the same in the editor.3133501--237453--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.

do you get the same results in both webgl1.0 and 2.0?

yeah.

Any updates on this?

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.

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.

UnityLoader.js:235 run() called, but dependencies remain, so not running
printErr @ UnityLoader.js:235
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/.
read @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:444
UnityLoader.js:235 pre-main prep time: 7354 ms
printErr @ UnityLoader.js:235
doRun @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427419
run @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427434
runCaller @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:427362
removeRunDependency @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:1570
(anonymous) @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:11
doCallback @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:5634
done @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:5645
reconcile @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4743
(anonymous) @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4533
UnityLoader.434c1f51e2af1c2a162a462394f9b403.IDBFS.getRemoteSet.IDBFS.getDB.index.openKeyCursor.onsuccess @ blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:4621
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 PlayerConnection initialized from  (debug = 0)

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Connecting directly to [192.168.0.18]...

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Connected to [192.168.0.18]

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Initialize engine version: 5.6.2p1 (8a29de46e0a0)

UnityLoader.js:234 Creating WebGL 1.0 context.
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Renderer: WebKit WebGL

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Vendor:   WebKit

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Version:  OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 GLES:     2

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

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

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

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: 0:37: '[]' : Index expression must be constant
ERROR: 0:39: '[]' : Index expression must be constant


blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Note: Creation of internal variant of shader 'Hidden/ConvertTexture' failed.

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/ConvertTexture' - Pass '' has no vertex shader

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/ConvertTexture' - Setting to default shader.

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Pass '' has no vertex shader

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Hidden/VR/BlitCopyFromTexArray' - Setting to default shader.

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: 0:40: 'GL_EXT_gpu_shader4' : extension is not supported
ERROR: 0:71: 'gl_VertexID' : undeclared identifier
ERROR: 0:75: '=' : dimension mismatch
ERROR: 0:75: 'assign' : cannot convert from 'highp 4-component vector of float' to 'PointSize mediump float'


blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Note: Creation of internal variant of shader 'Unlit/PointMapper1' failed.

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Unlit/PointMapper1' - Pass '' has no vertex shader

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 ERROR: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 WARNING: Shader
blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 Unsupported: 'Unlit/PointMapper1' - Setting to default shader.

blob:http://localhost:64369/d8c661fe-2ae9-4793-9858-a0e39c4d22d3:9335 UnloadTime: 29.750000 ms

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+).

Has any progress been made with identifying the cause for this bug in this/current versions?

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+.

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

It is still not fix at 2018.2.14