files/en-us/web/api/webglrenderingcontext/hint/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGLRenderingContext.hint() method of the WebGL API specifies hints for certain
behaviors. The interpretation of these hints depend on the implementation.
hint(target, mode)
target
: Sets which behavior to be controlled. Possible values:
gl.GENERATE_MIPMAP_HINT
When using the {{domxref("OES_standard_derivatives")}} extension:
ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES
dFdx,
dFdy, and fwidth.When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally:
gl.FRAGMENT_SHADER_DERIVATIVE_HINT
ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OESmode
gl.DONT_CARE. The possible
values are:
gl.FASTEST: The most efficient behavior should be used.gl.NICEST: The most correct or the highest quality option should be
used.gl.DONT_CARE: There is no preference for this behavior.None ({{jsxref("undefined")}}).
The following example hints that the quality of filtering when generating mipmap images should be most efficient instead of the best quality.
gl.hint(gl.GENERATE_MIPMAP_HINT, gl.FASTEST);
{{Specifications}}
{{Compat}}