Closed takahirox closed 6 years ago
Maybe the desktop user agent is affecting? Could you try to select Mobile UA in settings->dev options?
I tried all three UA modes, they're Desktop, Mobile, and VR, but nothing changes.
Assigned to Fernando just to investigate.
As below, EXT_shader_texture_lod
seems like not be supported in Gecko, and FF gets a wrong result when doing getExtension( 'EXT_shader_texture_lod' )
.
https://bugzilla.mozilla.org/show_bug.cgi?id=1270435 https://bugzilla.mozilla.org/show_bug.cgi?id=1451287 https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLExtensionShaderTextureLod.cpp#14
Not familiar with Gecko yet. Is that Android FF specific issue? Or all FF issue? (FF on my laptop renders glTF model tho.)
Can FxR override getExtension
method? Unless we fix, FxR can't render glTF model with envMap
on Three.js, they're ones of the most popular 3D format + platform combinations.
If we can't and it takes time to fix the root issue, maybe I should add a workaround in Three.js side...
The first step should be to return null when requesting that extension as you mentioned so we could get the fallback shader behaviour, even if not optimal at least it won't crash. So we could have it working until the extension will be properly implemented on gecko.
getExtension( 'EXT_shader_texture_lod' )
would be null if the hardware doesn't support it. Btw, We have different behavior between Windows and MacOS. ANGLE in Windows did some workaround for some extensions that we can't support directly. Does Desktop FF renders 'EXT_shader_texture_lod' correctly? If it is true, that would be Android platform issue.
@daoshengmu on desktop is working as expected so it seems a android only problem
Please take a look at Oculus Go's available GL extension as below. We don't have 'EXT_shader_texture_lod'
on this device. [MOZ_GL_DUMP_EXTS=true] The reason for GeckoView considers this extension is supported is because EXT_shader_texture_lod
is treated to be enabled in GLESVersion::ES3 and GLESVersion::ES2 [2][3] and hard-code makes it. This should be specific happened on this device, we need give it a workaround in Gecko.
webgl : InitExtensions: GL_OES_EGL_image
webgl : InitExtensions: GL_OES_EGL_image_external
webgl : InitExtensions: GL_OES_EGL_sync
webgl : InitExtensions: GL_OES_vertex_half_float
webgl : InitExtensions: GL_OES_framebuffer_object
webgl : InitExtensions: GL_OES_rgb8_rgba8
webgl : InitExtensions: GL_OES_compressed_ETC1_RGB8_texture
webgl : InitExtensions: GL_AMD_compressed_ATC_texture
webgl : InitExtensions: GL_KHR_texture_compression_astc_ldr
webgl : InitExtensions: GL_KHR_texture_compression_astc_hdr
webgl : InitExtensions: GL_OES_texture_compression_astc
webgl : InitExtensions: GL_OES_texture_npot
webgl : InitExtensions: GL_EXT_texture_filter_anisotropic
webgl : InitExtensions: GL_EXT_texture_format_BGRA8888
webgl : InitExtensions: GL_OES_texture_3D
webgl : InitExtensions: GL_EXT_color_buffer_float
webgl : InitExtensions: GL_EXT_color_buffer_half_float
webgl : InitExtensions: GL_QCOM_alpha_test
webgl : InitExtensions: GL_OES_depth24
webgl : InitExtensions: GL_OES_packed_depth_stencil
webgl : InitExtensions: GL_OES_depth_texture
webgl : InitExtensions: GL_OES_depth_texture_cube_map
webgl : InitExtensions: GL_EXT_sRGB
webgl : InitExtensions: GL_OES_texture_float
webgl : InitExtensions: GL_OES_texture_float_linear
webgl : InitExtensions: GL_OES_texture_half_float
webgl : InitExtensions: GL_OES_texture_half_float_linear
webgl : InitExtensions: GL_EXT_texture_type_2_10_10_10_REV
webgl : InitExtensions: GL_EXT_texture_sRGB_decode
webgl : InitExtensions: GL_OES_element_index_uint
webgl : InitExtensions: GL_EXT_copy_image
webgl : InitExtensions: GL_EXT_geometry_shader
webgl : InitExtensions: GL_EXT_tessellation_shader
webgl : InitExtensions: GL_OES_texture_stencil8
webgl : InitExtensions: GL_EXT_shader_io_blocks
webgl : InitExtensions: GL_OES_shader_image_atomic
webgl : InitExtensions: GL_OES_sample_variables
webgl : InitExtensions: GL_EXT_texture_border_clamp
webgl : InitExtensions: GL_EXT_multisampled_render_to_texture
webgl : InitExtensions: GL_EXT_multisampled_render_to_texture2
webgl : InitExtensions: GL_OES_shader_multisample_interpolation
webgl : InitExtensions: GL_EXT_texture_cube_map_array
webgl : InitExtensions: GL_EXT_draw_buffers_indexed
webgl : InitExtensions: GL_EXT_gpu_shader5
webgl : InitExtensions: GL_EXT_robustness
webgl : InitExtensions: GL_EXT_texture_buffer
webgl : InitExtensions: GL_EXT_shader_framebuffer_fetch
webgl : InitExtensions: GL_ARM_shader_framebuffer_fetch_depth_stencil
webgl : InitExtensions: GL_OES_texture_storage_multisample_2d_array
webgl : InitExtensions: GL_OES_sample_shading
webgl : InitExtensions: GL_OES_get_program_binary
webgl : InitExtensions: GL_EXT_debug_label
webgl : InitExtensions: GL_KHR_blend_equation_advanced
webgl : InitExtensions: GL_KHR_blend_equation_advanced_coherent
webgl : InitExtensions: GL_QCOM_tiled_rendering
webgl : InitExtensions: GL_ANDROID_extension_pack_es31a
webgl : InitExtensions: GL_EXT_primitive_bounding_box
webgl : InitExtensions: GL_OES_standard_derivatives
webgl : InitExtensions: GL_OES_vertex_array_object
webgl : InitExtensions: GL_EXT_disjoint_timer_query
webgl : InitExtensions: GL_KHR_debug
webgl : InitExtensions: GL_EXT_YUV_target
webgl : InitExtensions: GL_EXT_sRGB_write_control
webgl : InitExtensions: GL_EXT_texture_norm16
webgl : InitExtensions: GL_EXT_discard_framebuffer
webgl : InitExtensions: GL_OES_surfaceless_context
webgl : InitExtensions: GL_OVR_multiview
webgl : InitExtensions: GL_OVR_multiview2
webgl : InitExtensions: GL_EXT_texture_sRGB_R8
webgl : InitExtensions: GL_KHR_no_error
webgl : InitExtensions: GL_EXT_debug_marker
webgl : InitExtensions: GL_OES_EGL_image_external_essl3
webgl : InitExtensions: GL_OVR_multiview_multisampled_render_to_texture
webgl : InitExtensions: GL_EXT_buffer_storage
webgl : InitExtensions: GL_EXT_external_buffer
webgl : InitExtensions: GL_EXT_blit_framebuffer_params
webgl : InitExtensions: GL_EXT_clip_cull_distance
webgl : InitExtensions: GL_EXT_protected_textures
webgl : InitExtensions: GL_EXT_shader_non_constant_global_initializers
webgl : InitExtensions: GL_QCOM_texture_foveated
webgl : InitExtensions: GL_QCOM_shader_framebuffer_fetch_noncoherent
webgl : InitExtensions: GL_EXT_memory_object
webgl : InitExtensions: GL_EXT_memory_object_fd
webgl : InitExtensions: GL_EXT_EGL_image_array
webgl : InitExtensions: GL_NV_shader_noperspective_interpolation
webgl : InitExtensions: GL_KHR_robust_buffer_access_behavior
[1] https://dxr.mozilla.org/mozilla-central/source/gfx/gl/GLContext.cpp#1632 [2] https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/gfx/gl/GLContextFeatures.cpp#859 [3] https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/gfx/gl/GLContextFeatures.cpp#580
@daoshengmu that functionality is enabled by default on webgl2 contexts (glsl3) but I don't understand why is not checking it if in webgl1 is optional.
@fernandojsg does the WebGL2 texlod() work properly on Oculus Go? I am going to give a workaround for Qualcomm 821 in WebGL 1.
File a bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1491221.
File a bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1491221.
I have confirmed https://threejs.org/examples/webgl_loader_gltf.html works properly after applying the patch from Bug 1491221.
@fernandojsg I think it works now in FxR. Please try the latest build from https://tools.taskcluster.net/groups/AlAyg0f5R-af3kDaljQhzw/tasks/AlAyg0f5R-af3kDaljQhzw/runs/1/artifacts and help confirm.
Thanks!
Confirmed this is working now with the example @daoshengmu provided. Thanks!
Hardware
Oculus Go
FxR APK file I used is public/FirefoxReality-oculusvr-debug.apk on https://tools.taskcluster.net/groups/Wqqjon9nQoqYx7V8SvVLSQ/tasks/Wqqjon9nQoqYx7V8SvVLSQ/runs/0/artifacts
Steps to Reproduce
Current Behavior
glTF model doesn't appear.
Expected Behavior
glTF model appears. Oculus Go default browser works fine.
Possible Solution
From the error log below, I guess shader texture LOD extension(
EXT_shader_texture_lod
) handling seems wrong? I suppose FxR doesn't supportEXT_shader_texture_lod
butgl.getExtension( 'EXT_shader_texture_lod' )
returns non-null?https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLProgram.js#L90
Context
glTF is one of the standard 3D format. If FxR can't render glTF model (with
envMap
), many WebVR app couldn't work.Error Logs and Stack Traces