Skip to content

Commit

Permalink
WebGLRenderer: add reverse-z via EXT_clip_control (#1231)
Browse files Browse the repository at this point in the history
* WebGLRenderer: add reverse-z via EXT_clip_control

* Update

---------

Co-authored-by: Nathan Bierema <nbierema@gmail.com>
  • Loading branch information
CodyJasonBennett and Methuselah96 authored Sep 25, 2024
1 parent d50dbd8 commit f55fa09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 2 additions & 12 deletions types/three/src/renderers/WebGLRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Scene } from "../scenes/Scene.js";
import { Data3DTexture } from "../textures/Data3DTexture.js";
import { DataArrayTexture } from "../textures/DataArrayTexture.js";
import { OffscreenCanvas, Texture } from "../textures/Texture.js";
import { WebGLCapabilities } from "./webgl/WebGLCapabilities.js";
import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCapabilities.js";
import { WebGLExtensions } from "./webgl/WebGLExtensions.js";
import { WebGLInfo } from "./webgl/WebGLInfo.js";
import { WebGLProgram } from "./webgl/WebGLProgram.js";
Expand All @@ -33,7 +33,7 @@ export interface Renderer {
setSize(width: number, height: number, updateStyle?: boolean): void;
}

export interface WebGLRendererParameters {
export interface WebGLRendererParameters extends WebGLCapabilitiesParameters {
/**
* A Canvas where the renderer draws its output.
*/
Expand All @@ -46,11 +46,6 @@ export interface WebGLRendererParameters {
*/
context?: WebGLRenderingContext | undefined;

/**
* shader precision. Can be "highp", "mediump" or "lowp".
*/
precision?: string | undefined;

/**
* default is false.
*/
Expand Down Expand Up @@ -86,11 +81,6 @@ export interface WebGLRendererParameters {
*/
depth?: boolean | undefined;

/**
* default is false.
*/
logarithmicDepthBuffer?: boolean | undefined;

/**
* default is false.
*/
Expand Down
13 changes: 13 additions & 0 deletions types/three/src/renderers/webgl/WebGLCapabilities.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { PixelFormat, TextureDataType } from "../../constants.js";

export interface WebGLCapabilitiesParameters {
/**
* shader precision. Can be "highp", "mediump" or "lowp".
*/
precision?: string | undefined;

/**
* default is false.
*/
logarithmicDepthBuffer?: boolean | undefined;

/**
* default is false.
*/
reverseDepthBuffer?: boolean | undefined;
}

export class WebGLCapabilities {
Expand All @@ -18,6 +30,7 @@ export class WebGLCapabilities {

precision: string;
logarithmicDepthBuffer: boolean;
reverseDepthBuffer: boolean;

maxTextures: number;
maxVertexTextures: number;
Expand Down

0 comments on commit f55fa09

Please sign in to comment.