浏览代码

Fix morphTarget code generation (nme)

David Catuhe 5 年之前
父节点
当前提交
edd0b9d792
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Materials/Node/Blocks/Vertex/morphTargetsBlock.ts

+ 6 - 0
src/Materials/Node/Blocks/Vertex/morphTargetsBlock.ts

@@ -254,12 +254,18 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
         state.compilationString += `${this._declareOutput(positionOutput, state)} = ${position.associatedVariableName};\r\n`;
         state.compilationString += `#ifdef NORMAL\r\n`;
         state.compilationString += `${this._declareOutput(normalOutput, state)} = ${normal.associatedVariableName};\r\n`;
+        state.compilationString += `#else\r\n`;
+        state.compilationString += `${this._declareOutput(normalOutput, state)} = vec3(0., 0., 0.);\r\n`;
         state.compilationString += `#endif\r\n`;
         state.compilationString += `#ifdef TANGENT\r\n`;
         state.compilationString += `${this._declareOutput(tangentOutput, state)} = ${tangent.associatedVariableName};\r\n`;
+        state.compilationString += `#else\r\n`;
+        state.compilationString += `${this._declareOutput(tangentOutput, state)} = vec3(0., 0., 0.);\r\n`;        
         state.compilationString += `#endif\r\n`;
         state.compilationString += `#ifdef UV1\r\n`;
         state.compilationString += `${this._declareOutput(uvOutput, state)} = ${uv.associatedVariableName};\r\n`;
+        state.compilationString += `#else\r\n`;
+        state.compilationString += `${this._declareOutput(uvOutput, state)} = vec2(0., 0.);\r\n`;             
         state.compilationString += `#endif\r\n`;
 
         // Repeatable content