浏览代码

Merge branch 'hackweek2017' of https://github.com/stramit/MaterialGraph into hackweek2017

/main
ChrisTchou 8 年前
当前提交
211cce2b
共有 9 个文件被更改,包括 368 次插入6 次删除
  1. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GradientNodePresenter.cs
  2. 10
      MaterialGraphProject/Assets/Vlad/TextureAssetNode.cs
  3. 1
      MaterialGraphProject/Assets/_MingWai/GradientNode.cs
  4. 247
      MaterialGraphProject/Assets/TestAssets/BW_logo.png
  5. 84
      MaterialGraphProject/Assets/TestAssets/BW_logo.png.meta
  6. 1
      MaterialGraphProject/Assets/_MingWai/Gradient.ShaderGraph
  7. 9
      MaterialGraphProject/Assets/_MingWai/Gradient.ShaderGraph.meta
  8. 1
      MaterialGraphProject/Assets/_MingWai/Gradient_Texture.ShaderGraph
  9. 9
      MaterialGraphProject/Assets/_MingWai/Gradient_Texture.ShaderGraph.meta

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GradientNodePresenter.cs


[Serializable]
class GradientContolPresenter : GraphControlPresenter
{
[SerializeField]
[SerializeField]
[SerializeField]
private UnityEngine.MaterialGraph.GradientNode prevnode;
private string prevWindow = "";

{
prevnode = cNode;
gradientobj = new GradientObject();
if (cNode.gradient != null)
{
gradientobj.gradient = cNode.gradient;
}
hserializedObject = new SerializedObject(gradientobj);
hcolorGradient = hserializedObject.FindProperty("gradient");
}

}
}
[Serializable]
public class GradientObject : ScriptableObject
{
public Gradient gradient = new Gradient();

10
MaterialGraphProject/Assets/Vlad/TextureAssetNode.cs


public override void GeneratePropertyUsages(ShaderGenerator visitor, GenerationMode generationMode)
{
var slotTexture2D = FindInputSlot<MaterialSlot>(0);
var slotTexture2D = FindOutputSlot<MaterialSlot>(0);
if (slotTexture2D != null)
{
var edgesTexture2D = owner.GetEdges(slotTexture2D.slotReference).ToList();

visitor.AddShaderChunk("Texture2D " + propertyName + "_T2D;", true);
visitor.AddShaderChunk("Texture2D " + propertyName + ";", true);
var slotSampler2D = FindInputSlot<MaterialSlot>(0);
var slotSampler2D = FindOutputSlot<MaterialSlot>(1);
var edgesSampler2D = owner.GetEdges(slotTexture2D.slotReference).ToList();
var edgesSampler2D = owner.GetEdges(slotSampler2D.slotReference).ToList();
visitor.AddShaderChunk("Sampler2D " + propertyName + "_S2D;", true);
visitor.AddShaderChunk("sampler2D " + propertyName + ";", true);
}
}
}

1
MaterialGraphProject/Assets/_MingWai/GradientNode.cs


[SerializeField]
private Gradient m_gradient;
public Gradient gradient
{
get { return m_gradient; }

247
MaterialGraphProject/Assets/TestAssets/BW_logo.png

之前 之后
宽度: 256  |  高度: 256  |  大小: 36 KiB

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


fileFormatVersion: 2
guid: 8080b3773b9568a46bcaaf9b18512990
timeCreated: 1495742078
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
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: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

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

9
MaterialGraphProject/Assets/_MingWai/Gradient.ShaderGraph.meta


fileFormatVersion: 2
guid: 12adeac2a3368e94f9889377e4d426c2
timeCreated: 1495742113
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

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

9
MaterialGraphProject/Assets/_MingWai/Gradient_Texture.ShaderGraph.meta


fileFormatVersion: 2
guid: ff2b03d7feb67a145835ad8adae9e0ad
timeCreated: 1495742113
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
正在加载...
取消
保存