Skip to content

Commit

Permalink
makes all shadings honor viewport camera (#28426)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw authored May 20, 2024
1 parent a620f3f commit 6651acf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/js/Viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

Expand All @@ -646,6 +645,7 @@ function Viewport( editor ) {

controls.enabled = ( viewportCamera === editor.camera );

initPT();
render();

} );
Expand All @@ -657,7 +657,7 @@ function Viewport( editor ) {
switch ( viewportShading ) {

case 'realistic':
pathtracer.init( scene, camera );
pathtracer.init( scene, editor.viewportCamera );
break;

case 'solid':
Expand Down Expand Up @@ -768,7 +768,7 @@ function Viewport( editor ) {

if ( editor.viewportShading === 'realistic' ) {

pathtracer.init( scene, camera );
pathtracer.init( scene, editor.viewportCamera );

}

Expand Down

0 comments on commit 6651acf

Please sign in to comment.