浏览代码

Adding correct default values for fractals

/main
Eduardo Chaves 8 年前
当前提交
20b3d107
共有 3 个文件被更改,包括 9 次插入9 次删除
  1. 4
      MaterialGraphProject/Assets/Eduardo/FunctionNAddNode.cs
  2. 4
      MaterialGraphProject/Assets/Eduardo/FunctionNInNOut.cs
  3. 10
      MaterialGraphProject/Assets/Rinaldo/FractalNode.cs

4
MaterialGraphProject/Assets/Eduardo/FunctionNAddNode.cs


public void AddInputSlot()
{
string inputName = "Input" + GetInputSlots<MaterialSlot>().Count().ToString();
AddSlot(inputName, inputName, Graphing.SlotType.Input, SlotValueType.Dynamic);
AddSlot(inputName, inputName, Graphing.SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
}
public AddManyNode()

AddInputSlot();
}
AddSlot("Sum", "finalSum", Graphing.SlotType.Output, SlotValueType.Dynamic);
AddSlot("Sum", "finalSum", Graphing.SlotType.Output, SlotValueType.Dynamic, Vector4.zero);
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/Eduardo/FunctionNInNOut.cs


}
}
public int AddSlot(string displayName, string nameInShader, SlotType slotType, SlotValueType valueType)
public int AddSlot(string displayName, string nameInShader, SlotType slotType, SlotValueType valueType, Vector4 defaultValue)
{
int nextSlotId;
if (slotType == SlotType.Output)

AddSlot(new MaterialSlot(nextSlotId, displayName, nameInShader, slotType, valueType, Vector4.zero, true));
AddSlot(new MaterialSlot(nextSlotId, displayName, nameInShader, slotType, valueType, defaultValue, true));
return nextSlotId;
}

10
MaterialGraphProject/Assets/Rinaldo/FractalNode.cs


public FractalNode()
{
name = "Fractal";
AddSlot("UV", "texCoord", Graphing.SlotType.Input, SlotValueType.Vector2);
AddSlot("Pan", "Pan", Graphing.SlotType.Input, SlotValueType.Vector2);
AddSlot("Zoom", "Zoom", Graphing.SlotType.Input, SlotValueType.Vector1);
AddSlot("Aspect", "Aspect", Graphing.SlotType.Input, SlotValueType.Vector1);
AddSlot("UV", "texCoord", Graphing.SlotType.Input, SlotValueType.Vector2, Vector4.zero);
AddSlot("Pan", "Pan", Graphing.SlotType.Input, SlotValueType.Vector2, new Vector4(0.5f,0,0,0));
AddSlot("Zoom", "Zoom", Graphing.SlotType.Input, SlotValueType.Vector1, new Vector4(3,0,0,0));
AddSlot("Aspect", "Aspect", Graphing.SlotType.Input, SlotValueType.Vector1, new Vector4(0.9f,0,0,0));
AddSlot("FracResult", "fractalRes", Graphing.SlotType.Output, SlotValueType.Dynamic);
AddSlot("FracResult", "fractalRes", Graphing.SlotType.Output, SlotValueType.Dynamic, Vector4.zero);
UpdateNodeAfterDeserialization();
}

正在加载...
取消
保存