Hi Everyone,
We are running into a bug when we select the camera in a scene, the scene goes blank.
Image attached.
This is pretty recent.
Hi Everyone,
We are running into a bug when we select the camera in a scene, the scene goes blank.
Image attached.
This is pretty recent.
This is a GLSL compilation error:
playcanvas-stable.js:343 Powered by PlayCanvas 0.213.1 bd43218
messenger.js:80 messenger connected
playcanvas-stable.js:351 ERROR: Failed to compile fragment shader:
1: #version 300 es
2: #define varying in
3: out highp vec4 pc_fragColor;
4: #define gl_FragColor pc_fragColor
5: #define texture2D texture
6: #define textureCube texture
7: #define texture2DProj textureProj
8: #define texture2DLodEXT textureLod
9: #define texture2DProjLodEXT textureProjLod
10: #define textureCubeLodEXT textureLod
11: #define texture2DGradEXT textureGrad
12: #define texture2DProjGradEXT textureProjGrad
13: #define textureCubeGradEXT textureGrad
14: #define GL2
15: precision highp float;
16: #ifdef GL2
17: precision highp sampler2DShadow;
18: #endif
19: varying vec3 vPositionW;
20: varying vec2 vUv0;
21: varying vec2 vUv1;
22:
23: uniform vec3 view_position;
24: uniform vec3 light_globalAmbient;
25: float square(float x) {
26: return x*x;
27: }
28: float saturate(float x) {
29: return clamp(x, 0.0, 1.0);
30: }
31: vec3 saturate(vec3 x) {
32: return clamp(x, vec3(0.0), vec3(1.0));
33: }
34: vec4 dReflection;
35: mat3 dTBN;
36: vec3 dAlbedo;
37: vec3 dViewDirW;
38: vec3 dDiffuseLight;
39: vec3 dSpecularLight;
40: vec3 dSpecularity;
41: vec2 dUvOffset;
42: float dAlpha;
43:
44: vec3 gammaCorrectInput(vec3 color) {
45: return pow(color, vec3(2.2));
46: }
47: float gammaCorrectInput(float color) {
48: return pow(color, 2.2);
49: }
50: vec4 gammaCorrectInput(vec4 color) {
51: return vec4(pow(color.rgb, vec3(2.2)), color.a);
52: }
53: vec4 texture2DSRGB(sampler2D tex, vec2 uv) {
54: vec4 rgba = texture2D(tex, uv);
55: rgba.rgb = gammaCorrectInput(rgba.rgb);
56: return rgba;
57: }
58: vec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {
59: vec4 rgba = textureCube(tex, uvw);
60: rgba.rgb = gammaCorrectInput(rgba.rgb);
61: return rgba;
62: }
63: vec3 gammaCorrectOutput(vec3 color) {
64: #ifdef HDR
65: return color;
66: #else
67: color += vec3(0.0000001);
68: return pow(color, vec3(0.45));
69: #endif
70: }
71: uniform float exposure;
72: vec3 toneMap(vec3 color) {
73: float tA = 2.51;
74: float tB = 0.03;
75: float tC = 2.43;
76: float tD = 0.59;
77: float tE = 0.14;
78: vec3 x = color * exposure;
79: return (x*(tA*x+tB))/(x*(tC*x+tD)+tE);
80: }
81: vec3 addFog(vec3 color) {
82: return color;
83: }
84: uniform sampler2D texture_diffuseMap;
85: void getAlbedo() {
86: dAlbedo = texture2DSRGB(texture_diffuseMap, vUv0 + dUvOffset).rgb;
87: }
88: uniform vec3 material_emissive;
89: vec3 getEmission() {
90: return material_emissive;
91: }
92: void getTBN() {
93: dTBN = mat3(normalize(vTangentW), normalize(vBinormalW), normalize(vNormalW));
94: }
95: uniform sampler2D texture_heightMap;
96: uniform float material_heightMapFactor;
97: void getParallax() {
98: float parallaxScale = material_heightMapFactor;
99: float height = texture2D(texture_heightMap, vUv0).r;
100: height = height * parallaxScale - parallaxScale*0.5;
101: vec3 viewDirT = dViewDirW * dTBN;
102: viewDirT.z += 0.42;
103: dUvOffset = height * (viewDirT.xy / viewDirT.z);
104: }
105: vec3 combineColor() {
106: return mix(dAlbedo * dDiffuseLight, dSpecularLight + dReflection.rgb * dReflection.a, dSpecularity);
107: }
108: uniform sampler2D texture_lightMap;
109: void addLightMap() {
110: dDiffuseLight += texture2DSRGB(texture_lightMap, vUv1 + dUvOffset).rgb;
111: }
112:
113: void main(void) {
114: dDiffuseLight = vec3(0);
115: dSpecularLight = vec3(0);
116: dReflection = vec4(0);
117: dSpecularity = vec3(0);
118: dAlpha = 1.0;
119: getAlbedo();
120: addLightMap();
121:
122: gl_FragColor.rgb = combineColor();
123: gl_FragColor.rgb += getEmission();
124: gl_FragColor.rgb = addFog(gl_FragColor.rgb);
125: #ifndef HDR
126: gl_FragColor.rgb = toneMap(gl_FragColor.rgb);
127: gl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);
128: #endif
129: gl_FragColor.a = 1.0;
130:
131: }
132:
ERROR: 0:93: 'vTangentW' : undeclared identifier
ERROR: 0:93: 'vBinormalW' : undeclared identifier
ERROR: 0:93: 'vNormalW' : undeclared identifier
ERROR: 0:93: 'constructor' : not enough data provided for construction
error @ playcanvas-stable.js:351
playcanvas-stable.js:351 ERROR: Failed to link shader program. Error: invalid shaders
error @ playcanvas-stable.js:351
playcanvas-stable.js:5745 WebGL: INVALID_OPERATION: useProgram: program not valid
setShader @ playcanvas-stable.js:5745
playcanvas-stable.js:5745 WebGL: INVALID_OPERATION: useProgram: program not valid
setShader @ playcanvas-stable.js:5745
editor.js:41206 reference zone:size is not defined
I pushed a fix for the shader error, but unfortunately it is not related to the camera bug. Needs more investigation.
It seems to be caused by the presence of the object āSelene_Site_NT_Aā. It doesnāt happen if this entity is disabled and I create other graphical primitives. Something bounding box/culling related maybe?
More info. If you disable blending on the material called āGlassā, the problem is no longer evident. Any thoughts, @Mr_F? (Iāve added you to a fork of that scene)
Ah, OK, it seems like the glass material has āalpha to coverageā enabled. You can safely uncheck it (it doesnāt do anything for this particular material), and it works.
However, it shouldnāt cause this bug, so Iām gonna find a fix for it.
OK, it was a bug related to alpha to coverage state being leaked, fixed it (not deployed yet).
Great works guys, testing it our project now.
Confirmed fixed in our project, thanks muchly!