David Catuhe пре 5 година
родитељ
комит
f5dc84bc08

+ 1 - 0
nodeEditor/src/graphEditor.tsx

@@ -342,6 +342,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
         }
 
         try {
+            this.props.globalState.nodeMaterial.options.emitComments = true;
             this.props.globalState.nodeMaterial.build(true);
             this.props.globalState.onLogRequiredObservable.notifyObservers(new LogEntry("Node material build successful", false));
         }

+ 1 - 1
src/Materials/Node/Blocks/colorMergerBlock.ts

@@ -14,7 +14,7 @@ export class ColorMergerBlock extends NodeMaterialBlock {
      * @param name defines the block name
      */
     public constructor(name: string) {
-        super(name, NodeMaterialBlockTargets.Fragment);
+        super(name, NodeMaterialBlockTargets.Neutral);
 
         this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true);
         this.registerInput("r", NodeMaterialBlockConnectionPointTypes.Float, true);

+ 1 - 1
src/Materials/Node/Blocks/colorSplitterBlock.ts

@@ -15,7 +15,7 @@ export class ColorSplitterBlock extends NodeMaterialBlock {
      * @param name defines the block name
      */
     public constructor(name: string) {
-        super(name, NodeMaterialBlockTargets.Fragment);
+        super(name, NodeMaterialBlockTargets.Neutral);
 
         this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, true);
         this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true);

+ 1 - 0
src/Materials/Node/nodeMaterialBlock.ts

@@ -413,6 +413,7 @@ export class NodeMaterialBlock {
         const otherBlockWasGeneratedInVertexShader = block._buildTarget === NodeMaterialBlockTargets.Vertex && block.target !== NodeMaterialBlockTargets.VertexAndFragment;
 
         if (localBlockIsFragment && (
+            ((block.target & block._buildTarget) === 0) ||
             ((block.target & input.target) === 0) ||
             (this.target !== NodeMaterialBlockTargets.VertexAndFragment && otherBlockWasGeneratedInVertexShader)
             )) { // context switch! We need a varying