Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsupported fragment shader function 'texture2DLod' #386

Open
arcman7 opened this issue Jan 23, 2025 · 0 comments
Open

unsupported fragment shader function 'texture2DLod' #386

arcman7 opened this issue Jan 23, 2025 · 0 comments

Comments

@arcman7
Copy link

arcman7 commented Jan 23, 2025

After pulling the latest commits into my own local build of the super splat viewer I started seeing these shader errors:

infinite-grid.ts:68 Failed to compile fragment shader:

ERROR: 0:138: 'texture2DLod' : no matching overloaded function found
ERROR: 0:138: 'y' :  field selection requires structure, vector, or interface block on left hand side

133:	        return (v.z / v.w) * 0.5 + 0.5;
134:	    }
135:	
136:	    bool writeDepth(float alpha) {
137:	        vec2 uv = fract(gl_FragCoord.xy / 32.0);
138:	        float noise = texture2DLod(blueNoiseTex32, uv, 0.0).y;
139:	        return alpha > noise;
140:	    }
141:	
142:	    void main(void) {
143:	        vec3 p = worldNear;
 while rendering undefined

playcanvas.js?v=c37bc038:10796 Failed to compile vertex shader:

ERROR: 0:288: 'SH_COEFFS' : undeclared identifier
ERROR: 0:288: '' : array size must be a constant integer expression
ERROR: 0:290: 'readSHData' : no matching overloaded function found
ERROR: 0:294: '[]' : array index out of range
ERROR: 0:294: '[]' : array index out of range
ERROR: 0:302: '[]' : array index out of range
ERROR: 0:303: '[]' : array index out of range
ERROR: 0:304: '[]' : array index out of range
ERROR: 0:305: '[]' : array index out of range
ERROR: 0:306: '[]' : array index out of range
ERROR: 0:308: '[]' : array index out of range
ERROR: 0:309: '[]' : array index out of range
ERROR: 0:310: '[]' : array index out of range
ERROR: 0:311: '[]' : array index out of range
ERROR: 0:312: '[]' : array index out of range
ERROR: 0:313: '[]' : array index out of range
ERROR: 0:314: '[]' : array index out of range

283:		#define SH_C3_3 0.3731763325901154f
284:		#define SH_C3_4 -0.4570457994644658f
285:		#define SH_C3_5 1.445305721320277f
286:		#define SH_C3_6 -0.5900435899266435f
287:	vec3 evalSH(in SplatSource source, in vec3 dir) {
288:		vec3 sh[SH_COEFFS];
289:		float scale;
290:		readSHData(source, sh, scale);
291:		float x = dir.x;
292:		float y = dir.y;
293:		float z = dir.z;
 while rendering undefined

I noticed that in files such as src/shaders/infinite-grid-shader.ts and src/shaders/sphere-shape-shader.ts you're using the texture2DLod function which is not supported in webgl fragment shaders. See here

It seems to me that somehow the version of the playcanvas engine that's being built does not match the expected shader code that should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant