Julien Ignace
8 年前
当前提交
06725f27
共有 18 个文件被更改,包括 866 次插入 和 51 次删除
-
2Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset
-
98Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
27Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/DisneyGGX.shader
-
17Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/DisneyGGX.hlsl
-
145Assets/TestScenes/HDTest/EnlightenTest.unity
-
26Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Gray.mat
-
26Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Green.mat
-
26Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Red.mat
-
95Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Terrain.mat
-
26Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test.mat
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug.meta
-
257Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Blue_Alpha.mat
-
8Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Blue_Alpha.mat.meta
-
25Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugCommon.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugCommon.hlsl.meta
-
112Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/GBufferDebug.shader
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/GBufferDebug.shader.meta
|
|||
fileFormatVersion: 2 |
|||
guid: ee4b12281385a0a4791e3128dd34eae4 |
|||
folderAsset: yes |
|||
timeCreated: 1475748186 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
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: Blue_Alpha |
|||
m_Shader: {fileID: 4800000, guid: e1a84346ee54f9f4993c2f05c59805a0, type: 3} |
|||
m_ShaderKeywords: _EMISSION _NORMALMAP_TANGENT_SPACE |
|||
m_LightmapFlags: 1 |
|||
m_CustomRenderQueue: 3000 |
|||
stringTagMap: |
|||
RenderType: Transparent |
|||
m_SavedProperties: |
|||
serializedVersion: 2 |
|||
m_TexEnvs: |
|||
- first: |
|||
name: _AmbientOcclusionMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _BaseColorMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _BumpMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _DetailAlbedoMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _DetailMask |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _DetailNormalMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _DiffuseLightingMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _EmissionMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _EmissiveColorMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _HeightMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _MainTex |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _MaskMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _MetallicGlossMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _MettalicMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _NormalMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _OcclusionMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _ParallaxMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _SmoothnessMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _SpecularOcclusionMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- first: |
|||
name: _SubSurfaceRadiusMap |
|||
second: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- first: |
|||
name: _AlphaCutoff |
|||
second: 0.5 |
|||
- first: |
|||
name: _AlphaCutoffEnable |
|||
second: 0 |
|||
- first: |
|||
name: _BlendMode |
|||
second: 0 |
|||
- first: |
|||
name: _BumpScale |
|||
second: 1 |
|||
- first: |
|||
name: _CullMode |
|||
second: 0 |
|||
- first: |
|||
name: _Cutoff |
|||
second: 0.5 |
|||
- first: |
|||
name: _DetailNormalMapScale |
|||
second: 1 |
|||
- first: |
|||
name: _DoubleSided |
|||
second: 1 |
|||
- first: |
|||
name: _DoubleSidedLigthing |
|||
second: 1 |
|||
- first: |
|||
name: _DoubleSidedMode |
|||
second: 1 |
|||
- first: |
|||
name: _DstBlend |
|||
second: 10 |
|||
- first: |
|||
name: _EmissiveColorMode |
|||
second: 1 |
|||
- first: |
|||
name: _EmissiveIntensity |
|||
second: 0 |
|||
- first: |
|||
name: _GlossMapScale |
|||
second: 1 |
|||
- first: |
|||
name: _Glossiness |
|||
second: 0.5 |
|||
- first: |
|||
name: _GlossyReflections |
|||
second: 1 |
|||
- first: |
|||
name: _HeightBias |
|||
second: 0 |
|||
- first: |
|||
name: _HeightMapMode |
|||
second: 0 |
|||
- first: |
|||
name: _HeightScale |
|||
second: 1 |
|||
- first: |
|||
name: _MaterialID |
|||
second: 0 |
|||
- first: |
|||
name: _MaterialId |
|||
second: 0 |
|||
- first: |
|||
name: _Metallic |
|||
second: 0 |
|||
- first: |
|||
name: _Mettalic |
|||
second: 0 |
|||
- first: |
|||
name: _Mode |
|||
second: 0 |
|||
- first: |
|||
name: _NormalMapSpace |
|||
second: 0 |
|||
- first: |
|||
name: _OcclusionStrength |
|||
second: 1 |
|||
- first: |
|||
name: _Parallax |
|||
second: 0.02 |
|||
- first: |
|||
name: _Smoothness |
|||
second: 0.5 |
|||
- first: |
|||
name: _SmoothnessTextureChannel |
|||
second: 0 |
|||
- first: |
|||
name: _SpecularHighlights |
|||
second: 1 |
|||
- first: |
|||
name: _SrcBlend |
|||
second: 5 |
|||
- first: |
|||
name: _SubSurfaceRadius |
|||
second: 0 |
|||
- first: |
|||
name: _SurfaceType |
|||
second: 1 |
|||
- first: |
|||
name: _UVSec |
|||
second: 0 |
|||
- first: |
|||
name: _ZWrite |
|||
second: 0 |
|||
m_Colors: |
|||
- first: |
|||
name: _BaseColor |
|||
second: {r: 0.1557093, g: 0.33766845, b: 0.5882352, a: 0.672} |
|||
- first: |
|||
name: _Color |
|||
second: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1} |
|||
- first: |
|||
name: _EmissionColor |
|||
second: {r: 0, g: 0, b: 0, a: 1} |
|||
- first: |
|||
name: _EmissiveColor |
|||
second: {r: 0, g: 0, b: 0, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6816da50441b49245843695729d8968c |
|||
timeCreated: 1475573357 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
|
|||
// List of material debug modes. Keep in sync with HDRenderLoop.MaterialDebugMode |
|||
#define MaterialDebugNone 0, |
|||
#define MaterialDebugDiffuseColor 1 |
|||
#define MaterialDebugNormal 2 |
|||
#define MaterialDebugDepth 3 |
|||
#define MaterialDebugAO 4 |
|||
#define MaterialDebugSpecularColor 5 |
|||
#define MaterialDebugSpecularOcclusion 6 |
|||
#define MaterialDebugSmoothness 7 |
|||
#define MaterialDebugMaterialId 8 |
|||
#define MaterialDebugUV0 9 |
|||
#define MaterialDebugTangent 10 |
|||
#define MaterialDebugBitangent 11 |
|||
|
|||
// List of GBuffer debug modes. Keep in sync with HDRenderLoop.GBufferDebugMode |
|||
#define GBufferDebugNone 0 |
|||
#define GBufferDebugDiffuseColor 1 |
|||
#define GBufferDebugNormal 2 |
|||
#define GBufferDebugDepth 3 |
|||
#define GBufferDebugBakedDiffuse 4 |
|||
#define GBufferDebugSpecularColor 5 |
|||
#define GBufferDebugSpecularOcclustion 6 |
|||
#define GBufferDebugSmoothness 7 |
|||
#define GBufferDebugMaterialId 8 |
|
|||
fileFormatVersion: 2 |
|||
guid: 3babddf8b47eecd48ac0a07efc211c0c |
|||
timeCreated: 1475754031 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/Unity/GBufferDebug" |
|||
{ |
|||
SubShader |
|||
{ |
|||
|
|||
Pass |
|||
{ |
|||
ZWrite Off |
|||
Blend One Zero |
|||
|
|||
HLSLPROGRAM |
|||
#pragma target 5.0 |
|||
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev |
|||
|
|||
#pragma vertex VertDeferred |
|||
#pragma fragment FragDeferred |
|||
|
|||
// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_DISNEYGXX |
|||
#define UNITY_MATERIAL_DISNEYGXX // Need to be define before including Material.hlsl |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderVariables.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugCommon.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/ShaderLibrary/Color.hlsl" |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_CameraGBufferTexture); |
|||
Texture2D _CameraDepthTexture; |
|||
float4 _ScreenSize; |
|||
float _DebugMode; |
|||
float4x4 _InvViewProjMatrix; |
|||
|
|||
struct Attributes |
|||
{ |
|||
float3 positionOS : POSITION; |
|||
}; |
|||
|
|||
struct Varyings |
|||
{ |
|||
float4 positionHS : SV_POSITION; |
|||
}; |
|||
|
|||
Varyings VertDeferred(Attributes input) |
|||
{ |
|||
// TODO: implement SV_vertexID full screen quad |
|||
// Lights are draw as one fullscreen quad |
|||
Varyings output; |
|||
float3 positionWS = TransformObjectToWorld(input.positionOS); |
|||
output.positionHS = TransformWorldToHClip(positionWS); |
|||
|
|||
return output; |
|||
} |
|||
|
|||
float4 FragDeferred(Varyings input) : SV_Target |
|||
{ |
|||
Coordinate coord = GetCoordinate(input.positionHS.xy, _ScreenSize.zw); |
|||
|
|||
float depth = _CameraDepthTexture.Load(uint3(coord.unPositionSS, 0)).x; |
|||
|
|||
FETCH_GBUFFER(gbuffer, _CameraGBufferTexture, coord.unPositionSS); |
|||
BSDFData bsdfData = DECODE_FROM_GBUFFER(gbuffer); |
|||
|
|||
float3 result = float3(1.0, 1.0, 0.0); |
|||
bool outputIsLinear = false; |
|||
|
|||
if (_DebugMode == GBufferDebugDiffuseColor) |
|||
{ |
|||
result = bsdfData.diffuseColor; |
|||
} |
|||
else if (_DebugMode == GBufferDebugNormal) |
|||
{ |
|||
result = bsdfData.normalWS * 0.5 + 0.5; |
|||
bool outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugDepth) |
|||
{ |
|||
result = bsdfData.diffuseColor; |
|||
} |
|||
else if (_DebugMode == GBufferDebugBakedDiffuse) |
|||
{ |
|||
result = bsdfData.diffuseLightingAndEmissive; |
|||
outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugSpecularColor) |
|||
{ |
|||
result = bsdfData.fresnel0; |
|||
} |
|||
else if (_DebugMode == GBufferDebugSpecularOcclustion) |
|||
{ |
|||
result = bsdfData.specularOcclusion.xxx; |
|||
outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugSmoothness) |
|||
{ |
|||
result = (1.0 - bsdfData.perceptualRoughness).xxx; |
|||
outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugMaterialId) |
|||
{ |
|||
result = bsdfData.materialId.xxx; |
|||
outputIsLinear = true; |
|||
} |
|||
if (outputIsLinear) |
|||
result = SRGBToLinear(max(0, result)); |
|||
|
|||
return float4(result, 1.0); |
|||
} |
|||
|
|||
ENDHLSL |
|||
} |
|||
|
|||
} |
|||
Fallback Off |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: beffb29605949f0429be0427db7a9993 |
|||
timeCreated: 1475748193 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue