Skip to content

Commit

Permalink
Merge pull request #41 from CyberAgentGameEntertainment/feature/rende…
Browse files Browse the repository at this point in the history
…ring_debugger_support

Rendering Debugger supports.
  • Loading branch information
Haruma-K authored Jan 6, 2023
2 parents 666e586 + a10ebf1 commit 8196fc8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Shader "Nova/Particles/UberLit"
// Unity Defined
#pragma multi_compile_fog
#pragma multi_compile_instancing
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#pragma instancing_options procedural:ParticleInstancingSetup
#pragma require 2darray

Expand Down Expand Up @@ -516,4 +517,4 @@ Shader "Nova/Particles/UberLit"
}
}
CustomEditor "Nova.Editor.Core.Scripts.ParticlesUberLitGUI"
}
}
3 changes: 2 additions & 1 deletion Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Shader "Nova/Particles/UberUnlit"
// Unity Defined
#pragma multi_compile_fog
#pragma multi_compile_instancing
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#pragma instancing_options procedural:ParticleInstancingSetup
#pragma require 2darray

Expand Down Expand Up @@ -464,4 +465,4 @@ Shader "Nova/Particles/UberUnlit"
}
}
CustomEditor "Nova.Editor.Core.Scripts.ParticlesUberUnlitGUI"
}
}
32 changes: 30 additions & 2 deletions Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlitForward.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@
#define NOVA_PARTICLESUBERUNLITFORWARD_INCLUDED

#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#ifdef DEBUG_DISPLAY // for backward compatibility
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl"
#endif
#include "ParticlesUberUnlit.hlsl"

void InitializeInputData(out InputData inputData, Varyings input)
{
inputData = (InputData)0;

// InputData is only used for DebugDisplay purposes in Unlit.
// This is implemented with reference to Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl.
inputData.positionWS = half3(0, 0, 0);
inputData.normalWS = half3(0, 0, 1);
inputData.viewDirectionWS = half3(0, 0, 1);
inputData.shadowCoord = 0;
inputData.fogCoord = 0;
inputData.vertexLighting = half3(0, 0, 0);
inputData.bakedGI = half3(0, 0, 0);
inputData.normalizedScreenSpaceUV = 0;
inputData.shadowMask = half4(1, 1, 1, 1);
}

Varyings vert(Attributes input)
{
float3 positionWS;
Expand All @@ -12,7 +32,15 @@ Varyings vert(Attributes input)

half4 frag(Varyings input) : SV_Target
{
return fragUnlit(input, true, true);
InputData inputData;
InitializeInputData(inputData, input);

half4 color = fragUnlit(input, true, true);
#ifdef DEBUG_DISPLAY // for backward compatibility
color = UniversalFragmentUnlit(inputData, color.rgb, color.a);
#endif
color.rgb = MixFog(color.rgb, inputData.fogCoord);
return color;
}

#endif
#endif

0 comments on commit 8196fc8

Please sign in to comment.