瀏覽代碼

makes all shadings honor viewport camera (#28426)

ycw 1 年之前
父節點
當前提交
6651acfd87
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      editor/js/Viewport.js

+ 4 - 4
editor/js/Viewport.js

@@ -633,8 +633,7 @@ function Viewport( editor ) {
 
 		if ( viewportCamera.isPerspectiveCamera ) {
 
-			viewportCamera.aspect = editor.camera.aspect;
-			viewportCamera.projectionMatrix.copy( editor.camera.projectionMatrix );
+			updateAspectRatio();
 
 		} else if ( viewportCamera.isOrthographicCamera ) {
 
@@ -646,6 +645,7 @@ function Viewport( editor ) {
 
 		controls.enabled = ( viewportCamera === editor.camera );
 
+		initPT();
 		render();
 
 	} );
@@ -657,7 +657,7 @@ function Viewport( editor ) {
 		switch ( viewportShading ) {
 
 			case 'realistic':
-				pathtracer.init( scene, camera );
+				pathtracer.init( scene, editor.viewportCamera );
 				break;
 
 			case 'solid':
@@ -768,7 +768,7 @@ function Viewport( editor ) {
 
 		if ( editor.viewportShading === 'realistic' ) {
 
-			pathtracer.init( scene, camera );
+			pathtracer.init( scene, editor.viewportCamera );
 
 		}