Forum

Create fallback material for shader compilation error.

25 April 2018 17:56
I made a simple material.

1. It only uses the normals of the object.
2. It converts it to camera space
3. Applies simple Vector and algebraic operations.

It worked on my desktop and mobile, but not on the mobile (Doogee X9 mini) of my coworker, where it resulted in a shader compilation error on the same browser and version (Chrome 66.0.3359.126) :

B4W ERROR: Shader compilation/linking error: main.glslv, main.glslf, materials: "devTest"


I simplified the material to find the source of the error, and it turned out that transforming the normal vectors from World space into camera space caused the problem.

This overly simplified material still gives an error:



My guess is, it can not compile the shader, because of insufficient hardware support. My question:

can I use a fallback material on shader compilation errors?
26 April 2018 12:09
My guess is, it can not compile the shader, because of insufficient hardware support. My question:
Yeah, this is the most likely reason (hardware or driver issues). For such cases we usually create hacks for workaround. But first we need to reproduce the error.

For more descriptive error pass to app.init the following parameter: gl_debug: true.

What version of Android on your phone? Is it latest?
I will try to find this or similar model.

can I use a fallback material on shader compilation errors?
Currently you can't create fallback material.
But you can try to create a hack yourself. If you want, I can lead you
Alexander (Blend4Web Team)
twitter
 
Please register or log in to leave a reply.