Skip to content

Commit

Permalink
feat: add deferred rendering (#264)
Browse files Browse the repository at this point in the history
* feat: semi-deferred rendering

* refactor: cleanup setting targets

* chore: ae hook

* feat: full albedo, improved snow shader support

* feat: deferred direct and ambient light

* feat: octahedron normal encoding

* fix: increased normal precision

* feat: normal mapping shadows

* feat: blur normal mapping shadows with groupshared

* feat: separated normal mapping shadows pass

* chore: optimised sampling and formats

* chore: further optimisation

* fix: depth distance

* fix: disabling CS ingame

* feat: use alpha channel of render targets

* fix: envmapping with deferred

* fix: output color

* feat: add initial VR support

* feat: moved screenspace shadows to deferred

* fix: fix VR hook for shadowmask (#229)

* chore: screenspace shadows performance tweaks

* feat: wip porting screen shadows to deferred

* feat: bend studios shadows

* feat: naive bilateral blur and optimisations

* Delete FilterCS2.hlsl

* fix: removed unused filtering

* fix: missing ae hook

* feat: fixed double sided mesh shading

* chore: more optimal wave size

* chore: halve kernel radius for performance

* chore: revise shadow settings

* chore: optimisations, cleanup and moved NMS out of Bindings

* chore: removed dirlight shadows from deferred

* fix: black horizon

* chore: cleanup cleaning up of bindings

* chore: optimised blur + fixes

* chore: optimise normal mapping shadows

* fix: black grass

* fix: tree lod normals

* fix: vegetation detection

* fix: ignore first-person

* chore: adjust default shadows settings

* fix: multi-layer parallax deferred

* feat: add ssgi and terrain occlusion (#255)

* build: fix compilation errors in terrainocclusion (#256)

* style: 🎨 apply clang-format changes

* fix: fix warning `Ternary error with non scalar` (#262)

* refactor: simplify VR code and structures (#261)

* revert: "fix: fix warning `Ternary error with non scalar`" (#265)

* fix: fix compilation errors

* refactor: use state version of render members

* fix: convert Albedo to Diffuse

* fix: fix compilation errors

* style: 🎨 apply clang-format changes

* feat: interior directional light

* fix: disable vertex fix on foliage

* fix: compiler warning with SSGI

* style: 🎨 apply clang-format changes

* feat: ported SSS to deferred

* style: 🎨 apply clang-format changes

* fix: consistent padding in shaders for older cards

* fix: foliage shadows

* style: 🎨 apply clang-format changes

* chore: update to latest CLIB-NG

* feat: variable rate shading (#270)

* feat: variable rate shading with nvapi extensions

* feat: FFR test

* feat: adaptive rate shading

* feat: motion VRS

* feat: finalising VRS

* style: 🎨 apply clang-format changes

* fix: VRS merge

* fix: fix vrs merge

* fix: foliage mask

* style: 🎨 apply clang-format changes

* fix: black tree LOD

* style: 🎨 apply clang-format changes

* fix: disable VRS on water

* fix: fix common VR includes

* refactor: Rename newly added hlsl without entry to hlsli

* fix: depth linearisation

* chore: soft shadow as per RDR2

* fix: remove cloud shadows macros from rungrass and distanttree

* fix: use GET_INSTANCE_MEMBER macro to get proper state runtime

* chore: rename to deferred, VRS in interiors only

* style: 🎨 apply clang-format changes

* fix: SSS blur direction

* chore: reduce VRS threshold

* chore: removed tree LOD lighting feature

* feat: port deferred DistantTree to VR

* feat: add deferred screen space shadows for VR

* fix: check for compute shader file existence (#280)

* fix: undo delete of ComputeShadingRate.hlsl

* fix: add back GetScreenDepth to RaymarchCS

* feat: grass lighting deferred support

* style: 🎨 apply clang-format changes

* feat: screenspace shadow VR support

* style: 🎨 apply clang-format changes

* fix: shader errors and warnings

* feat: effect shader deferred support

* style: 🎨 apply clang-format changes

* fix: effect shader compile issue

* style: 🎨 apply clang-format changes

* chore: fix hlsl warnings

* fix: add hlsl include guards

* chore: match alphatest naming

* feat: re effect for VR

* feat: re effect shader for VR (#286)

* chore: fix hlsl warnings

* fix: add hlsl include guards

* chore: match alphatest naming

* feat: re effect for VR

* chore: minor changes (#287)

* chore: comment changes

* chore: terraocc logic in common header for future forward integration

* fix: fix compilation errors

* feat: re effect for VR

* Merge branch 'dev' of https://github.com/doodlum/skyrim-community-shaders into deferred-shadows

* fix: fix VR normal space shadows

* chore: correct parameter description

* build: bump commonlibng

---------

Co-authored-by: Tim <[email protected]>
Co-authored-by: C. S <[email protected]>
Co-authored-by: doodlum <[email protected]>
Co-authored-by: Pentalimbed <[email protected]>
Co-authored-by: FlayaN <[email protected]>
  • Loading branch information
6 people authored May 1, 2024
1 parent 7ff9ed7 commit ef9acef
Show file tree
Hide file tree
Showing 77 changed files with 6,658 additions and 2,100 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "extern/CommonLibSSE-NG"]
path = extern/CommonLibSSE-NG
url = https://github.com/alandtse/CommonLibVR.git
[submodule "extern/NVAPI"]
path = extern/NVAPI
url = https://github.com/NVIDIA/nvapi.git
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ find_package(pystring CONFIG REQUIRED)
find_package(cppwinrt CONFIG REQUIRED)
find_package(unordered_dense CONFIG REQUIRED)
find_package(efsw CONFIG REQUIRED)

set(NVAPI_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/extern/nvapi/" CACHE STRING "Path to NVAPI include headers/shaders" )
set(NVAPI_LIBRARY "${CMAKE_SOURCE_DIR}/extern/nvapi/amd64/nvapi64.lib" CACHE STRING "Path to NVAPI .lib file")

target_include_directories(
${PROJECT_NAME}
PRIVATE
${BSHOSHANY_THREAD_POOL_INCLUDE_DIRS}
${CLIB_UTIL_INCLUDE_DIRS}
${NVAPI_INCLUDE_DIR}
)

target_link_libraries(
Expand All @@ -63,6 +68,7 @@ target_link_libraries(
pystring::pystring
unordered_dense::unordered_dense
efsw::efsw
${NVAPI_LIBRARY}
)

# https://gitlab.kitware.com/cmake/cmake/-/issues/24922#note_1371990
Expand Down
2 changes: 1 addition & 1 deletion extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG updated 44 files
+2 −0 cmake/sourcelist.cmake
+3 −3 include/RE/B/BGSDefaultObjectManager.h
+30 −2 include/RE/B/BSCullingProcess.h
+4 −3 include/RE/B/BSLight.h
+19 −0 include/RE/B/BSShaderRenderTargets.h
+38 −0 include/RE/B/BSShadowDirectionalLight.h
+31 −0 include/RE/B/BSShadowFrustumLight.h
+45 −46 include/RE/B/BSShadowLight.h
+28 −0 include/RE/B/BSShadowParabolicLight.h
+2 −2 include/RE/B/BSSoundHandle.h
+1 −1 include/RE/C/CombatController.h
+3 −3 include/RE/C/CombatGroup.h
+14 −13 include/RE/C/CombatManager.h
+1 −0 include/RE/C/ConstructibleObjectMenu.h
+1 −0 include/RE/C/CraftingMenu.h
+8 −0 include/RE/C/CraftingSubMenu.h
+18 −0 include/RE/I/InterfaceLightSchemes.h
+30 −27 include/RE/I/Inventory3DManager.h
+1 −0 include/RE/M/MagicMenu.h
+58 −0 include/RE/N/NiBillboardNode.h
+2 −0 include/RE/N/NiCamera.h
+1 −1 include/RE/N/NiCullingProcess.h
+1 −0 include/RE/N/NiPoint3.h
+29 −5 include/RE/N/NiPointLight.h
+0 −1 include/RE/N/NiStream.h
+20 −13 include/RE/S/ShadowSceneNode.h
+10 −7 include/RE/S/Sky.h
+1 −0 include/RE/S/SmithingMenu.h
+5 −0 include/RE/Skyrim.h
+9 −9 include/RE/T/TESObjectCELL.h
+9 −0 include/RE/T/TESObjectLIGH.h
+1 −14 include/RE/U/UI3DSceneManager.h
+532 −531 include/REL/ID.h
+76 −74 include/REL/Module.h
+13 −13 include/REL/Offset.h
+191 −176 include/REL/Version.h
+3 −1 src/RE/A/Actor.cpp
+1 −1 src/RE/B/BSSoundHandle.cpp
+8 −1 src/RE/I/Inventory3DManager.cpp
+6 −1 src/RE/N/NiCamera.cpp
+5 −0 src/RE/N/NiPoint3.cpp
+67 −10 src/RE/S/Sky.cpp
+26 −23 src/REL/ID.cpp
+3 −4 src/REL/Module.cpp
1 change: 1 addition & 0 deletions extern/NVAPI
Submodule NVAPI added at 3a83ef
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#include "../Common/DeferredShared.hlsli"
#include "../Common/VR.hlsli"

struct PerPassCloudShadow
{
uint EnableCloudShadows;

float CloudHeight;
float PlanetRadius;

float EffectMix;

float TransparencyPower;
float AbsorptionAmbient;

float RcpHPlusR;
};

StructuredBuffer<PerPassCloudShadow> perPassCloudShadow : register(t23);
TextureCube<float4> cloudShadows : register(t40);
StructuredBuffer<PerPassCloudShadow> perPassCloudShadow : register(t0);
TextureCube<float4> cloudShadows : register(t1);
Texture2D<unorm half> TexDepth : register(t2);

RWTexture2D<unorm float> RWTexShadowMask : register(u0);

SamplerState defaultSampler;

float3 getCloudShadowSampleDir(float3 rel_pos, float3 eye_to_sun)
{
Expand All @@ -38,13 +41,40 @@ float3 getCloudShadowSampleDirFlatEarth(float3 rel_pos, float3 eye_to_sun)
return v;
}

float3 getCloudShadowMult(float3 rel_pos, float3 eye_to_sun, SamplerState samp)
float3 getCloudShadowMult(float3 rel_pos, float3 eye_to_sun)
{
// float3 cloudSampleDir = getCloudShadowSampleDirFlatEarth(rel_pos, eye_to_sun).xyz;
float3 cloudSampleDir = getCloudShadowSampleDir(rel_pos, eye_to_sun).xyz;

float4 cloudCubeSample = cloudShadows.Sample(samp, cloudSampleDir);
float4 cloudCubeSample = cloudShadows.SampleLevel(defaultSampler, cloudSampleDir, 0); // TODO Sample in pixel shader
float alpha = pow(saturate(cloudCubeSample.w), perPassCloudShadow[0].TransparencyPower);

return lerp(1.0, 1.0 - alpha, perPassCloudShadow[0].EffectMix);
}

[numthreads(32, 32, 1)] void main(uint2 dtid
: SV_DispatchThreadID) {
float2 uv = (dtid + .5) * RcpBufferDim;
#ifdef VR
const uint eyeIndex = uv > .5;
#else
const uint eyeIndex = 0;
#endif

float3 ndc = float3(ConvertToStereoUV(uv, eyeIndex), 1);
ndc = ndc * 2 - 1;
ndc.y = -ndc.y;
ndc.z = TexDepth[dtid];

if (ndc.z > 0.9999)
return;

float4 worldPos = mul(InvViewMatrix[eyeIndex], mul(InvProjMatrix[eyeIndex], float4(ndc, 1)));
worldPos.xyz /= worldPos.w;

float3 dirLightDirWS = mul((float3x3)InvViewMatrix[eyeIndex], DirLightDirectionVS[eyeIndex].xyz);
float cloudShadow = getCloudShadowMult(worldPos.xyz, dirLightDirWS);

half shadow = RWTexShadowMask[dtid];
RWTexShadowMask[dtid] = shadow * cloudShadow;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ float3 GetDynamicCubemap(float2 uv, float3 N, float3 VN, float3 V, float roughne

float level = roughness * 9.0;

float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level);
float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level).xyz;
specularIrradiance = sRGB2Lin(specularIrradiance);
diffuseColor = sRGB2Lin(diffuseColor);

Expand All @@ -56,7 +56,7 @@ float3 GetDynamicCubemapFresnel(float2 uv, float3 N, float3 VN, float3 V, float
float2 specularBRDF = EnvBRDFApprox(roughness, NoV);
if (specularBRDF.y > 0.001) {
float3 R = reflect(-V, N);
float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level);
float3 specularIrradiance = specularTexture.SampleLevel(SampColorSampler, R, level).xyz;

// Horizon specular occlusion
// https://marmosetco.tumblr.com/post/81245981087
Expand Down
128 changes: 35 additions & 93 deletions features/Grass Lighting/Shaders/RunGrass.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/GBuffer.hlsli"
#include "Common/LightingData.hlsl"
#include "Common/MotionBlur.hlsl"

Expand Down Expand Up @@ -101,15 +102,12 @@ cbuffer PerFrame : register(
#endif
)
{
row_major float3x4 DirectionalAmbient;
float SunlightScale;
float Glossiness;
float SpecularStrength;
float SubsurfaceScatteringAmount;
bool EnableDirLightFix;
bool OverrideComplexGrassSettings;
float BasicGrassBrightness;
float pad[1];
}

#ifdef VSHADER
Expand Down Expand Up @@ -214,7 +212,7 @@ VS_OUTPUT main(VS_INPUT input)
// Vertex normal needs to be transformed to world-space for lighting calculations.
vsout.VertexNormal.xyz = mul(world3x3, input.Normal.xyz * 2.0 - 1.0);
vsout.SphereNormal.xyz = mul(world3x3, normalize(input.Position.xyz));
vsout.SphereNormal.w = input.Color.w;
vsout.SphereNormal.w = saturate(input.Color.w);

return vsout;
}
Expand All @@ -227,9 +225,12 @@ struct PS_OUTPUT
#if defined(RENDER_DEPTH)
float4 PS : SV_Target0;
#else
float4 Albedo : SV_Target0;
float4 Diffuse : SV_Target0;
float2 MotionVectors : SV_Target1;
float4 Normal : SV_Target2;
float4 NormalGlossiness : SV_Target2;
float4 Albedo : SV_Target3;
float4 Specular : SV_Target4;
float4 Masks : SV_Target6;
#endif // RENDER_DEPTH
};

Expand All @@ -254,16 +255,6 @@ cbuffer AlphaTestRefCB : register(b11)
}
# endif // VR

float GetSoftLightMultiplier(float angle, float strength)
{
float softLightParam = saturate((strength + angle) / (1 + strength));
float arg1 = (softLightParam * softLightParam) * (3 - 2 * softLightParam);
float clampedAngle = saturate(angle);
float arg2 = (clampedAngle * clampedAngle) * (3 - 2 * clampedAngle);
float softLigtMul = saturate(arg1 - arg2);
return softLigtMul;
}

float3 GetLightSpecularInput(float3 L, float3 V, float3 N, float3 lightColor, float shininess)
{
float3 H = normalize(V + L);
Expand Down Expand Up @@ -298,10 +289,6 @@ float3x3 CalculateTBN(float3 N, float3 p, float2 uv)
return float3x3(T * invmax, B * invmax, N);
}

# if defined(SCREEN_SPACE_SHADOWS)
# include "ScreenSpaceShadows/ShadowsPS.hlsli"
# endif

# if defined(LIGHT_LIMIT_FIX)
# include "LightLimitFix/LightLimitFix.hlsli"
# endif
Expand All @@ -313,10 +300,6 @@ float3x3 CalculateTBN(float3 N, float3 p, float2 uv)
# include "DynamicCubemaps/DynamicCubemaps.hlsli"
# endif

# if defined(CLOUD_SHADOWS)
# include "CloudShadows/CloudShadows.hlsli"
# endif

PS_OUTPUT main(PS_INPUT input, bool frontFace
: SV_IsFrontFace)
{
Expand Down Expand Up @@ -348,85 +331,51 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace
psout.PS.w = diffuseAlpha;
# else

float4 specColor = complex ? TexBaseSampler.Sample(SampBaseSampler, float2(input.TexCoord.x, 0.5 + input.TexCoord.y * 0.5)) : 1;
float4 specColor = complex ? TexBaseSampler.Sample(SampBaseSampler, float2(input.TexCoord.x, 0.5 + input.TexCoord.y * 0.5)) : 0;
float4 shadowColor = TexShadowMaskSampler.Load(int3(input.HPosition.xy, 0));

uint eyeIndex = GetEyeIndexPS(input.HPosition, VPOSOffset);
psout.MotionVectors = GetSSMotionVector(input.WorldPosition, input.PreviousWorldPosition, eyeIndex);

float3 ddx = ddx_coarse(input.ViewSpacePosition);
float3 ddy = ddy_coarse(input.ViewSpacePosition);
float3 normal = normalize(cross(ddx, ddy));
float normalScale = max(1.0 / 1000.0, sqrt(normal.z * -8 + 8));
psout.Normal.xy = float2(0.5, 0.5) + normal.xy / normalScale;
psout.Normal.zw = float2(0, 0);

# if !defined(VR)
float3 viewDirection = -normalize(input.WorldPosition.xyz);
# else
float3 viewDirection = -normalize(input.WorldPosition.xyz);
# endif // !VR
float3 worldNormal = normalize(input.VertexNormal.xyz);
float3 normal = normalize(input.VertexNormal.xyz);

// Swaps direction of the backfaces otherwise they seem to get lit from the wrong direction.
if (!frontFace)
worldNormal = -worldNormal;
normal = -normal;

worldNormal = normalize(lerp(worldNormal, normalize(input.SphereNormal.xyz), saturate(input.SphereNormal.w * 2)));
normal = normalize(lerp(normal, normalize(input.SphereNormal.xyz), input.SphereNormal.w));

if (complex) {
float3 normalColor = float4(TransformNormal(specColor.xyz), 1);
float3 normalColor = TransformNormal(specColor.xyz);
// world-space -> tangent-space -> world-space.
// This is because we don't have pre-computed tangents.
worldNormal = normalize(mul(normalColor, CalculateTBN(worldNormal, -input.WorldPosition, input.TexCoord.xy)));
normal = normalize(mul(normalColor, CalculateTBN(normal, -input.WorldPosition.xyz, input.TexCoord.xy)));
}

if (!complex || OverrideComplexGrassSettings)
baseColor.xyz *= BasicGrassBrightness;

float3 dirLightColor = DirLightColor.xyz;
if (EnableDirLightFix) {
dirLightColor *= SunlightScale;
}

# if defined(CLOUD_SHADOWS)
float3 cloudShadowMult = 1.0;
if (perPassCloudShadow[0].EnableCloudShadows && !lightingData[0].Reflections) {
cloudShadowMult = getCloudShadowMult(input.WorldPosition.xyz, DirLightDirection.xyz, SampColorSampler);
dirLightColor *= cloudShadowMult;
}
# endif

float3 dirLightColor = DirLightColor.xyz * SunlightScale;
dirLightColor *= shadowColor.x;

# if defined(SCREEN_SPACE_SHADOWS)
float dirLightSShadow = PrepassScreenSpaceShadows(input.WorldPosition, eyeIndex);
dirLightColor *= dirLightSShadow;
# endif // !SCREEN_SPACE_SHADOWS

float3 diffuseColor = 0;
float3 specularColor = 0;

float3 lightsDiffuseColor = 0;
float3 lightsSpecularColor = 0;

float dirLightAngle = dot(worldNormal, DirLightDirection.xyz);
float3 dirDiffuseColor = dirLightColor * saturate(dirLightAngle);

lightsDiffuseColor += dirDiffuseColor;
float dirLightAngle = dot(normal, DirLightDirection.xyz);

// Generated texture to simulate light transport.
// Numerous attempts were made to use a more interesting algorithm however they were mostly fruitless.
float3 subsurfaceColor = lerp(RGBToLuminance(baseColor.xyz), baseColor.xyz, 2.0);

// Applies lighting across the whole surface apart from what is already lit.
lightsDiffuseColor += subsurfaceColor * dirLightColor * GetSoftLightMultiplier(dirLightAngle, SubsurfaceScatteringAmount);
float3 subsurfaceColor = baseColor.xyz * sqrt(input.SphereNormal.w);

// Applies lighting from the opposite direction. Does not account for normals perpendicular to the light source.
lightsDiffuseColor += subsurfaceColor * dirLightColor * saturate(-dirLightAngle) * SubsurfaceScatteringAmount;

if (complex)
lightsSpecularColor += GetLightSpecularInput(DirLightDirection, viewDirection, worldNormal, dirLightColor, Glossiness);
lightsSpecularColor += GetLightSpecularInput(DirLightDirection, viewDirection, normal, dirLightColor, Glossiness);

# if defined(LIGHT_LIMIT_FIX)
float3 viewPosition = mul(CameraView[eyeIndex], float4(input.WorldPosition.xyz, 1)).xyz;
Expand Down Expand Up @@ -458,7 +407,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace
float3 lightColor = light.color.xyz;
float3 normalizedLightDirection = normalize(lightDirection);

float lightAngle = dot(worldNormal.xyz, normalizedLightDirection.xyz);
float lightAngle = dot(normal, normalizedLightDirection);

float3 normalizedLightDirectionVS = WorldToView(normalizedLightDirection, true, eyeIndex);
if (light.firstPersonShadow)
Expand All @@ -468,53 +417,46 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace

float3 lightDiffuseColor = lightColor * saturate(lightAngle.xxx);

lightDiffuseColor += subsurfaceColor * lightColor * GetSoftLightMultiplier(lightAngle, SubsurfaceScatteringAmount);
lightDiffuseColor += subsurfaceColor * lightColor * saturate(-lightAngle) * SubsurfaceScatteringAmount;

lightsSpecularColor += GetLightSpecularInput(normalizedLightDirection, viewDirection, worldNormal.xyz, lightColor, Glossiness) * intensityMultiplier;

lightsDiffuseColor += lightDiffuseColor * intensityMultiplier;

if (complex)
lightsSpecularColor += GetLightSpecularInput(normalizedLightDirection, viewDirection, normal, lightColor, Glossiness) * intensityMultiplier;
}
}
}
# endif

float3 directionalAmbientColor = mul(DirectionalAmbient, float4(worldNormal.xyz, 1));
# if defined(CLOUD_SHADOWS)
if (perPassCloudShadow[0].EnableCloudShadows && !lightingData[0].Reflections)
directionalAmbientColor *= lerp(1.0, cloudShadowMult, perPassCloudShadow[0].AbsorptionAmbient);
# endif
lightsDiffuseColor += directionalAmbientColor;

diffuseColor += lightsDiffuseColor;

float3 color = max(0, diffuseColor * baseColor.xyz * input.VertexColor.xyz);
float3 albedo = max(0, baseColor.xyz * input.VertexColor.xyz);
diffuseColor *= albedo;

if (complex) {
specularColor += lightsSpecularColor;
specularColor *= specColor.w * SpecularStrength;
color.xyz += specularColor;
}
specularColor += lightsSpecularColor;
specularColor *= specColor.w * SpecularStrength;

# if defined(LIGHT_LIMIT_FIX)
if (perPassLLF[0].EnableLightsVisualisation) {
if (perPassLLF[0].LightsVisualisationMode == 0) {
psout.Albedo.xyz = TurboColormap(0);
diffuseColor.xyz = TurboColormap(0);
} else if (perPassLLF[0].LightsVisualisationMode == 1) {
psout.Albedo.xyz = TurboColormap(0);
diffuseColor.xyz = TurboColormap(0);
} else {
psout.Albedo.xyz = TurboColormap((float)lightCount / 128.0);
diffuseColor.xyz = TurboColormap((float)lightCount / 128.0);
}
} else {
psout.Albedo.xyz = color;
psout.Diffuse = float4(diffuseColor, 1);
}
# else
psout.Albedo.xyz = color;
psout.Diffuse.xyz = float4(diffuseColor, 1);
# endif

psout.Normal.w = specColor.w * SpecularStrength;
psout.Albedo.w = 1;
psout.Specular = float4(specularColor, 1);
psout.Albedo = float4(albedo, 1);
psout.Masks = float4(0, 0, 0, 0);

float3 normalVS = normalize(WorldToView(normal, false, eyeIndex));
psout.NormalGlossiness = float4(EncodeNormal(normalVS), specColor.w, 1);
# endif // RENDER_DEPTH
return psout;
}
Expand Down
2 changes: 2 additions & 0 deletions features/Screen Space GI/Shaders/Features/ScreenSpaceGI.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Info]
Version = 2-9-0
Loading

0 comments on commit ef9acef

Please sign in to comment.