I'm trying to make some simple 3D scenes using ThreeJS and so far so good. The problem started once I tried my demo on some really old and limited mobile devices.
I'm using the latest CDN version of ThreeJS and once the demo starts I get these error messages:
THREE.WebGLRenderer 88
THREE.WebGLRenderer: WEBGL_depth_texture extension not supported.
THREE.WebGLRenderer: OES_texture_float_linear extension not supported.
THREE.WebGLRenderer: OES_texture_half_float extension not supported.
THREE.WebGLRenderer: OES_texture_half_float_linear extension not supported.
THREE.WebGLRenderer: OES_element_index_uint extension not supported.
THREE.WebGLRenderer: ANGLE_instanced_arrays extension not supported.
THREE.WebGLShader: gl.getShaderInfoLog() vertex Success.
THREE.WebGLShader: Shader couldn't compile.
THREE.WebGLProgram: shader error: 0 gl.VALIDATE_STATUS false gl.getProgramInfoLog Link Error: Fragment shader was not successfully compiled.
The webglreport of my target browser says this:
Context Name: experimental-webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 build 1.7#788837)
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.00 build 1.7#788837)
Renderer: WebKit WebGL
I also discovered that WebGLRenderingContext.getShaderPrecisionFormat() is not available.
I'm just trying to load an image as a texture and use it as a material of my spinning box. The relevant part of the code that is incompatible:
// Demo based on https://jsfiddle.net/f2Lommf5/
var texture = new THREE.TextureLoader().load( "10.jpg" );
var material = new THREE.MeshBasicMaterial({map: texture});
So, back to the original question, is there a version of ThreeJS that is indicated for limited browsers/devices? Or maybe a different way of applying textures to meshes that is more compatible?
I guess that You might have a problem with supporting WebGL functionality in older device. In that case You should use CanvasRenderer which should be supported on older browsers. Although it's performance is much lower than WebGL.
We are using a simple logic of checking if browser supports WebGL like here: https://stackoverflow.com/a/22953053/8265229 and then when browser does not support it, we use CanvasRenderer instead of WebGLRenderer.
Related
I'm interested to use geometry shader in web(site / application)
Is it possible to directly use opengl es 3.1 in web without webgl?
Is any other API to use newer version of opengl es than webgl2?
Totally is any way to I can use geometry shader in web?
thanks in advance
EDIT :
or is anyway to use opengl in web?
Is any other API to use newer version of opengl es than webgl2
No
Is it possible to directly use opengl es 3.1 in web without webgl
No
is any way to I can use geometry shader in web?
No
is anyway to use opengl in web?
No (wrt using anything else besides OpenGL ES 3.0 using WebGL 2.0)
I think that this feature can not be added to webgl2 by extensions
Well in theory it could, in fact the majority of API features were extensions once. As of now though there's no extension exposing geometry shaders for WebGL 2
So after spending time looking around, I am not sure how I would even go about loading and using a glTF file I have found and want to use for my OpenGL ES 3.0 program.
Are there are loaders or am I charge of extracting all the data from the glTF file?
EDIT:
I am developing on Android API 24 with NDK to use OpenGL ES 3.0
AFAIK, as of today (April 2017), there is no easy/official way to load & draw a GLTF model in native/mobile environments - the webgl ecosystem is currently more friendly.
GLTF being quite young, you would have to find some code around, or build your own.
Another alternative would be to try to use assimp to convert your GLTF model to a format that you can easily display.
Check out the ATW Vulkan Sample from Khronos Group
Since both Chromium and Firefox are using Angle as their OpenGL ES 2.0 compat layer in Windows, I am wondering, what they are using on MacOSX, since all that is available there is OpenGL 3.2 (which is not compatible with OpenGL ES 2.0).
Are both crafting their own layer and how do they work?
Both use their own layer.
Both use ANGLE on all platforms as a shader validator (to validate the shader meets all the rules of WebGL) and as a shader translator (to translate the shader from WebGL GLSL to OpenGL GLSL)
Both also take various other steps to emulate OpenGL ES 2.0 on top of OpenGL like enforcing npot restrictions, limiting access to non WebGL features, etc...
I have been looking at the examples provided along with the Three.js distribution and I get this error when I try to load the example webgl_materials_bumpmap_skin.html:
Could not initialise shader VALIDATE_STATUS: false, gl error [0]
I think it is a compilation error that has to do with the SkinSimple shader that is used in this particular example. Something similar happens in other examples as well.
For further reference, I'm using an ATI Radeon 45xx graphic card with the FGLRX driver under Debian. I have just downloaded the drivers to get my graphic card to support WebGL in this Linux distro and fglrxinfo shows that OpenGL 3.3 is installed.
I appreciate your help. Thank you
I would like to use Qualcomm's Augmented Reality SDK (Vuforia) with the min3D library and load obj model. How can I merge QCAR (Vuforia) with min3D? How to apply the projection and modelview matrixs of QCAR (Vuforia) to min3D? So that the scene is rendered correct in min3d.glsurfaceview? Has anyone developed an example?
There are plenty of OBJ file loaders for C++. Check the following answer for more information.
Lightweight OBJ mesh file loader for C/C++?
Rendering a mesh in Android NDK is not simple as you think, you need to learn OpenGLES for that. Instead you can use many rendering engines that are already ported to Android NDK. I use Irrlicht for rendering our game. The Android port is very stable for basic rendering needs. There is already many 3d mesh format loaders built in with Irrlicht