GitHub
8 年前
当前提交
61e8c0e0
共有 19 个文件被更改,包括 1090 次插入 和 39 次删除
-
181Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
102Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/DisneyGGX.shader
-
3Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/DisneyGGX.hlsl
-
11Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl
-
103Assets/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
-
104Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs
-
12Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs.meta
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug.meta
-
264Assets/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
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/GBufferDebug.shader.meta
-
116Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/GBufferDebug.shader
|
|||
using UnityEngine; |
|||
using System.Collections; |
|||
using UnityEngine.Rendering; |
|||
using System.Collections.Generic; |
|||
using System; |
|||
|
|||
using UnityEditor; |
|||
|
|||
//using EditorGUIUtility=UnityEditor.EditorGUIUtility;
|
|||
|
|||
namespace UnityEngine.ScriptableRenderLoop |
|||
{ |
|||
[CustomEditor(typeof(HDRenderLoop))] |
|||
public class HDRenderLoopInspector : Editor |
|||
{ |
|||
private class Styles |
|||
{ |
|||
public readonly GUIContent debugParameters = new GUIContent("Debug Parameters"); |
|||
public readonly GUIContent materialDebugMode = new GUIContent("Material Debug Mode", "Display various properties of Materials."); |
|||
public readonly GUIContent transparentMaterialDebugMode = new GUIContent("Transparent Material Debug", "Display material debug for transparent objects."); |
|||
public readonly GUIContent gBufferDebugMode = new GUIContent("GBuffer Debug Mode", "Display various properties of contained in the GBuffer."); |
|||
|
|||
public readonly GUIContent displayOpaqueObjects = new GUIContent("Display Opaque Objects", "Toggle opaque objects rendering on and off."); |
|||
public readonly GUIContent displayTransparentObjects = new GUIContent("Display Transparent Objects", "Toggle transparent objects rendering on and off."); |
|||
|
|||
public readonly GUIContent[] materialDebugStrings = { new GUIContent("None"), |
|||
new GUIContent("Diffuse Color"), |
|||
new GUIContent("Normal"), |
|||
new GUIContent("Depth"), |
|||
new GUIContent("Ambient Occlusion"), |
|||
new GUIContent("Specular Color"), |
|||
new GUIContent("Specular Occlusion"), |
|||
new GUIContent("Smoothness"), |
|||
new GUIContent("MaterialId"), |
|||
new GUIContent("UV0"), |
|||
new GUIContent("Tangent"), |
|||
new GUIContent("Bitangent") |
|||
}; |
|||
public readonly int[] materialDebugValues = { (int)HDRenderLoop.MaterialDebugMode.None, |
|||
(int)HDRenderLoop.MaterialDebugMode.DiffuseColor, |
|||
(int)HDRenderLoop.MaterialDebugMode.Normal, |
|||
(int)HDRenderLoop.MaterialDebugMode.Depth, |
|||
(int)HDRenderLoop.MaterialDebugMode.AmbientOcclusion, |
|||
(int)HDRenderLoop.MaterialDebugMode.SpecularColor, |
|||
(int)HDRenderLoop.MaterialDebugMode.SpecularOcclustion, |
|||
(int)HDRenderLoop.MaterialDebugMode.Smoothness, |
|||
(int)HDRenderLoop.MaterialDebugMode.MaterialId, |
|||
(int)HDRenderLoop.MaterialDebugMode.UV0, |
|||
(int)HDRenderLoop.MaterialDebugMode.Tangent, |
|||
(int)HDRenderLoop.MaterialDebugMode.Bitangent |
|||
}; |
|||
public readonly GUIContent[] gBufferDebugStrings = { new GUIContent("None"), |
|||
new GUIContent("Diffuse Color"), |
|||
new GUIContent("Normal"), |
|||
new GUIContent("Depth"), |
|||
new GUIContent("Baked Diffuse"), |
|||
new GUIContent("Specular Color"), |
|||
new GUIContent("Specular Occlusion"), |
|||
new GUIContent("Smoothness"), |
|||
new GUIContent("MaterialId") |
|||
}; |
|||
public readonly int[] gBufferDebugValues = { (int)HDRenderLoop.GBufferDebugMode.None, |
|||
(int)HDRenderLoop.GBufferDebugMode.DiffuseColor, |
|||
(int)HDRenderLoop.GBufferDebugMode.Normal, |
|||
(int)HDRenderLoop.GBufferDebugMode.Depth, |
|||
(int)HDRenderLoop.GBufferDebugMode.BakedDiffuse, |
|||
(int)HDRenderLoop.GBufferDebugMode.SpecularColor, |
|||
(int)HDRenderLoop.GBufferDebugMode.SpecularOcclustion, |
|||
(int)HDRenderLoop.GBufferDebugMode.Smoothness, |
|||
(int)HDRenderLoop.GBufferDebugMode.MaterialId |
|||
}; |
|||
} |
|||
|
|||
private static Styles s_Styles = null; |
|||
private static Styles styles { get { if (s_Styles == null) s_Styles = new Styles(); return s_Styles; } } |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
HDRenderLoop renderLoop = target as HDRenderLoop; |
|||
if(renderLoop) |
|||
{ |
|||
HDRenderLoop.DebugParameters debugParameters = renderLoop.debugParameters; |
|||
|
|||
EditorGUILayout.LabelField(styles.debugParameters); |
|||
EditorGUI.indentLevel++; |
|||
EditorGUI.BeginChangeCheck(); |
|||
|
|||
debugParameters.gBufferDebugMode = (HDRenderLoop.GBufferDebugMode)EditorGUILayout.IntPopup(styles.gBufferDebugMode, (int)debugParameters.gBufferDebugMode, styles.gBufferDebugStrings, styles.gBufferDebugValues); |
|||
debugParameters.materialDebugMode = (HDRenderLoop.MaterialDebugMode)EditorGUILayout.IntPopup(styles.materialDebugMode, (int)debugParameters.materialDebugMode, styles.materialDebugStrings, styles.materialDebugValues); |
|||
debugParameters.displayMaterialDebugForTransparent = EditorGUILayout.Toggle(styles.transparentMaterialDebugMode, debugParameters.displayMaterialDebugForTransparent); |
|||
|
|||
EditorGUILayout.Space(); |
|||
debugParameters.displayOpaqueObjects = EditorGUILayout.Toggle(styles.displayOpaqueObjects, debugParameters.displayOpaqueObjects); |
|||
debugParameters.displayTransparentObjects = EditorGUILayout.Toggle(styles.displayTransparentObjects, debugParameters.displayTransparentObjects); |
|||
|
|||
if(EditorGUI.EndChangeCheck()) |
|||
{ |
|||
EditorUtility.SetDirty(renderLoop); // Repaint
|
|||
} |
|||
EditorGUI.indentLevel--; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6e8669cdde22f4948a090da4b5fb5b7c |
|||
timeCreated: 1475763911 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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: _ALPHACUTOFFENABLE_OFF _DOUBLESIDED_LIGHTING_MIRROR _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: _DistortionDepthTest |
|||
second: 0 |
|||
- first: |
|||
name: _DistortionOnly |
|||
second: 0 |
|||
- first: |
|||
name: _DoubleSided |
|||
second: 1 |
|||
- first: |
|||
name: _DoubleSidedLigthing |
|||
second: 1 |
|||
- first: |
|||
name: _DoubleSidedMode |
|||
second: 3 |
|||
- 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.3118512, g: 0.49926913, b: 0.75735295, 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: |
|
|||
fileFormatVersion: 2 |
|||
guid: beffb29605949f0429be0427db7a9993 |
|||
timeCreated: 1475748193 |
|||
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_DISNEYGGX // 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); |
|||
DECLARE_GBUFFER_BAKE_LIGHTING(_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; |
|||
outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugDepth) |
|||
{ |
|||
float linearDepth = frac(LinearEyeDepth(depth, _ZBufferParams) * 0.1); |
|||
result = linearDepth.xxx; |
|||
outputIsLinear = true; |
|||
} |
|||
else if (_DebugMode == GBufferDebugBakedDiffuse) |
|||
{ |
|||
FETCH_BAKE_LIGHTING_GBUFFER(gbuffer, _CameraGBufferTexture, coord.unPositionSS); |
|||
result = DECODE_BAKE_LIGHTING_FROM_GBUFFER(gbuffer); |
|||
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 |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue