diff --git a/docs/api/en/renderers/WebGLRenderer.html b/docs/api/en/renderers/WebGLRenderer.html index 183a0bb7626df3b6dc6d6e1dd581d8c47fa9024f..9cbbd84ad2683f4a6a4c4559df05872d5d369363 100644 --- a/docs/api/en/renderers/WebGLRenderer.html +++ b/docs/api/en/renderers/WebGLRenderer.html @@ -365,6 +365,16 @@
Returns current device pixel ratio used.
+
+ [page:Vector4 target] — the result will be copied into this Vector4.
+
+ Returns the scissor region.
+
Returns *true* if scissor test is enabled; returns *false* otherwise.
+
[page:Vector2 target] — the result will be copied into this Vector2.
diff --git a/src/renderers/WebGLRenderer.d.ts b/src/renderers/WebGLRenderer.d.ts
index f99ecf4015fd8a5c36c8b07e7a273231aa81f3fe..f42ab91ce3d72a8a96c4bb6fea48de59cc199135 100644
--- a/src/renderers/WebGLRenderer.d.ts
+++ b/src/renderers/WebGLRenderer.d.ts
@@ -227,11 +227,21 @@ export class WebGLRenderer implements Renderer {
*/
setViewport(x: Vector4 | number, y?: number, width?: number, height?: number): void;
+ /**
+ * Copies the scissor area into target.
+ */
+ getScissor(target: Vector4): Vector4;
+
/**
* Sets the scissor area from (x, y) to (x + width, y + height).
*/
setScissor(x: number, y: number, width: number, height: number): void;
+ /**
+ * Returns true if scissor test is enabled; returns false otherwise.
+ */
+ getScissorTest(): boolean;
+
/**
* Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
*/
diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js
index 89dcf18ab0a77b96f70b232332575938b748be85..2f785697b70d843706aec74b37748a8845d06c42 100644
--- a/src/renderers/WebGLRenderer.js
+++ b/src/renderers/WebGLRenderer.js
@@ -466,6 +466,12 @@ function WebGLRenderer( parameters ) {
};
+ this.getScissor = function ( target ) {
+
+ return target.copy( _scissor );
+
+ };
+
this.setScissor = function ( x, y, width, height ) {
_scissor.set( x, y, width, height );
@@ -473,6 +479,12 @@ function WebGLRenderer( parameters ) {
};
+ this.getScissorTest = function () {
+
+ return _scissorTest;
+
+ };
+
this.setScissorTest = function ( boolean ) {
state.setScissorTest( _scissorTest = boolean );