Tim Cooper
7 年前
当前提交
ccf49055
共有 10 个文件被更改,包括 147 次插入 和 309 次删除
-
2.gitignore
-
10MaterialGraphProject/Assets/NewNodes/Editor/Keep/GradientNode.cs
-
6MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
-
273MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs
-
2MaterialGraphProject/ProjectSettings/QualitySettings.asset
-
27MaterialGraphProject/Assets/graphs_PartyPreview.mat
-
8MaterialGraphProject/Assets/graphs_PartyPreview.mat.meta
-
32MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs.meta
-
84MaterialGraphProject/GeneratedShader.shader
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: graphs_PartyPreview |
|||
m_Shader: {fileID: 4800000, guid: e67b8be7b087145ab87b7ae0a690c35e, type: 3} |
|||
m_ShaderKeywords: |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- Texture_507A46B3: |
|||
m_Texture: {fileID: 2800000, guid: a653bbc25cc7e4794829cf7b1184abcb, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- Float_D2D9489B: 3.3 |
|||
m_Colors: [] |
|
|||
fileFormatVersion: 2 |
|||
guid: 7f7b583966bf341438cffacfeba751eb |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEditor.Experimental.UIElements.GraphView; |
|||
using UnityEditor.MaterialGraph.Drawing; |
|||
using UnityEngine; |
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing |
|||
{ |
|||
[Serializable] |
|||
public abstract class GraphControlPresenter : ScriptableObject |
|||
{ |
|||
public INode node { get; private set; } |
|||
|
|||
protected GraphControlPresenter() |
|||
{} |
|||
|
|||
public void Initialize(INode inNode) |
|||
{ |
|||
node = inNode; |
|||
} |
|||
|
|||
public virtual void OnGUIHandler() |
|||
{ |
|||
if (node == null) |
|||
return; |
|||
|
|||
GUIUtility.GetControlID(node.guid.GetHashCode(), FocusType.Passive); |
|||
} |
|||
|
|||
public abstract float GetHeight(); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 070b72651e4f90b478ca6f031541065e |
|||
timeCreated: 1476707366 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "hidden/preview/Fractal_70AE3FBF" |
|||
{ |
|||
Properties |
|||
{ |
|||
} |
|||
CGINCLUDE |
|||
#include "UnityCG.cginc" |
|||
void Unity_Fractal_float(float2 uv, float2 pan, float zoom, float aspect, out float result) |
|||
{ |
|||
const int Iterations = 128; |
|||
float2 c = (uv - 0.5) * zoom * float2(1, aspect) - pan; |
|||
float2 v = 0; |
|||
for (int n = 0; n < Iterations && dot(v,v) < 4; n++) |
|||
{ |
|||
v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c; |
|||
} |
|||
result = (dot(v, v) > 4) ? (float)n / (float)Iterations : 0; |
|||
} |
|||
struct GraphVertexInput |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float3 normal : NORMAL; |
|||
float4 tangent : TANGENT; |
|||
float4 texcoord0 : TEXCOORD0; |
|||
float4 lightmapUV : TEXCOORD1; |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
}; |
|||
struct SurfaceInputs{ |
|||
half4 uv0; |
|||
}; |
|||
struct SurfaceDescription{ |
|||
float Fractal_70AE3FBF_result; |
|||
}; |
|||
float4 Fractal_70AE3FBF_uv; |
|||
float4 Fractal_70AE3FBF_pan; |
|||
float Fractal_70AE3FBF_zoom; |
|||
float Fractal_70AE3FBF_aspect; |
|||
GraphVertexInput PopulateVertexData(GraphVertexInput v){ |
|||
return v; |
|||
} |
|||
SurfaceDescription PopulateSurfaceData(SurfaceInputs IN) { |
|||
half4 uv0 = IN.uv0; |
|||
float Fractal_70AE3FBF_result; |
|||
Unity_Fractal_float(uv0, Fractal_70AE3FBF_pan, Fractal_70AE3FBF_zoom, Fractal_70AE3FBF_aspect, Fractal_70AE3FBF_result); |
|||
SurfaceDescription surface = (SurfaceDescription)0; |
|||
surface.Fractal_70AE3FBF_result = Fractal_70AE3FBF_result; |
|||
return surface; |
|||
} |
|||
ENDCG |
|||
SubShader |
|||
{ |
|||
Tags { "RenderType"="Opaque" } |
|||
LOD 100 |
|||
Pass |
|||
{ |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
#include "UnityCG.cginc" |
|||
struct GraphVertexOutput |
|||
{ |
|||
float4 position : POSITION; |
|||
half4 uv0 : TEXCOORD; |
|||
}; |
|||
GraphVertexOutput vert (GraphVertexInput v) |
|||
{ |
|||
v = PopulateVertexData(v); |
|||
GraphVertexOutput o; |
|||
o.position = UnityObjectToClipPos(v.vertex); |
|||
o.uv0 = v.texcoord0; |
|||
return o; |
|||
} |
|||
fixed4 frag (GraphVertexOutput IN) : SV_Target |
|||
{ |
|||
float4 uv0 = IN.uv0; |
|||
SurfaceInputs surfaceInput = (SurfaceInputs)0;; |
|||
surfaceInput.uv0 =uv0; |
|||
SurfaceDescription surf = PopulateSurfaceData(surfaceInput); |
|||
return half4(surf.Fractal_70AE3FBF_result, surf.Fractal_70AE3FBF_result, surf.Fractal_70AE3FBF_result, 1.0); |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue