Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLRenderer: add reverse-z via EXT_clip_control #1231

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading