Skip to content

Commit

Permalink
WebGLRenderer: Stable reversed Z buffer implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Nov 10, 2024
1 parent 054f347 commit 665acd0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions types/three/src/renderers/webgl/WebGLState.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ import {
import { Material } from "../../materials/Material.js";
import { Vector4 } from "../../math/Vector4.js";
import { WebGLRenderTarget } from "../WebGLRenderTarget.js";
import { WebGLExtensions } from "./WebGLExtensions.js";

export class WebGLColorBuffer {
constructor();

declare class ColorBuffer {
setMask(colorMask: boolean): void;
setLocked(lock: boolean): void;
setClear(r: number, g: number, b: number, a: number, premultipliedAlpha: boolean): void;
reset(): void;
}

export class WebGLDepthBuffer {
declare class DepthBuffer {
constructor();

setReversed(value: boolean): void;
getReversed(): boolean;
setTest(depthTest: boolean): void;
setMask(depthMask: boolean): void;
setFunc(depthFunc: DepthModes): void;
Expand All @@ -30,7 +31,7 @@ export class WebGLDepthBuffer {
reset(): void;
}

export class WebGLStencilBuffer {
declare class StencilBuffer {
constructor();

setTest(stencilTest: boolean): void;
Expand All @@ -43,12 +44,12 @@ export class WebGLStencilBuffer {
}

export class WebGLState {
constructor(gl: WebGLRenderingContext);
constructor(gl: WebGLRenderingContext, extensions: WebGLExtensions);

buffers: {
color: WebGLColorBuffer;
depth: WebGLDepthBuffer;
stencil: WebGLStencilBuffer;
color: ColorBuffer;
depth: DepthBuffer;
stencil: StencilBuffer;
};

enable(id: number): void;
Expand Down

0 comments on commit 665acd0

Please sign in to comment.