Raymond Graham
7 年前
当前提交
b987da15
共有 64 个文件被更改,包括 1039 次插入 和 731 次删除
-
6ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugState.cs
-
36ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.Builtins.cs
-
1ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugUIDrawer.cs
-
35ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs
-
5ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl
-
4ScriptableRenderPipeline/Core/package.json
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.cs
-
7ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs
-
12ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs
-
14ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs
-
9ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedFrameSettings.cs
-
70ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightDefinition.cs
-
12ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightDefinition.cs.hlsl
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtilities.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs
-
13ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs
-
9ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ProbeWrapper.cs
-
47ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLit.shader
-
50ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
-
9ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
-
50ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
-
53ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassGBuffer.hlsl
-
5ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs
-
29ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs
-
6ScriptableRenderPipeline/HDRenderPipeline/package.json
-
2ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
-
32ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderGUI/LightweightStandardSimpleLightingGUI.cs
-
93ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderGraph/lightweightPBRExtraPasses.template
-
23ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderGraph/lightweightPBRForwardPass.template
-
63ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderGraph/lightweightUnlitExtraPasses.template
-
130ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
-
42ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl
-
60ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/InputSurface.hlsl
-
36ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl
-
91ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl
-
46ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassShadow.hlsl
-
104ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Particles.hlsl
-
87ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl
-
17ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightScreenSpaceShadows.shader
-
40ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandard.shader
-
18ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticles.shader
-
50ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticlesUnlit.shader
-
39ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardSimpleLighting.shader
-
8ScriptableRenderPipeline/LightweightPipeline/package.json
-
2ScriptableRenderPipeline/LightweightPipeline/sub-package.json
-
4ScriptableRenderPipeline/master-package.json
-
48ScriptableRenderPipeline/LightweightPipeline/LWRP/SceneViewDrawMode.cs
-
11ScriptableRenderPipeline/LightweightPipeline/LWRP/SceneViewDrawMode.cs.meta
-
35ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl
-
9ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl.meta
-
130ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticlesSimpleLighting.shader
-
9ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticlesSimpleLighting.shader.meta
|
|||
{ |
|||
"name": "com.unity.render-pipelines.core", |
|||
"description": "Core library for Unity render pipelines.", |
|||
"version": "1.1.1-preview", |
|||
"version": "1.1.2-preview", |
|||
"com.unity.postprocessing": "2.0.2-preview" |
|||
"com.unity.postprocessing": "2.0.3-preview" |
|||
} |
|||
} |
|
|||
{ |
|||
"name": "com.unity.render-pipelines.high-definition", |
|||
"description": "HD Render Pipeline for Unity.", |
|||
"version": "1.1.1-preview", |
|||
"version": "1.1.2-preview", |
|||
"com.unity.postprocessing": "2.0.2-preview", |
|||
"com.unity.render-pipelines.core": "1.1.1-preview" |
|||
"com.unity.postprocessing": "2.0.3-preview", |
|||
"com.unity.render-pipelines.core": "1.1.2-preview" |
|||
} |
|||
} |
|
|||
Pass |
|||
{ |
|||
Tags{"LightMode" = "ShadowCaster"} |
|||
Tags{"LightMode" = "ShadowCaster"} |
|||
ZWrite On |
|||
ZTest LEqual |
|||
Cull ${Culling} |
|||
ZWrite On |
|||
ZTest LEqual |
|||
Cull ${Culling} |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
|
|||
#pragma vertex ShadowPassVertex |
|||
#pragma fragment ShadowPassFragment |
|||
#pragma vertex ShadowPassVertex |
|||
#pragma fragment LitPassFragmentNull |
|||
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl" |
|||
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl" |
|||
ENDHLSL |
|||
ENDHLSL |
|||
Tags{"LightMode" = "DepthOnly"} |
|||
Tags{"LightMode" = "DepthOnly"} |
|||
|
|||
ZWrite On |
|||
ColorMask 0 |
|||
ZWrite On |
|||
ColorMask 0 |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
#pragma vertex DepthOnlyVertex |
|||
#pragma fragment DepthOnlyFragment |
|||
#pragma vertex LitPassVertex |
|||
#pragma fragment LitPassFragmentNull |
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl" |
|||
ENDHLSL |
|||
#include "LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl" |
|||
ENDHLSL |
|||
Tags{"LightMode" = "Meta"} |
|||
Tags{"LightMode" = "Meta"} |
|||
Cull Off |
|||
Cull Off |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma vertex LightweightVertexMeta |
|||
#pragma fragment LightweightFragmentMeta |
|||
#pragma vertex LightweightVertexMeta |
|||
#pragma fragment LightweightFragmentMeta |
|||
#pragma shader_feature _SPECULAR_SETUP |
|||
#pragma shader_feature _EMISSION |
|||
#pragma shader_feature _METALLICSPECGLOSSMAP |
|||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A |
|||
#pragma shader_feature EDITOR_VISUALIZATION |
|||
#pragma shader_feature _SPECULAR_SETUP |
|||
#pragma shader_feature _EMISSION |
|||
#pragma shader_feature _METALLICSPECGLOSSMAP |
|||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A |
|||
#pragma shader_feature EDITOR_VISUALIZATION |
|||
#pragma shader_feature _SPECGLOSSMAP |
|||
#pragma shader_feature _SPECGLOSSMAP |
|||
#include "LWRP/ShaderLibrary/LightweightPassMeta.hlsl" |
|||
ENDHLSL |
|||
#include "LWRP/ShaderLibrary/LightweightPassMeta.hlsl" |
|||
ENDHLSL |
|||
} |
|
|||
Pass |
|||
{ |
|||
Tags{"LightMode" = "ShadowCaster"} |
|||
Tags{"LightMode" = "ShadowCaster"} |
|||
ZWrite On |
|||
ZTest LEqual |
|||
Cull ${Culling} |
|||
ZWrite On |
|||
ZTest LEqual |
|||
Cull ${Culling} |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
#pragma vertex ShadowPassVertex |
|||
#pragma fragment LitPassFragmentNull |
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl" |
|||
ENDHLSL |
|||
#pragma vertex ShadowPassVertex |
|||
#pragma fragment ShadowPassFragment |
|||
|
|||
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl" |
|||
|
|||
ENDHLSL |
|||
Tags{"LightMode" = "DepthOnly"} |
|||
Tags{"LightMode" = "DepthOnly"} |
|||
ZWrite On |
|||
ColorMask 0 |
|||
ZWrite On |
|||
ColorMask 0 |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma target 2.0 |
|||
|
|||
#pragma vertex DepthOnlyVertex |
|||
#pragma fragment DepthOnlyFragment |
|||
#pragma vertex LitPassVertex |
|||
#pragma fragment LitPassFragmentNull |
|||
//-------------------------------------- |
|||
// GPU Instancing |
|||
#pragma multi_compile_instancing |
|||
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl" |
|||
ENDHLSL |
|||
#include "LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl" |
|||
ENDHLSL |
|||
} |
|
|||
#if UNITY_EDITOR
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.LightweightPipeline |
|||
{ |
|||
internal static class SceneViewDrawMode |
|||
{ |
|||
static bool RejectDrawMode(SceneView.CameraMode cameraMode) |
|||
{ |
|||
if (cameraMode.drawMode == DrawCameraMode.TexturedWire || |
|||
cameraMode.drawMode == DrawCameraMode.ShadowCascades || |
|||
cameraMode.drawMode == DrawCameraMode.RenderPaths || |
|||
cameraMode.drawMode == DrawCameraMode.AlphaChannel || |
|||
cameraMode.drawMode == DrawCameraMode.Overdraw || |
|||
cameraMode.drawMode == DrawCameraMode.Mipmaps || |
|||
cameraMode.drawMode == DrawCameraMode.SpriteMask || |
|||
cameraMode.drawMode == DrawCameraMode.DeferredDiffuse || |
|||
cameraMode.drawMode == DrawCameraMode.DeferredSpecular || |
|||
cameraMode.drawMode == DrawCameraMode.DeferredSmoothness || |
|||
cameraMode.drawMode == DrawCameraMode.DeferredNormal || |
|||
cameraMode.drawMode == DrawCameraMode.ValidateAlbedo || |
|||
cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular || |
|||
cameraMode.drawMode == DrawCameraMode.ShadowMasks || |
|||
cameraMode.drawMode == DrawCameraMode.LightOverlap |
|||
) |
|||
return false; |
|||
|
|||
return true; |
|||
} |
|||
|
|||
public static void SetupDrawMode() |
|||
{ |
|||
ArrayList sceneViewArray = SceneView.sceneViews; |
|||
foreach (SceneView sceneView in sceneViewArray) |
|||
sceneView.onValidateCameraMode += RejectDrawMode; |
|||
} |
|||
|
|||
public static void ResetDrawMode() |
|||
{ |
|||
ArrayList sceneViewArray = SceneView.sceneViews; |
|||
foreach (SceneView sceneView in sceneViewArray) |
|||
sceneView.onValidateCameraMode -= RejectDrawMode; |
|||
} |
|||
} |
|||
} |
|||
#endif
|
|
|||
fileFormatVersion: 2 |
|||
guid: d7255bed85944a04fa68dd4d1d28022a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef LIGHTWEIGHT_PASS_DEPTH_ONLY_INCLUDED |
|||
#define LIGHTWEIGHT_PASS_DEPTH_ONLY_INCLUDED |
|||
|
|||
#include "LWRP/ShaderLibrary/Core.hlsl" |
|||
#include "LWRP/ShaderLibrary/InputSurface.hlsl" |
|||
|
|||
struct VertexInput |
|||
{ |
|||
float4 position : POSITION; |
|||
float2 texcoord : TEXCOORD0; |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
}; |
|||
|
|||
struct VertexOutput |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
float4 clipPos : SV_POSITION; |
|||
}; |
|||
|
|||
VertexOutput DepthOnlyVertex(VertexInput v) |
|||
{ |
|||
VertexOutput o = (VertexOutput)0; |
|||
UNITY_SETUP_INSTANCE_ID(v); |
|||
|
|||
o.uv = TransformMainTextureCoord(v.texcoord); |
|||
o.clipPos = TransformObjectToHClip(v.position.xyz); |
|||
return o; |
|||
} |
|||
|
|||
half4 DepthOnlyFragment(VertexOutput IN) : SV_TARGET |
|||
{ |
|||
Alpha(MainTexture(IN.uv).a); |
|||
return 0; |
|||
} |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 0acd4fdbcf0cf654a9cdf3e9ccc2edce |
|||
timeCreated: 1488965025 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ------------------------------------------ |
|||
// Only directional light is supported for lit particles |
|||
// No shadow |
|||
// No distortion |
|||
Shader "LightweightPipeline/Particles/Standard (Simple Lighting)" |
|||
{ |
|||
Properties |
|||
{ |
|||
_MainTex("Albedo", 2D) = "white" {} |
|||
_Color("Color", Color) = (1,1,1,1) |
|||
|
|||
_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" {} |
|||
|
|||
_EmissionColor("Color", Color) = (0,0,0) |
|||
_EmissionMap("Emission", 2D) = "white" {} |
|||
|
|||
_SoftParticlesNearFadeDistance("Soft Particles Near Fade", Float) = 0.0 |
|||
_SoftParticlesFarFadeDistance("Soft Particles Far Fade", Float) = 1.0 |
|||
_CameraNearFadeDistance("Camera Near Fade", Float) = 1.0 |
|||
_CameraFarFadeDistance("Camera Far Fade", Float) = 2.0 |
|||
|
|||
// Hidden properties |
|||
[HideInInspector] _Mode("__mode", Float) = 0.0 |
|||
[HideInInspector] _FlipbookMode("__flipbookmode", Float) = 0.0 |
|||
[HideInInspector] _LightingEnabled("__lightingenabled", Float) = 1.0 |
|||
[HideInInspector] _EmissionEnabled("__emissionenabled", Float) = 0.0 |
|||
[HideInInspector] _BlendOp("__blendop", 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 |
|||
[HideInInspector] _SoftParticlesEnabled("__softparticlesenabled", Float) = 0.0 |
|||
[HideInInspector] _CameraFadingEnabled("__camerafadingenabled", Float) = 0.0 |
|||
[HideInInspector] _SoftParticleFadeParams("__softparticlefadeparams", Vector) = (0,0,0,0) |
|||
[HideInInspector] _CameraFadeParams("__camerafadeparams", Vector) = (0,0,0,0) |
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Tags{"RenderType" = "Opaque" "IgnoreProjector" = "True" "PreviewType" = "Plane" "PerformanceChecks" = "False" "RenderPipeline" = "LightweightPipeline"} |
|||
|
|||
BlendOp[_BlendOp] |
|||
Blend[_SrcBlend][_DstBlend] |
|||
ZWrite[_ZWrite] |
|||
Cull[_Cull] |
|||
|
|||
Pass |
|||
{ |
|||
Tags {"LightMode" = "LightweightForward"} |
|||
HLSLPROGRAM |
|||
// Required to compile gles 2.0 with standard srp library |
|||
#pragma prefer_hlslcc gles |
|||
#pragma vertex ParticlesLitVertex |
|||
#pragma fragment ParticlesLitFragment |
|||
#pragma multi_compile __ SOFTPARTICLES_ON |
|||
#pragma target 2.0 |
|||
|
|||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON |
|||
#pragma shader_feature _ _SPECGLOSSMAP _SPECULAR_COLOR |
|||
#pragma shader_feature _ _GLOSSINESS_FROM_BASE_ALPHA |
|||
#pragma shader_feature _NORMALMAP |
|||
#pragma shader_feature _EMISSION |
|||
#pragma shader_feature _FADING_ON |
|||
#pragma shader_feature _REQUIRE_UV2 |
|||
|
|||
#define BUMP_SCALE_NOT_SUPPORTED 1 |
|||
#define NO_SHADOWS 1 |
|||
|
|||
#include "LWRP/ShaderLibrary/Particles.hlsl" |
|||
#include "LWRP/ShaderLibrary/Lighting.hlsl" |
|||
|
|||
VertexOutputLit ParticlesLitVertex(appdata_particles v) |
|||
{ |
|||
VertexOutputLit o; |
|||
|
|||
OUTPUT_NORMAL(v, o); |
|||
|
|||
o.color = v.color * _Color; |
|||
o.posWS.xyz = TransformObjectToWorld(v.vertex.xyz).xyz; |
|||
o.posWS.w = ComputeFogFactor(o.clipPos.z); |
|||
o.clipPos = TransformWorldToHClip(o.posWS.xyz); |
|||
o.viewDirShininess.xyz = VertexViewDirWS(GetCameraPositionWS() - o.posWS.xyz); |
|||
o.viewDirShininess.w = _Shininess * 128.0h; |
|||
vertTexcoord(v, o); |
|||
vertFading(o, o.posWS, o.clipPos); |
|||
return o; |
|||
} |
|||
|
|||
half4 ParticlesLitFragment(VertexOutputLit IN) : SV_Target |
|||
{ |
|||
half4 albedo = Albedo(IN); |
|||
half alpha = AlphaBlendAndTest(albedo.a); |
|||
half3 diffuse = AlphaModulate(albedo.rgb, alpha); |
|||
half3 normalTS = NormalTS(IN); |
|||
half3 emission = Emission(IN); |
|||
half4 specularGloss = SpecularGloss(IN, albedo.a); |
|||
half shininess = IN.viewDirShininess.w; |
|||
|
|||
InputData inputData; |
|||
InitializeInputData(IN, normalTS, inputData); |
|||
|
|||
half4 color = LightweightFragmentBlinnPhong(inputData, diffuse, specularGloss, shininess, emission, alpha); |
|||
|
|||
ApplyFog(color.rgb, inputData.fogCoord); |
|||
return color; |
|||
} |
|||
|
|||
ENDHLSL |
|||
} |
|||
} |
|||
|
|||
Fallback "LightweightPipeline/Particles/Standard Unlit" |
|||
CustomEditor "LightweightStandardParticlesShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8516d7a69675844a7a0b7095af7c46af |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue