浏览代码

-Toggle node added, works aside from it needs [toggle] in front of the shader property

-Created a Flow-map ShaderGraph, needs to be transferred to a subgraph once they are fixed
/main
Andre McGrail 8 年前
当前提交
cdcf8c8e
共有 8 个文件被更改,包括 754 次插入9 次删除
  1. 8
      MaterialGraphProject/Assets/Andre/Editor/ToggleNodePresenter.cs
  2. 5
      MaterialGraphProject/Assets/Andre/New Material.mat
  3. 2
      MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph
  4. 11
      MaterialGraphProject/Assets/Andre/ToggleNode.cs
  5. 1
      MaterialGraphProject/Assets/Andre/FlowMap.ShaderGraph
  6. 9
      MaterialGraphProject/Assets/Andre/FlowMap.ShaderGraph.meta
  7. 643
      MaterialGraphProject/Assets/TestAssets/flowmap.png
  8. 84
      MaterialGraphProject/Assets/TestAssets/flowmap.png.meta

8
MaterialGraphProject/Assets/Andre/Editor/ToggleNodePresenter.cs


using System.Collections.Generic;
using RMGUI.GraphView;
using UnityEditor.Graphing.Drawing;
using UnityEngine;
using UnityEngine.MaterialGraph;
namespace UnityEditor.MaterialGraph.Drawing

{
base.OnGUIHandler();
var cNode = node as BlendModeNode;
var cNode = node as ToggleNode;
cNode.blendMode = (BlendModesEnum)EditorGUILayout.EnumPopup("", cNode.blendMode);
cNode.value = EditorGUILayout.Toggle(cNode.value);
cNode.exposedState = (PropertyNode.ExposedState)EditorGUILayout.EnumPopup(new GUIContent("Exposed"), cNode.exposedState);
}
/* public override float GetHeight()

*/
public override float GetHeight()
{
return 3 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
return 2 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
}
}

5
MaterialGraphProject/Assets/Andre/New Material.mat


m_Texture: {fileID: 10305, guid: 0000000000000000f000000000000000, type: 0}
m_Scale: {x: 1, y: 2}
m_Offset: {x: 0, y: 0}
- Texture_7e044bc6_b639_4457_83f6_752bfaedcb11_Uniform:
m_Texture: {fileID: 2800000, guid: 330f42016073a97418a4aae5517e32c8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Toggle_bda28932_b1ab_4b0b_ba54_ca5db612047a_Uniform: 0
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1

2
MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph
文件差异内容过多而无法显示
查看文件

11
MaterialGraphProject/Assets/Andre/ToggleNode.cs


{
[SerializeField]
private float m_Float;
private bool m_ToggleState;
private const int kOutputSlotId = 0;
private const string kOutputSlotName = "Ouput";

get { return PropertyType.Float; }
}
public float value
public bool value
get { return m_Float; }
get { return m_ToggleState; }
if (m_Float == value)
if (m_ToggleState == value)
m_Float = value;
m_ToggleState = value;
if (onModified != null)
{
onModified(this, ModificationScope.Node);

{
m_Name = propertyName,
m_PropType = PropertyType.Float,
m_Float = value
m_Float = value ? 1f : 0f
};
}
}

1
MaterialGraphProject/Assets/Andre/FlowMap.ShaderGraph
文件差异内容过多而无法显示
查看文件

9
MaterialGraphProject/Assets/Andre/FlowMap.ShaderGraph.meta


fileFormatVersion: 2
guid: 78cd4aa6317ee45c1a7e853fbab1e808
timeCreated: 1495548280
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

643
MaterialGraphProject/Assets/TestAssets/flowmap.png

之前 之后
宽度: 1024  |  高度: 1024  |  大小: 169 KiB

84
MaterialGraphProject/Assets/TestAssets/flowmap.png.meta


fileFormatVersion: 2
guid: 8a17a00c2a071472cb92f6911bb7be11
timeCreated: 1495551094
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存