浏览代码
- Unlit shader graph node
- Unlit shader graph node
- Plug materialID (automatically deducted from GetMatchingMaterialID)/scriptablerenderloop-materialgraph
Paul Demeulenaere
8 年前
当前提交
102b0ab8
共有 8 个文件被更改,包括 282 次插入 和 92 次删除
-
129Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderloopMaterialGraph.cs
-
40Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.template
-
2Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitSharePass.template
-
20Assets/ShaderGenerator/Editor/ShaderTypeGeneration.cs
-
142Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.template
-
8Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.template.meta
-
21Assets/ShaderGenerator/ShaderGeneratorHelper.cs
-
12Assets/ShaderGenerator/ShaderGeneratorHelper.cs.meta
|
|||
Shader "HDRenderLoop/Unlit" |
|||
{ |
|||
Properties |
|||
{ |
|||
${ShaderPropertiesHeader} |
|||
[ToggleOff] _AlphaCutoffEnable("Alpha Cutoff Enable", Float) = 0.0 |
|||
_AlphaCutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 |
|||
[HideInInspector] _SurfaceType("__surfacetype", Float) = 0.0 |
|||
[HideInInspector] _BlendMode ("__blendmode", Float) = 0.0 |
|||
[HideInInspector] _SrcBlend ("__src", Float) = 1.0 |
|||
[HideInInspector] _DstBlend ("__dst", Float) = 0.0 |
|||
[HideInInspector] _ZWrite ("__zw", Float) = 1.0 |
|||
[HideInInspector] _CullMode("__cullmode", Float) = 2.0 |
|||
[Enum(None, 0, DoubleSided, 1)] _DoubleSidedMode("Double sided mode", Float) = 0 |
|||
|
|||
} |
|||
|
|||
HLSLINCLUDE |
|||
|
|||
#pragma target 5.0 |
|||
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Define |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#define UNITY_MATERIAL_UNLIT // Need to be define before including Material.hlsl |
|||
#pragma shader_feature _ALPHATEST_ON |
|||
#pragma shader_feature _ _DOUBLESIDED_LIGHTING_FLIP _DOUBLESIDED_LIGHTING_MIRROR |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "common.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Attributes.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPass.cs.hlsl" |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
${ShaderFunctions} |
|||
${ShaderPropertyUsages} |
|||
|
|||
float _AlphaCutoff; |
|||
|
|||
ENDHLSL |
|||
|
|||
SubShader |
|||
{ |
|||
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" } |
|||
LOD 300 |
|||
|
|||
// ------------------------------------------------------------------ |
|||
// Debug pass |
|||
Pass |
|||
{ |
|||
Name "Debug" |
|||
Tags { "LightMode" = "DebugViewMaterial" } |
|||
|
|||
Cull[_CullMode] |
|||
|
|||
HLSLPROGRAM |
|||
|
|||
#pragma vertex VertDefault |
|||
#pragma fragment Frag |
|||
|
|||
#define SHADERPASS SHADERPASS_DEBUG_VIEW_MATERIAL |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Material.hlsl" |
|||
|
|||
//Generated code : Begin |
|||
#{TemplatePass|useSurfaceData:{.*}|useFragInput:{.*}} |
|||
//Generated code : End |
|||
|
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPassDebugViewMaterial.hlsl" |
|||
|
|||
ENDHLSL |
|||
} |
|||
|
|||
// ------------------------------------------------------------------ |
|||
// forward pass |
|||
Pass |
|||
{ |
|||
Name "ForwardUnlit" |
|||
Tags { "LightMode" = "ForwardUnlit" } |
|||
|
|||
Blend [_SrcBlend] [_DstBlend] |
|||
ZWrite [_ZWrite] |
|||
Cull [_CullMode] |
|||
|
|||
HLSLPROGRAM |
|||
|
|||
#pragma vertex VertDefault |
|||
#pragma fragment Frag |
|||
|
|||
#define SHADERPASS SHADERPASS_FORWARD_UNLIT |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Material.hlsl" |
|||
|
|||
//Generated code : Begin |
|||
#{TemplatePass|useSurfaceData:{.*}|useFragInput:{positionWS}} |
|||
//Generated code : End |
|||
|
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPassForwardUnlit.hlsl" |
|||
|
|||
ENDHLSL |
|||
} |
|||
|
|||
// ------------------------------------------------------------------ |
|||
// Extracts information for lightmapping, GI (emission, albedo, ...) |
|||
// This pass it not used during regular rendering. |
|||
// ------------------------------------------------------------------ |
|||
Pass |
|||
{ |
|||
Name "META" |
|||
Tags{ "LightMode" = "Meta" } |
|||
|
|||
Cull Off |
|||
|
|||
HLSLPROGRAM |
|||
|
|||
// Lightmap memo |
|||
// DYNAMICLIGHTMAP_ON is used when we have an "enlighten lightmap" ie a lightmap updated at runtime by enlighten.This lightmap contain indirect lighting from realtime lights and realtime emissive material.Offline baked lighting(from baked material / light, |
|||
// both direct and indirect lighting) will hand up in the "regular" lightmap->LIGHTMAP_ON. |
|||
|
|||
#pragma vertex VertDefault |
|||
#pragma fragment Frag |
|||
|
|||
#define SHADERPASS SHADERPASS_LIGHT_TRANSPORT |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Material.hlsl" |
|||
|
|||
//Generated code : Begin |
|||
#{TemplatePass|useSurfaceData:{.*}|useFragInput:{.*}} |
|||
//Generated code : End |
|||
|
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPassLightTransport.hlsl" |
|||
|
|||
ENDHLSL |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7fae8307bc8d7854d905e06099720f28 |
|||
timeCreated: 1480345582 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.ScriptableRenderLoop |
|||
{ |
|||
public class ShaderGeneratorHelper |
|||
{ |
|||
// This function is a helper to follow unity convertion
|
|||
// when converting fooBar ro FOO_BAR
|
|||
public static string InsertUnderscore(string name) |
|||
{ |
|||
for (int i = 1; i < name.Length; i++) |
|||
{ |
|||
if (char.IsLower(name[i - 1]) && char.IsUpper(name[i])) |
|||
{ |
|||
// case switch, insert underscore
|
|||
name = name.Insert(i, "_"); |
|||
} |
|||
} |
|||
|
|||
return name; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9f21fb147ab7fad46be622fcd1bf9e99 |
|||
timeCreated: 1480327138 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue