Skip to content

Commit

Permalink
fix: three.js compatibility from @nianxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamfsk committed May 3, 2023
1 parent b2401e4 commit 0ce2974
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/classes/WebGLRenderingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ const mockExtensions = {
ANGLE_instanced_arrays: null,
OES_texture_float_linear: null,
OES_texture_half_float_linear: null,
EXT_blend_minmax: null,
EXT_blend_minmax: {},
EXT_shader_texture_lod: null,
// community
WEBGL_compressed_texture_atc: null,
Expand All @@ -470,7 +470,10 @@ const mockExtensions = {
};

const mockParams = {
34930: 16, // MAX_TEXTURE_IMAGE_UNITS
[mockEnums['MAX_TEXTURE_IMAGE_UNITS']]: 16,
[mockEnums['VERSION']]: 'WebGL 2.0 (OpenGL ES 3.0 Chromium)',
[mockEnums['SCISSOR_BOX']]: new Int32Array([0, 0, 300, 150]),
[mockEnums['VIEWPORT']]: new Int32Array([0, 0, 300, 150]),
};

export default class WebGLRenderingContext {
Expand Down Expand Up @@ -501,4 +504,12 @@ export default class WebGLRenderingContext {
getContextAttributes() {
return this._contextAttributes;
}

getShaderPrecisionFormat() {
return {
rangeMin: 127,
rangeMax: 127,
precision: 23,
};
}
}

0 comments on commit 0ce2974

Please sign in to comment.