Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

Problem with shader compilation #1940

Closed SteveGreatApe closed 6 years ago

SteveGreatApe commented 6 years ago

This seems to be a problem as a result of a code push last Friday:

commit ae25cd7d1aaa844236cf2bc625cdf440d0daa976
Author: Nola Donato <nola.donato@samsung.com>
Date:   Fri Jul 6 06:40:18 2018 -0700

I see errors like this:

2018-07-13 09:38:32.052 15015-15242/com.greatape.avrgallery E/gvrf: Could not compile shader 35633:
    0:113: L0001: Unknown character '@'(64)

I added some logging to dump the source of the shader being compiled and found it had this code in it:

    ...
    #ifdef HAS_VertexMorphShader
    @VertexMorphShader
    #endif
    ...

This I can see those lines were added to vertex_template.vsh as part of the Friday 6 July push I mentioned earlier. I presume some code somewhere is supposed to be substituting the @VertexMorphShader part before compilation bit in this case it hasn't happened and we get the compilation error.

There's also another shader error I keep seeing after the above fix, but I'm not sure if this is directly related to the same code change or something else that was already there before as it happens around some code I was re-writing around the same time as I pulled the GearVRf update:

2018-07-13 11:46:40.120 23986-24520/com.greatape.avrgallery E/gvrf: SHADER: shader could not be generated GVRPhongShader$ambientTexture-#a_texcoord#$a_normal$diffuseTexture-#a_texcoord#$LIGHTSOURCES$GVRPointLight1
2018-07-13 11:46:40.120 23986-24520/com.greatape.avrgallery E/gvrf: UniformBlock: ERROR: cannot find block named Lights_ubo
2018-07-13 11:46:40.120 23986-24520/com.greatape.avrgallery E/gvrf: renderMesh:before render error: GL_INVALID_VALUE

This sometimes happens when I'm removing and re-adding GVRPointLight's to the scene, it could be a timing related issue as it doesn't always occur.

liaxim commented 6 years ago

Tentative fix: https://github.com/Samsung/GearVRf/pull/1941