On my laptop, this shader works perfectly fine. However, I'm facing issues on mobile devices and suspect that it might be related to precision settings. Here is the error message I'm encountering:
THREE.WebGLProgram: shader error - 0 35715 false gl.getProgramInfoLog invalid shaders THREE.WebGLShader: gl.getShaderInfoLog() fragment 0:434: S0032: no default precision defined for variable 'float[4]'1: #version 300 es 2: #define varying in 3: out highp vec4 pc_fragColor;
Here's the link to the shader code in the JavaScript tab: https://codepen.io/uiunicorn/pen/QWQrQBB
Full Shader Code:
export const terrain_shader = (function() {
// Vertex Shader
const _VS = `
// Shader logic here...
`;
// Fragment Shader
const _PS = `
// Shader logic here...
`;
// Additional Vertex Shader Components
const _VS_1 = `
// More vertex shader logic...
`;
const _VS_2 = `
// More vertex shader logic...
`;
// Additional Fragment Shader Components
const _PS_1 = `
// More fragment shader logic...
`;
const _PS_2 = `
// More fragment shader logic...
`;
return {
VS: _VS,
PS: _PS,
VS1: _VS_1,
VS2: _VS_2,
PS1: _PS_1,
PS2: _PS_2,
};
})();
Any assistance would be greatly appreciated.
Thank you!