sebastienlagarde
8 年前
当前提交
996cc98f
共有 21 个文件被更改,包括 162 次插入 和 142 次删除
-
6Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewMaterialGBuffer.shader
-
11Assets/ScriptableRenderLoop/HDRenderLoop/Editor/HDRenderLoopInspector.cs
-
19Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
3Assets/ScriptableRenderLoop/HDRenderLoop/Material/LayeredLit/LayeredLit.shader
-
5Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.shader
-
22Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitData.hlsl
-
16Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.shader
-
11Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/UnlitData.hlsl
-
2Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPassDebugViewMaterial.hlsl
-
31Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs
-
27Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.hlsl.meta
-
12Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.meta
-
60Assets/ScriptableRenderLoop/HDRenderLoop/Material/Attributes.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Material/Attributes.hlsl.meta
-
15Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.hlsl.meta
-
28Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitDebugPass.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitDebugPass.hlsl.meta
-
0/Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/UnlitSharePass.hlsl
-
0/Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/UnlitSharePass.hlsl.meta
|
|||
using UnityEngine; |
|||
|
|||
namespace UnityEngine.Experimental.ScriptableRenderLoop |
|||
{ |
|||
namespace Attributes |
|||
{ |
|||
// 0 is reserved!
|
|||
|
|||
[GenerateHLSL] |
|||
public enum DebugViewVarying |
|||
{ |
|||
Texcoord0 = 1, |
|||
Texcoord1, |
|||
Texcoord2, |
|||
Texcoord3, |
|||
VertexTangentWS, |
|||
VertexBitangentWS, |
|||
VertexNormalWS, |
|||
VertexColor, |
|||
VertexColorAlpha, |
|||
}; |
|||
|
|||
// Number must be contiguous
|
|||
[GenerateHLSL] |
|||
public enum DebugViewGbuffer |
|||
{ |
|||
Depth = DebugViewVarying.VertexColor + 1, |
|||
BakeDiffuseLighting, |
|||
} |
|||
} |
|||
} // namespace UnityEngine.Experimental.ScriptableRenderLoop
|
|
|||
// |
|||
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs. Please don't edit by hand. |
|||
// |
|||
|
|||
#ifndef DEBUGVIEWMATERIAL_CS_HLSL |
|||
#define DEBUGVIEWMATERIAL_CS_HLSL |
|||
// |
|||
// UnityEngine.Experimental.ScriptableRenderLoop.Attributes.DebugViewVarying: static fields |
|||
// |
|||
#define DEBUGVIEWVARYING_TEXCOORD0 (1) |
|||
#define DEBUGVIEWVARYING_TEXCOORD1 (2) |
|||
#define DEBUGVIEWVARYING_TEXCOORD2 (3) |
|||
#define DEBUGVIEWVARYING_TEXCOORD3 (4) |
|||
#define DEBUGVIEWVARYING_VERTEX_TANGENT_WS (5) |
|||
#define DEBUGVIEWVARYING_VERTEX_BITANGENT_WS (6) |
|||
#define DEBUGVIEWVARYING_VERTEX_NORMAL_WS (7) |
|||
#define DEBUGVIEWVARYING_VERTEX_COLOR (8) |
|||
#define DEBUGVIEWVARYING_VERTEX_COLOR_ALPHA (9) |
|||
|
|||
// |
|||
// UnityEngine.Experimental.ScriptableRenderLoop.Attributes.DebugViewGbuffer: static fields |
|||
// |
|||
#define DEBUGVIEWGBUFFER_DEPTH (9) |
|||
#define DEBUGVIEWGBUFFER_BAKE_DIFFUSE_LIGHTING (10) |
|||
|
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 972a0c56f0332c84f95914786d1f2f4b |
|||
timeCreated: 1479292942 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4a6949840f48a7948a9610d89e539bf9 |
|||
timeCreated: 1479292895 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//------------------------------------------------------------------------------------- |
|||
// FragInput |
|||
// This structure gather all possible varying/interpolator for this shader. |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.hlsl" |
|||
|
|||
struct FragInput |
|||
{ |
|||
float4 unPositionSS; // This is the position return by VPOS (That is name positionCS in PackedVarying), only xy is use |
|||
float3 positionWS; |
|||
float2 texCoord0; |
|||
float2 texCoord1; |
|||
float2 texCoord2; |
|||
float2 texCoord3; |
|||
float3 tangentToWorld[3]; |
|||
float4 vertexColor; |
|||
|
|||
// For velocity |
|||
// Note: Z component is not use |
|||
float4 positionCS; // This is the clip spae position. Warning, do not confuse with the value of positionCS in PackedVarying which is VPOS and store in unPositionSS |
|||
float4 previousPositionCS; |
|||
|
|||
// For two sided lighting |
|||
bool isFrontFace; |
|||
}; |
|||
|
|||
void GetVaryingsDataDebug(uint paramId, FragInput input, inout float3 result, inout bool needLinearToSRGB) |
|||
{ |
|||
switch (paramId) |
|||
{ |
|||
case DEBUGVIEWVARYING_TEXCOORD0: |
|||
result = float3(input.texCoord0 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEWVARYING_TEXCOORD1: |
|||
result = float3(input.texCoord1 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEWVARYING_TEXCOORD2: |
|||
result = float3(input.texCoord2 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEWVARYING_TEXCOORD3: |
|||
result = float3(input.texCoord3 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEWVARYING_VERTEX_TANGENT_WS: |
|||
result = input.tangentToWorld[0].xyz * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGVIEWVARYING_VERTEX_BITANGENT_WS: |
|||
result = input.tangentToWorld[1].xyz * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGVIEWVARYING_VERTEX_NORMAL_WS: |
|||
result = input.tangentToWorld[2].xyz * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGVIEWVARYING_VERTEX_COLOR: |
|||
result = input.vertexColor.rgb; needLinearToSRGB = true; |
|||
break; |
|||
case DEBUGVIEWVARYING_VERTEX_COLOR_ALPHA: |
|||
result = input.vertexColor.aaa; |
|||
break; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6d56e29698894b440905cc5d63814ef9 |
|||
timeCreated: 1479292899 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// CAUTION: 0 is a reserved numbers meaning there is no debug view mode |
|||
// All number below folow each others! |
|||
|
|||
// Must be in sync with DebugViewVaryingMode |
|||
#define DEBUGVIEW_VARYING_TEXCOORD0 1 |
|||
#define DEBUGVIEW_VARYING_TEXCOORD1 2 |
|||
#define DEBUGVIEW_VARYING_TEXCOORD2 3 |
|||
#define DEBUGVIEW_VARYING_VERTEXTANGENTWS 4 |
|||
#define DEBUGVIEW_VARYING_VERTEXBITANGENTWS 5 |
|||
#define DEBUGVIEW_VARYING_VERTEXNORMALWS 6 |
|||
#define DEBUGVIEW_VARYING_VERTEXCOLOR 7 |
|||
|
|||
// These define are sepcific to GBuffer |
|||
#define DEBUGVIEW_GBUFFER_DEPTH 10 |
|||
#define DEBUGVIEW_GBUFFER_BAKEDIFFUSELIGHTING 11 |
|
|||
fileFormatVersion: 2 |
|||
guid: 9048292f91ac48d479ce668c5aabf122 |
|||
timeCreated: 1476053153 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef SHADERPASS |
|||
#error Undefine_SHADERPASS |
|||
#endif |
|||
|
|||
void GetVaryingsDataDebug(uint paramId, FragInput input, inout float3 result, inout bool needLinearToSRGB) |
|||
{ |
|||
switch (paramId) |
|||
{ |
|||
case DEBUGVIEW_VARYING_TEXCOORD0: |
|||
result = float3(input.texCoord0 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEW_VARYING_TEXCOORD1: |
|||
result = float3(input.texCoord1 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEW_VARYING_TEXCOORD2: |
|||
result = float3(input.texCoord2 * 0.5 + 0.5, 0.0); |
|||
break; |
|||
case DEBUGVIEW_VARYING_VERTEXTANGENTWS: |
|||
result = input.tangentToWorld[0].xyz * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGVIEW_VARYING_VERTEXBITANGENTWS: |
|||
result = input.tangentToWorld[1].xyz * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGVIEW_VARYING_VERTEXNORMALWS: |
|||
result = input.tangentToWorld[2].xyz * 0.5 + 0.5; |
|||
break; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: afea19c25b5e93847af6262c2c00401f |
|||
timeCreated: 1478601047 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue