Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xBimTeam/XbimWebUI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f1b12c8a919dcc2210234b2d33222103f1d34881
Choose a base ref
..
head repository: xBimTeam/XbimWebUI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ab9f9a032c2afe149f2b43358446114250d7bb44
Choose a head ref
Showing with 8 additions and 11 deletions.
  1. +8 −11 src/framebuffer.ts
19 changes: 8 additions & 11 deletions src/framebuffer.ts
Original file line number Diff line number Diff line change
@@ -72,19 +72,16 @@ export class Framebuffer {
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);

//If the stencil bit is 8 bits or more, set to record the depth texture with DEPTH24_STENCIL8 if available (24+8 expands to a total of 32 bits to record depth => needs confirmation)
if(Framebuffer.glContextStencilBits >= 8) {
if (this._glVersion === 1) {
//32bit(24+8) precision
gl.texImage2D(gl.TEXTURE_2D, 0, gl["UNSIGNED_INT_24_8"], width, height, 0, gl.DEPTH_STENCIL, gl["UNSIGNED_INT_24_8"], null);
}else{
//32bit(24+8) precision
gl.texImage2D(gl.TEXTURE_2D, 0, gl["DEPTH24_STENCIL8"], width, height, 0, gl.DEPTH_STENCIL, gl["UNSIGNED_INT_24_8"], null);
}
} else if (this._glVersion === 1) {
if (this._glVersion === 1) {
//8bit precision
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, width, height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null);
} else {
}
else if(Framebuffer.glContextStencilBits >= 8) {
//If the stencil bit is 8 bits or more, set to record the depth texture with DEPTH24_STENCIL8 if available (24+8 expands to a total of 32 bits to record depth => needs confirmation)
//DEPTH24_STENCIL8 only available at glVersion 2
gl.texImage2D(gl.TEXTURE_2D, 0, gl["DEPTH24_STENCIL8"], width, height, 0, gl.DEPTH_STENCIL, gl["UNSIGNED_INT_24_8"], null);
}
else {
//16bit precision
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT16, width, height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null);
}