googlearchive / poly-toolkit-unity

Poly Toolkit for Unity
Apache License 2.0
102 stars 29 forks source link

WebGL support - Newtonsoft.json #18

Open yosun opened 6 years ago

yosun commented 6 years ago

Trying to build for WebGL and encountering this error. Is only Unity iOS/Android supported and not WebGL?

Incidentally, the more recent versions of Unity has added more web/json support - are the external json libraries still necessary?

Assets/PolyToolkit/Internal/api_clients/poly_client/PolyClient.cs(15,8): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

yosun commented 6 years ago

Tried checkboxing WebGL support for AOT/Newtonsoft. Building empty project with just the HelloPoly.unity scene example on 2018.1.2f1. Runs in editor, but browser console errors galore:

HTML1300: Navigation occurred. localhost:4070 (1,1)

Warning: Unsupported graphics API WebGL 2.0

You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression.

Loading player data from data.unity3d

Initialize engine version: 2018.1.2f1 (a46d718d282d)

Creating WebGL 1.0 context.

Renderer: Microsoft Edge

Vendor: Microsoft

Version: OpenGL ES 2.0 (WebGL 1.0)

GLES: 2

WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc OES_texture_float GL_OES_texture_float OES_texture_float_linear GL_OES_texture_float_linear EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic OES_standard_derivatives GL_OES_standard_derivatives ANGLE_instanced_arrays GL_ANGLE_instanced_arrays OES_element_index_uint GL_OES_element_index_uint WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_depth_texture GL_WEBGL_depth_texture EXT_frag_depth GL_EXT_frag_depth OES_texture_half_float GL_OES_texture_half_float OES_texture_half_float_linear GL_OES_texture_half_float_linear WEBGL_lose_context GL_WEBGL_lose_context OES_vertex_array_object GL_OES_vertex_array_object WEBGL_draw_buffers GL_WEBGL_draw_buffers EXT_blend_minmax GL_EXT_blend_minmax EXT_shader_texture_lod GL_EXT_shader_texture_lod EXT_color_buffer_half_float GL_EXT_color_buffer_half_float WEBGL_color_buffer_float GL_WEBGL_color_buffer_float

OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level OpenGL ES 2.0> ; Context handle 1

UnloadTime: 0.200000 ms

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:118: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:148: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Particle/Embers' failed.

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:101: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:94: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Particle/Stars' failed.

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:101: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:97: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Visualizer/Dots' failed.

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:118: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:117: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Particle/Smoke' failed.

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:101: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:112: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Particle/Bubbles' failed.

ERROR: 0:70: 'GL_EXT_gpu_shader4' : extension is not supported ERROR: 0:118: '&' : bit-wise operator supported in GLSL ES 3.00 and above only ERROR: 0:107: 'gl_VertexID' : undeclared identifier

Note: Creation of internal variant of shader 'Brush/Particle/Snow' failed.

SystemException: Thread creation failed. at System.Threading.Thread.Start () [0x00000] in filename unknown>:0

(Filename: currently not available on il2cpp Line: -1)

warning: 2 FS.syncfs operations in flight at once, probably just doing extra work

Requesting asset...

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

Exception: Poly Toolkit runtime API not initialized. You must have a PolyToolkitManager in your scene and wait until after its Awake() method runs, or explicitly call PolyApi.Init() before using Poly API methods. at PolyToolkit.PolyApi.CheckInitialized () [0x00000] in filename unknown>:0

(Filename: currently not available on il2cpp Line: -1)

harunomura900 commented 6 years ago

one more here !!!

anokta commented 6 years ago

Hi,

The Poly Toolkit does not currently have support for WebGL builds. It is supported for mobile platforms (Android/iOS), as well as desktop platforms (Windows/OSX/Linux).

That said, we are investigating to enable WebGL support in the future. In the meantime, you may refer to Poly JavaScript API to target web applications.

Cheers

ronoyama7 commented 5 years ago

Hi, I added google poly using this repo https://github.com/gpvigano/AsImpL but still, support only obj format

string url = ""https://poly.googleapis.com/downloads/7BMfIK4AqZK/2Sr9i9mOwg7/model.obj";  // add obj file url
objImporter.ImportModelAsync("MyObject", url, importOptions);

I customize something for my project Here is a demo video link https://vimeo.com/295358208 0:50 - 1:15 I hope this is helpful. Thanks

monigarr commented 5 years ago

We would super appreciate WebGL being supported!