Просмотр исходного кода

SSRNode: Add temporary fix for Chrome. (#29875)

Michael Herzog 1 год назад
Родитель
Сommit
3e29a395ce
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      examples/jsm/tsl/display/SSRNode.js

+ 8 - 1
examples/jsm/tsl/display/SSRNode.js

@@ -155,7 +155,7 @@ class SSRNode extends TempNode {
 
 			const metalness = this.metalnessNode.uv( uvNode ).r;
 
-			 // fragments with no metalness do not reflect their environment
+			// fragments with no metalness do not reflect their environment
 			metalness.equal( 0.0 ).discard();
 
 			// compute some standard FX entities
@@ -214,6 +214,13 @@ class SSRNode extends TempNode {
 			// it does not exceed d1 (the maximum ray extend)
 			Loop( { start: int( 0 ), end: int( this._maxStep ), type: 'int', condition: '<' }, ( { i } ) => {
 
+				// TODO: Remove this when Chrome is fixed, see https://issues.chromium.org/issues/372714384#comment14
+				If( metalness.equal( 0 ), () => {
+
+					Break();
+
+				} );
+
 				// stop if the maximum number of steps is reached for this specific ray
 				If( float( i ).greaterThanEqual( totalStep ), () => {
 

粤ICP备19079148号