Matt Dean
7 年前
当前提交
6617bfcf
共有 28 个文件被更改,包括 1312 次插入 和 630 次删除
-
2MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/CGIncludes/LightweightFastBlinn.cginc
-
8MaterialGraphProject/Assets/TestAssets/bricks_normal.tga.meta
-
32MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/lightweightSubshaderPBR.template
-
102MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/AbstractLightweightPBRMasterNode.cs
-
179MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/ShaderTest.unity
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-Legacy.mat
-
10MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-PBR.mat
-
378MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/MetallicTest.ShaderGraph
-
15MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/MetallicTest.ShaderGraph.meta
-
378MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/SpecularTest.ShaderGraph
-
15MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/SpecularTest.ShaderGraph.meta
-
10MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials.meta
-
133MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/TestGraph-PBRMetallic.mat
-
133MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/TestGraph-PBRSpecular.mat
-
10MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/TestGraph-PBRSpecular.mat.meta
-
11MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/GraphTest.shader.meta
-
334MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/GraphTest.shader
-
77MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/TestyTest.ShaderGraph
-
11MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/TestyTest.ShaderGraph.meta
-
102MaterialGraphProject/Assets/TestGraph-PBR.mat
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-Legacy.mat
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-Legacy.mat.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-PBR.mat.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-Unlit.mat
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-Unlit.mat.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/TestGraph-PBRMetallic.mat.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/LightweightPipeline/Materials/Test-PBR.mat
378
MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/MetallicTest.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 02a3ca69ec995e94aa47105621a17e4c |
|||
timeCreated: 1505497637 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: |
|||
- Texture2D_Texture2D_AEB21289_Uniform: {fileID: 2800000, guid: 6e8d12f68bae2294da814f9d4c81b29a, |
|||
type: 3} |
|||
- Texture2D_Texture2D_87733D67_Uniform: {fileID: 2800000, guid: 3f3b8bdf3ccd30c4fb97b62bd26ef1f6, |
|||
type: 3} |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
378
MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/SpecularTest.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: a96bafc6e4c6e7c4ca1fb43c905d7948 |
|||
timeCreated: 1505498093 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: |
|||
- Texture2D_Texture2D_AEB21289_Uniform: {fileID: 2800000, guid: 6e8d12f68bae2294da814f9d4c81b29a, |
|||
type: 3} |
|||
- Texture2D_Texture2D_87733D67_Uniform: {fileID: 2800000, guid: 3f3b8bdf3ccd30c4fb97b62bd26ef1f6, |
|||
type: 3} |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 19fc28fd8cfc0e24185139d888b580e0 |
|||
folderAsset: yes |
|||
timeCreated: 1505498024 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: TestGraph-PBRMetallic |
|||
m_Shader: {fileID: 4800000, guid: 02a3ca69ec995e94aa47105621a17e4c, type: 3} |
|||
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLIC_SETUP _SPECULARHIGHLIGHTS_ON |
|||
m_LightmapFlags: 2 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- Texture2D_Texture2D_2A5875FB_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 618126695341ad844ac048b062fd2688, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_30A72685_Uniform: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_6C206BFC_Uniform: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_87733D67_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: d63435d934a30fd439a005c25fa542f0, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_9508545D_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 330f42016073a97418a4aae5517e32c8, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_AEB21289_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 6e8d12f68bae2294da814f9d4c81b29a, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_FE1ED0E8_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 1085d6f82e40b31428079b25ebee7d74, 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_Offset: {x: 0, y: 0} |
|||
- _Cube: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailAlbedoMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMask: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicSpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OcclusionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ParallaxMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- Vector1_Vector1_20D3DC06_Uniform: 1 |
|||
- Vector1_Vector1_4B0AEC3F_Uniform: 0.5 |
|||
- Vector1_Vector1_5370E8F3_Uniform: 1 |
|||
- Vector1_Vector1_69199BC_Uniform: 0 |
|||
- Vector1_Vector1_72A1F5A1_Uniform: 1 |
|||
- Vector1_Vector1_7EC3DCBC_Uniform: 0.5 |
|||
- _BumpScale: 1 |
|||
- _Cutoff: 0.5 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DstBlend: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 1 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 1 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 0.5 |
|||
- _Parallax: 0.02 |
|||
- _ReflectionSource: 0 |
|||
- _Shininess: 1 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _UVSec: 0 |
|||
- _WorkflowMode: 1 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- Color_Color_4467EDF0_Uniform: {r: 1, g: 0, b: 0, a: 0} |
|||
- Color_Color_5648C58E_Uniform: {r: 0, g: 0, b: 0, a: 0} |
|||
- Color_Color_8256B4E6_Uniform: {r: 1, g: 1, b: 1, a: 1} |
|||
- Color_Color_A536DDF7_Uniform: {r: 1, g: 1, b: 1, a: 1} |
|||
- Vector3_Vector3_D670D52C_Uniform: {r: 0, g: 0, b: 0, a: 0} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
%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: TestGraph-PBRSpecular |
|||
m_Shader: {fileID: 4800000, guid: a96bafc6e4c6e7c4ca1fb43c905d7948, type: 3} |
|||
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLIC_SETUP _SPECULARHIGHLIGHTS_ON |
|||
m_LightmapFlags: 2 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- Texture2D_Texture2D_2A5875FB_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 618126695341ad844ac048b062fd2688, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_30A72685_Uniform: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_6C206BFC_Uniform: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_87733D67_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: d63435d934a30fd439a005c25fa542f0, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_9508545D_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 330f42016073a97418a4aae5517e32c8, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_AEB21289_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 6e8d12f68bae2294da814f9d4c81b29a, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_FE1ED0E8_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 1085d6f82e40b31428079b25ebee7d74, 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_Offset: {x: 0, y: 0} |
|||
- _Cube: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailAlbedoMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMask: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicSpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OcclusionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ParallaxMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- Vector1_Vector1_20D3DC06_Uniform: 1 |
|||
- Vector1_Vector1_4B0AEC3F_Uniform: 0.5 |
|||
- Vector1_Vector1_5370E8F3_Uniform: 0.5 |
|||
- Vector1_Vector1_69199BC_Uniform: 0 |
|||
- Vector1_Vector1_72A1F5A1_Uniform: 1 |
|||
- Vector1_Vector1_7EC3DCBC_Uniform: 0.5 |
|||
- _BumpScale: 1 |
|||
- _Cutoff: 0.5 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DstBlend: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 1 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 1 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 0.5 |
|||
- _Parallax: 0.02 |
|||
- _ReflectionSource: 0 |
|||
- _Shininess: 1 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _UVSec: 0 |
|||
- _WorkflowMode: 1 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- Color_Color_4467EDF0_Uniform: {r: 1, g: 0, b: 0, a: 0} |
|||
- Color_Color_5648C58E_Uniform: {r: 0, g: 0, b: 0, a: 0} |
|||
- Color_Color_8256B4E6_Uniform: {r: 1, g: 1, b: 1, a: 1} |
|||
- Color_Color_A536DDF7_Uniform: {r: 1, g: 1, b: 1, a: 1} |
|||
- Vector3_Vector3_D670D52C_Uniform: {r: 0, g: 0, b: 0, a: 0} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0b6bd1d9f8dca444aa8695ad2c1b7152 |
|||
timeCreated: 1505335385 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 542ef8f442f720644896ebc5885e65f6 |
|||
timeCreated: 1505451746 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "GraphOutputTest" |
|||
{ |
|||
Properties |
|||
{ |
|||
Vector1_Vector1_4B0AEC3F_Uniform("Smoothness", Float) = 0.5 |
|||
Vector1_Vector1_5370E8F3_Uniform("Metallic / Specular", Float) = 0.5 |
|||
Color_Color_8256B4E6_Uniform("Color", Color) = (0,0,0,0) |
|||
|
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Tags{ "RenderType" = "Opaque" "RenderPipeline" = "LightweightPipeline" } |
|||
|
|||
LOD 200 |
|||
|
|||
Pass |
|||
{ |
|||
Tags |
|||
{ |
|||
"LightMode" = "LightweightForward" |
|||
"RenderType" = "Opaque" |
|||
"Queue" = "Geometry" |
|||
} |
|||
|
|||
Blend One Zero |
|||
|
|||
Cull Back |
|||
|
|||
ZTest LEqual |
|||
|
|||
ZWrite On |
|||
|
|||
|
|||
CGPROGRAM |
|||
#pragma target 3.0 |
|||
#include "UnityCG.cginc" |
|||
|
|||
#pragma multi_compile _ _SINGLE_DIRECTIONAL_LIGHT _SINGLE_SPOT_LIGHT _SINGLE_POINT_LIGHT |
|||
#pragma multi_compile _ LIGHTWEIGHT_LINEAR |
|||
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON |
|||
#pragma multi_compile _ LIGHTMAP_ON |
|||
#pragma multi_compile _ _LIGHT_PROBES_ON |
|||
#pragma multi_compile _ _HARD_SHADOWS _SOFT_SHADOWS _HARD_SHADOWS_CASCADES _SOFT_SHADOWS_CASCADES |
|||
#pragma multi_compile _ _VERTEX_LIGHTS |
|||
#pragma multi_compile_fog |
|||
#pragma multi_compile_instancing |
|||
|
|||
#pragma vertex LightweightVertexCustom |
|||
#pragma fragment LightweightFragmentPBR |
|||
#pragma glsl |
|||
#pragma debug |
|||
|
|||
#define _GLOSSYREFLECTIONS_ON |
|||
|
|||
|
|||
float Vector1_Vector1_4B0AEC3F_Uniform; |
|||
float Vector1_Vector1_5370E8F3_Uniform; |
|||
float4 Color_Color_8256B4E6_Uniform; |
|||
|
|||
//sampler2D _MainTex; |
|||
//float4 _MainTex_ST; |
|||
|
|||
struct vInput |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float4 normal : NORMAL; |
|||
float2 lightmapUV : TEXCOORD0; |
|||
float4 color : COLOR; |
|||
|
|||
float2 texcoord : TEXCOORD1; |
|||
|
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
}; |
|||
|
|||
struct vOutput |
|||
{ |
|||
float4 posWS : TEXCOORD0; |
|||
half4 viewDir : TEXCOORD1; |
|||
half4 fogCoord : TEXCOORD2; |
|||
half3 normal : TEXCOORD3; |
|||
float4 hpos : SV_POSITION; |
|||
|
|||
float4 uv01 : TEXCOORD4; |
|||
|
|||
UNITY_VERTEX_OUTPUT_STEREO |
|||
}; |
|||
|
|||
#include "UnityStandardInput.cginc" |
|||
|
|||
vOutput LightweightVertexCustom(vInput v) |
|||
{ |
|||
vOutput o = (vOutput)0; |
|||
|
|||
UNITY_SETUP_INSTANCE_ID(v); |
|||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); |
|||
|
|||
o.uv01.xy = TRANSFORM_TEX(v.texcoord, _MainTex); |
|||
|
|||
//o.uv01.xy = TRANSFORM_TEX(v.texcoord, _MainTex); |
|||
#ifdef LIGHTMAP_ON |
|||
o.uv01.zw = v.lightmapUV * unity_LightmapST.xy + unity_LightmapST.zw; |
|||
#endif |
|||
o.hpos = UnityObjectToClipPos(v.vertex); |
|||
|
|||
float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz; |
|||
o.posWS.xyz = worldPos; |
|||
|
|||
o.viewDir.xyz = normalize(_WorldSpaceCameraPos - worldPos); |
|||
half3 normal = normalize(UnityObjectToWorldNormal(v.normal)); |
|||
|
|||
#if _NORMALMAP |
|||
half sign = v.tangent.w * unity_WorldTransformParams.w; |
|||
half3 tangent = normalize(UnityObjectToWorldDir(v.tangent)); |
|||
half3 binormal = cross(normal, tangent) * v.tangent.w; |
|||
|
|||
// Initialize tangetToWorld in column-major to benefit from better glsl matrix multiplication code |
|||
o.tangentToWorld0 = half3(tangent.x, binormal.x, normal.x); |
|||
o.tangentToWorld1 = half3(tangent.y, binormal.y, normal.y); |
|||
o.tangentToWorld2 = half3(tangent.z, binormal.z, normal.z); |
|||
#else |
|||
o.normal = normal; |
|||
#endif |
|||
|
|||
// TODO: change to only support point lights per vertex. This will greatly simplify shader ALU |
|||
#if defined(_VERTEX_LIGHTS) && defined(_MULTIPLE_LIGHTS) |
|||
half3 diffuse = half3(1.0, 1.0, 1.0); |
|||
// pixel lights shaded = min(pixelLights, perObjectLights) |
|||
// vertex lights shaded = min(vertexLights, perObjectLights) - pixel lights shaded |
|||
// Therefore vertexStartIndex = pixelLightCount; vertexEndIndex = min(vertexLights, perObjectLights) |
|||
int vertexLightStart = min(globalLightCount.x, unity_LightIndicesOffsetAndCount.y); |
|||
int vertexLightEnd = min(globalLightCount.y, unity_LightIndicesOffsetAndCount.y); |
|||
for (int lightIter = vertexLightStart; lightIter < vertexLightEnd; ++lightIter) |
|||
{ |
|||
int lightIndex = unity_4LightIndices0[lightIter]; |
|||
LightInput lightInput; |
|||
INITIALIZE_LIGHT(lightInput, lightIndex); |
|||
|
|||
half3 lightDirection; |
|||
half atten = ComputeLightAttenuationVertex(lightInput, normal, worldPos, lightDirection); |
|||
o.fogCoord.yzw += LightingLambert(diffuse, lightDirection, normal, atten); |
|||
} |
|||
#endif |
|||
|
|||
#if defined(_LIGHT_PROBES_ON) && !defined(LIGHTMAP_ON) |
|||
o.fogCoord.yzw += max(half3(0, 0, 0), ShadeSH9(half4(normal, 1))); |
|||
#endif |
|||
|
|||
//UNITY_TRANSFER_FOG(o, o.hpos); |
|||
return o; |
|||
} |
|||
|
|||
#include "CGIncludes/LightweightShadows.cginc" |
|||
#include "CGIncludes/LightweightBRDF.cginc" |
|||
#include "CGIncludes/LightweightCore.cginc" |
|||
|
|||
struct SurfacePBR |
|||
{ |
|||
float3 Albedo; // diffuse color |
|||
float3 Specular; // specular color |
|||
float Metallic; // metallic |
|||
float3 Normal; // tangent space normal, if written |
|||
half3 Emission; |
|||
half Smoothness; // 0=rough, 1=smooth |
|||
half Occlusion; // occlusion (default 1) |
|||
float Alpha; // alpha for transparencies |
|||
}; |
|||
|
|||
SurfacePBR InitializeSurfacePBR() |
|||
{ |
|||
SurfacePBR o; |
|||
o.Albedo = float3(0.5, 0.5, 0.5); |
|||
o.Specular = float3(0, 0, 0); |
|||
o.Metallic = 0; |
|||
o.Normal = float3(.5, .5, 1); |
|||
o.Emission = 0; |
|||
o.Smoothness = 0; |
|||
o.Occlusion = 1; |
|||
o.Alpha = 1; |
|||
return o; |
|||
} |
|||
|
|||
void DefineSurface(vOutput i, inout SurfacePBR o) |
|||
{ |
|||
o.Albedo = Color_Color_8256B4E6_Uniform; |
|||
o.Specular = Vector1_Vector1_5370E8F3_Uniform; |
|||
o.Metallic = Vector1_Vector1_5370E8F3_Uniform; |
|||
o.Smoothness = Vector1_Vector1_4B0AEC3F_Uniform; |
|||
|
|||
} |
|||
|
|||
half3 MetallicSetup(SurfacePBR o, out half3 specular, out half smoothness, out half oneMinusReflectivity) |
|||
{ |
|||
smoothness = o.Smoothness;// metallicGloss.g; |
|||
|
|||
// We'll need oneMinusReflectivity, so |
|||
// 1-reflectivity = 1-lerp(dielectricSpec, 1, metallic) = lerp(1-dielectricSpec, 0, metallic) |
|||
// store (1-dielectricSpec) in unity_ColorSpaceDielectricSpec.a, then |
|||
// 1-reflectivity = lerp(alpha, 0, metallic) = alpha + metallic*(0 - alpha) = |
|||
// = alpha - metallic * alpha |
|||
half oneMinusDielectricSpec = _DieletricSpec.a; |
|||
oneMinusReflectivity = oneMinusDielectricSpec - o.Metallic * oneMinusDielectricSpec; |
|||
specular = lerp(_DieletricSpec.rgb, o.Albedo, o.Metallic); |
|||
|
|||
return o.Albedo * oneMinusReflectivity; |
|||
} |
|||
|
|||
half3 SpecularSetup(SurfacePBR o, out half3 specular, out half smoothness, out half oneMinusReflectivity) |
|||
{ |
|||
half4 specGloss = float4(o.Specular, o.Smoothness); |
|||
|
|||
#if defined(UNITY_COLORSPACE_GAMMA) && defined(LIGHTWEIGHT_LINEAR) |
|||
specGloss.rgb = LIGHTWEIGHT_GAMMA_TO_LINEAR(specGloss.rgb); |
|||
#endif |
|||
|
|||
specular = specGloss.rgb; |
|||
smoothness = specGloss.a; |
|||
oneMinusReflectivity = 1.0h - SpecularReflectivity(specular); |
|||
return o.Albedo * (half3(1, 1, 1) - specular); |
|||
} |
|||
|
|||
half4 LightweightFragmentPBR(vOutput i) : SV_Target |
|||
{ |
|||
SurfacePBR o = InitializeSurfacePBR(); |
|||
DefineSurface(i, o); |
|||
|
|||
//float2 uv = i.uv01.xy; |
|||
float2 lightmapUV = i.uv01.zw; |
|||
|
|||
half3 specColor; |
|||
half smoothness; |
|||
half oneMinusReflectivity; |
|||
//#ifdef _METALLIC_SETUP |
|||
half3 diffColor = MetallicSetup(o, specColor, smoothness, oneMinusReflectivity); |
|||
//#else |
|||
//half3 diffColor = SpecularSetup(o, specColor, smoothness, oneMinusReflectivity); |
|||
//#endif |
|||
|
|||
diffColor = PreMultiplyAlpha(diffColor, o.Alpha, oneMinusReflectivity, /*out*/ o.Alpha); |
|||
|
|||
// Roughness is (1.0 - smoothness)² |
|||
half perceptualRoughness = 1.0h - smoothness; |
|||
|
|||
// TODO - Actually handle normal |
|||
half3 normal; |
|||
CalculateNormal(i.normal, normal); |
|||
|
|||
// TODO: shader keyword for occlusion |
|||
// TODO: Reflection Probe blend support. |
|||
half3 reflectVec = reflect(-i.viewDir.xyz, normal); |
|||
|
|||
UnityIndirect indirectLight = LightweightGI(lightmapUV, i.fogCoord.yzw, reflectVec, o.Occlusion, perceptualRoughness); |
|||
|
|||
// PBS |
|||
// grazingTerm = F90 |
|||
half grazingTerm = saturate(smoothness + (1 - oneMinusReflectivity)); |
|||
half fresnelTerm = Pow4(1.0 - saturate(dot(normal, i.viewDir.xyz))); |
|||
half3 color = LightweightBRDFIndirect(diffColor, specColor, indirectLight, perceptualRoughness * perceptualRoughness, grazingTerm, fresnelTerm); |
|||
half3 lightDirection; |
|||
|
|||
#ifndef _MULTIPLE_LIGHTS |
|||
LightInput light; |
|||
INITIALIZE_MAIN_LIGHT(light); |
|||
half lightAtten = ComputeLightAttenuation(light, normal, i.posWS.xyz, lightDirection); |
|||
|
|||
//#ifdef _SHADOWS |
|||
lightAtten *= ComputeShadowAttenuation(i.normal, i.posWS, _ShadowLightDirection.xyz); |
|||
//#endif |
|||
|
|||
half NdotL = saturate(dot(normal, lightDirection)); |
|||
half3 radiance = light.color * (lightAtten * NdotL); |
|||
color += LightweightBDRF(diffColor, specColor, oneMinusReflectivity, perceptualRoughness, normal, lightDirection, i.viewDir.xyz) * radiance; |
|||
#else |
|||
//#ifdef _SHADOWS |
|||
half shadowAttenuation = ComputeShadowAttenuation(i.normal, i.posWS, _ShadowLightDirection.xyz); |
|||
//#endif |
|||
int pixelLightCount = min(globalLightCount.x, unity_LightIndicesOffsetAndCount.y); |
|||
for (int lightIter = 0; lightIter < pixelLightCount; ++lightIter) |
|||
{ |
|||
LightInput light; |
|||
int lightIndex = unity_4LightIndices0[lightIter]; |
|||
INITIALIZE_LIGHT(light, lightIndex); |
|||
half lightAtten = ComputeLightAttenuation(light, normal, i.posWS.xyz, lightDirection); |
|||
//#ifdef _SHADOWS |
|||
lightAtten *= max(shadowAttenuation, half(lightIndex != _ShadowData.x)); |
|||
//#endif |
|||
half NdotL = saturate(dot(normal, lightDirection)); |
|||
half3 radiance = light.color * (lightAtten * NdotL); |
|||
|
|||
color += LightweightBDRF(diffColor, specColor, oneMinusReflectivity, perceptualRoughness, normal, lightDirection, i.viewDir.xyz) * radiance; |
|||
} |
|||
#endif |
|||
|
|||
color += o.Emission; |
|||
UNITY_APPLY_FOG(i.fogCoord, color); |
|||
return OutputColor(color, o.Alpha); |
|||
} |
|||
|
|||
ENDCG |
|||
} |
|||
|
|||
Pass |
|||
{ |
|||
Tags{ "Lightmode" = "ShadowCaster" } |
|||
ZWrite On ZTest LEqual |
|||
|
|||
CGPROGRAM |
|||
#pragma target 2.0 |
|||
#include "UnityCG.cginc" |
|||
#include "CGIncludes/LightweightPass.cginc" |
|||
#pragma vertex shadowVert |
|||
#pragma fragment shadowFrag |
|||
ENDCG |
|||
} |
|||
|
|||
Pass |
|||
{ |
|||
Tags{ "Lightmode" = "DepthOnly" } |
|||
ZWrite On |
|||
|
|||
CGPROGRAM |
|||
#pragma target 2.0 |
|||
#include "UnityCG.cginc" |
|||
#include "CGIncludes/LightweightPass.cginc" |
|||
#pragma vertex depthVert |
|||
#pragma fragment depthFrag |
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
|
|||
//FallBack "Diffuse" |
|||
CustomEditor "LegacyIlluminShaderGUI" |
|||
} |
77
MaterialGraphProject/Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders/TestyTest.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 02a3ca69ec995e94aa47105621a17e4c |
|||
timeCreated: 1505455116 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: TestGraph-PBR |
|||
m_Shader: {fileID: 4800000, guid: 02a3ca69ec995e94aa47105621a17e4c, type: 3} |
|||
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLIC_SETUP _SPECULARHIGHLIGHTS_ON |
|||
m_LightmapFlags: 2 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- Texture2D_Texture2D_2A5875FB_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 618126695341ad844ac048b062fd2688, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- Texture2D_Texture2D_87733D67_Uniform: |
|||
m_Texture: {fileID: 2800000, guid: 3f3b8bdf3ccd30c4fb97b62bd26ef1f6, 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_Offset: {x: 0, y: 0} |
|||
- _Cube: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailAlbedoMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMask: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicSpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OcclusionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ParallaxMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- Vector1_Vector1_4B0AEC3F_Uniform: 0.5 |
|||
- Vector1_Vector1_5370E8F3_Uniform: 0.5 |
|||
- _BumpScale: 1 |
|||
- _Cutoff: 0.5 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DstBlend: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 1 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 1 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 0.5 |
|||
- _Parallax: 0.02 |
|||
- _ReflectionSource: 0 |
|||
- _Shininess: 1 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _UVSec: 0 |
|||
- _WorkflowMode: 1 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- Color_Color_4467EDF0_Uniform: {r: 1, g: 0, b: 0, a: 0} |
|||
- Color_Color_8256B4E6_Uniform: {r: 1, g: 1, b: 1, a: 1} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1} |
撰写
预览
正在加载...
取消
保存
Reference in new issue