Felipe Lira
7 年前
当前提交
5b48f6c3
共有 14 个文件被更改,包括 633 次插入 和 358 次删除
-
4ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Input.hlsl
-
22ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl
-
176ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl
-
6ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Particles.hlsl
-
8ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardTerrain.shader
-
355Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps.unity
-
8Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_01_BaseWhite.mat
-
6Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_04_Normal.mat
-
191ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardSimpleLighting (Single Directional Light).shader
-
9ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardSimpleLighting (Single Directional Light).shader.meta
-
94Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_01_BaseWhite_Tangent.mat
-
9Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_01_BaseWhite_Tangent.mat.meta
-
94Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_04_Normal_Tangent.mat
-
9Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_04_Normal_Tangent.mat.meta
|
|||
// Shader targeted for low end devices. |
|||
// Optimized for a single direcitonal light. |
|||
Shader "LightweightPipeline/Standard (Simple Lighting - Single Directional)" |
|||
{ |
|||
Properties |
|||
{ |
|||
_Color("Color", Color) = (1,1,1,1) |
|||
_MainTex("Base (RGB) Glossiness / Alpha (A)", 2D) = "white" {} |
|||
|
|||
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 |
|||
|
|||
_Shininess("Shininess", Range(0.01, 1.0)) = 1.0 |
|||
_GlossMapScale("Smoothness Factor", Range(0.0, 1.0)) = 1.0 |
|||
|
|||
_Glossiness("Glossiness", Range(0.0, 1.0)) = 0.5 |
|||
[Enum(Specular Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0 |
|||
|
|||
[HideInInspector] _SpecSource("Specular Color Source", Float) = 0.0 |
|||
_SpecColor("Specular", Color) = (1.0, 1.0, 1.0) |
|||
_SpecGlossMap("Specular", 2D) = "white" {} |
|||
[HideInInspector] _GlossinessSource("Glossiness Source", Float) = 0.0 |
|||
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 |
|||
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0 |
|||
|
|||
[HideInInspector] _BumpScale("Scale", Float) = 1.0 |
|||
[NoScaleOffset] _BumpMap("Normal Map", 2D) = "bump" {} |
|||
|
|||
_Parallax("Height Scale", Range(0.005, 0.08)) = 0.02 |
|||
_ParallaxMap("Height Map", 2D) = "black" {} |
|||
|
|||
_EmissionColor("Emission Color", Color) = (0,0,0) |
|||
_EmissionMap("Emission", 2D) = "white" {} |
|||
|
|||
_DetailMask("Detail Mask", 2D) = "white" {} |
|||
|
|||
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} |
|||
_DetailNormalMapScale("Scale", Float) = 1.0 |
|||
_DetailNormalMap("Normal Map", 2D) = "bump" {} |
|||
|
|||
[Enum(UV0,0,UV1,1)] _UVSec("UV Set for secondary textures", Float) = 0 |
|||
|
|||
// Blending state |
|||
[HideInInspector] _Surface("__surface", Float) = 0.0 |
|||
[HideInInspector] _Blend("__blend", Float) = 0.0 |
|||
[HideInInspector] _AlphaClip("__clip", Float) = 0.0 |
|||
[HideInInspector] _SrcBlend("__src", Float) = 1.0 |
|||
[HideInInspector] _DstBlend("__dst", Float) = 0.0 |
|||
[HideInInspector] _ZWrite("__zw", Float) = 1.0 |
|||
[HideInInspector] _Cull("__cull", Float) = 2.0 |
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Tags { "RenderType" = "Opaque" "RenderPipeline" = "LightweightPipeline" } |
|||
LOD 300 |
|||
|
|||
Pass |
|||
{ |
|||
Tags { "LightMode" = "LightweightForward" } |
|||
|
|||
// Use same blending / depth states as Standard shader |
|||
Blend[_SrcBlend][_DstBlend] |
|||
ZWrite[_ZWrite] |
|||
Cull[_Cull] |
|||
|
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
// ------------------------------------- |
|||
// Material Keywords |
|||
#pragma shader_feature _ALPHATEST_ON |
|||
#pragma shader_feature _ALPHAPREMULTIPLY_ON |
|||
#pragma shader_feature _ _SPECGLOSSMAP _SPECULAR_COLOR |
|||
#pragma shader_feature _ _GLOSSINESS_FROM_BASE_ALPHA |
|||
#pragma shader_feature _NORMALMAP |
|||
#pragma shader_feature _EMISSION |
|||
|
|||
// ------------------------------------- |
|||
// Lightweight Pipeline keywords |
|||
#pragma multi_compile _ _VERTEX_LIGHTS |
|||
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE |
|||
#pragma multi_compile _ FOG_LINEAR FOG_EXP2 |
|||
|
|||
// ------------------------------------- |
|||
// Unity defined keywords |
|||
#pragma multi_compile _ DIRLIGHTMAP_COMBINED |
|||
#pragma multi_compile _ LIGHTMAP_ON |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
|
|||
#pragma vertex LitPassVertexSingleLight |
|||
#pragma fragment LitPassFragmentSimpleSingleLight |
|||
#define BUMP_SCALE_NOT_SUPPORTED 1 |
|||
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl" |
|||
ENDHLSL |
|||
} |
|||
|
|||
Pass |
|||
{ |
|||
Tags{"Lightmode" = "ShadowCaster"} |
|||
|
|||
ZWrite On |
|||
ZTest LEqual |
|||
Cull[_Cull] |
|||
|
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
// ------------------------------------- |
|||
// Material Keywords |
|||
#pragma shader_feature _ALPHATEST_ON |
|||
#pragma shader_feature _ALPHAPREMULTIPLY_ON |
|||
#pragma shader_feature _ _SPECGLOSSMAP _SPECULAR_COLOR |
|||
#pragma shader_feature _ _GLOSSINESS_FROM_BASE_ALPHA |
|||
#pragma shader_feature _NORMALMAP |
|||
#pragma shader_feature _EMISSION |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
|
|||
#pragma vertex ShadowPassVertex |
|||
#pragma fragment LitPassFragmentSimpleNull |
|||
|
|||
#define BUMP_SCALE_NOT_SUPPORTED 1 |
|||
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl" |
|||
ENDHLSL |
|||
} |
|||
|
|||
Pass |
|||
{ |
|||
Tags{"Lightmode" = "DepthOnly"} |
|||
|
|||
ZWrite On |
|||
ColorMask 0 |
|||
|
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
// ------------------------------------- |
|||
// Material Keywords |
|||
#pragma shader_feature _ALPHATEST_ON |
|||
#pragma shader_feature _ALPHAPREMULTIPLY_ON |
|||
#pragma shader_feature _ _SPECGLOSSMAP _SPECULAR_COLOR |
|||
#pragma shader_feature _ _GLOSSINESS_FROM_BASE_ALPHA |
|||
#pragma shader_feature _NORMALMAP |
|||
#pragma shader_feature _EMISSION |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
|
|||
#pragma vertex LitPassVertex |
|||
#pragma fragment LitPassFragmentSimpleNull |
|||
|
|||
#define BUMP_SCALE_NOT_SUPPORTED 1 |
|||
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl" |
|||
ENDHLSL |
|||
} |
|||
|
|||
// This pass it not used during regular rendering, only for lightmap baking. |
|||
Pass |
|||
{ |
|||
Tags{ "LightMode" = "Meta" } |
|||
|
|||
Cull Off |
|||
|
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma vertex LightweightVertexMeta |
|||
#pragma fragment LightweightFragmentMetaSimple |
|||
|
|||
#pragma shader_feature _EMISSION |
|||
#pragma shader_feature _SPECGLOSSMAP |
|||
|
|||
#include "LWRP/ShaderLibrary/LightweightPassMeta.hlsl" |
|||
ENDHLSL |
|||
} |
|||
} |
|||
Fallback "Hidden/InternalErrorShader" |
|||
CustomEditor "LightweightStandardSimpleLightingGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d10bb476e0627024a9d156f9fa667e8b |
|||
timeCreated: 1487263524 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
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: 007_LitShaderMaps_01_BaseWhite_Tangent |
|||
m_Shader: {fileID: 4800000, guid: d10bb476e0627024a9d156f9fa667e8b, type: 3} |
|||
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SPECULAR_COLOR |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 2800000, guid: 3ef4a98fe1049204698ff10e8253a6a5, type: 3} |
|||
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} |
|||
- _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: |
|||
- _AlphaClip: 0 |
|||
- _Blend: 0 |
|||
- _BumpScale: 1 |
|||
- _Cull: 2 |
|||
- _Cutoff: 0.5 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DstBlend: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 0.5 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 0 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 1 |
|||
- _Parallax: 0.02 |
|||
- _ReflectionSource: 0 |
|||
- _Shininess: 0.5 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _Surface: 0 |
|||
- _UVSec: 0 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: b503216392cdca54fb363833bf36f713 |
|||
timeCreated: 1493306832 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 2100000 |
|||
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: 007_LitShaderMaps_04_Normal_Tangent |
|||
m_Shader: {fileID: 4800000, guid: d10bb476e0627024a9d156f9fa667e8b, type: 3} |
|||
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SPECULAR_COLOR |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 2800000, guid: 77bf3f5170a004139b83abf58a665c0e, type: 3} |
|||
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: 3, y: 2} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicGlossMap: |
|||
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: |
|||
- _AlphaClip: 0 |
|||
- _Blend: 0 |
|||
- _BumpScale: 1 |
|||
- _Cull: 2 |
|||
- _Cutoff: 0.5 |
|||
- _DetailNormalMapScale: 1 |
|||
- _DstBlend: 0 |
|||
- _GlossMapScale: 1 |
|||
- _Glossiness: 0.5 |
|||
- _GlossinessSource: 0 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 0 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 1 |
|||
- _Parallax: 0.02 |
|||
- _ReflectionSource: 0 |
|||
- _Shininess: 0.5 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecSource: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _Surface: 0 |
|||
- _UVSec: 0 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: f4ddd10bb6551364fbbefc51575c7f90 |
|||
timeCreated: 1493306832 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue