Hi,
I´m trying to use derivatives in my shader code, to avoid seams produced by Mipmaps in an equirectangular panorama view. I need to access “fwidth” function, but I had no success with this.
Does someone know how to solve this?
var vertexShader = this.vs.resource;
var fragmentShader = "#extension GL_OES_standard_derivatives : enable \n\n" + "precision " + gd.precision + " float;\n";// +
fragmentShader = fragmentShader + this.fs.resource;
// A shader definition used to create a new shader.
var shaderDefinition = {
attributes: {
aPosition: pc.SEMANTIC_POSITION
},
vshader: vertexShader,
fshader: fragmentShader
};
// Create the shader from the definition
this.shader = new pc.Shader(gd, shaderDefinition);
// Create a new material and set the shader
this.material = new pc.Material();
this.material.shader = this.shader;
ERROR Message:
Failed to compile fragment shader:
WARNING: 0:1: 'GL_OES_standard_derivatives' : extension is not supported
ERROR: 0:53: 'fWidth' : no matching overloaded function found
ERROR: 0:53: 'fWidth' : no matching overloaded function found
1: #extension GL_OES_standard_derivatives : enable
2:
3: precision highp float;
4: #define M_PI 3.1415926535897932384626433832795
5:
6:
7: varying vec4 vertex;