File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11import  {  attribute  }  from  '../core/AttributeNode.js' ; 
22import  {  Fn  }  from  '../tsl/TSLCore.js' ; 
3+ import  {  vec3  }  from  '../tsl/TSLBase.js' ; 
34import  {  modelWorldMatrix  }  from  './ModelNode.js' ; 
45
56/** 
@@ -71,4 +72,20 @@ export const positionView = /*@__PURE__*/ ( Fn( ( builder ) => {
7172 * @tsl  
7273 * @type  {VaryingNode<vec3> } 
7374 */ 
74- export  const  positionViewDirection  =  /*@__PURE__ */  positionView . negate ( ) . toVarying (  'v_positionViewDirection'  ) . normalize ( ) . toVar (  'positionViewDirection'  ) ; 
75+ export  const  positionViewDirection  =  /*@__PURE__ */  (  Fn (  (  builder  )  =>  { 
76+ 
77+ 	let  output ; 
78+ 
79+ 	if  (  builder . camera . isOrthographicCamera  )  { 
80+ 
81+ 		output  =  vec3 (  0 ,  0 ,  1  ) ; 
82+ 
83+ 	}  else  { 
84+ 
85+ 		output  =  positionView . negate ( ) . toVarying (  'v_positionViewDirection'  ) . normalize ( ) ; 
86+ 
87+ 	} 
88+ 
89+ 	return  output . toVar (  'positionViewDirection'  ) ; 
90+ 
91+ } ,  'vec3'  ) . once (  [  'POSITION'  ]  )  ) ( ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments