Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG updated 42 files
+24 −0 CHANGELOG.md
+1 −1 CMakeLists.txt
+1 −0 cmake/sourcelist.cmake
+27 −7 include/RE/B/BSGamepadDevice.h
+8 −1 include/RE/B/BSIInputDevice.h
+22 −8 include/RE/B/BSInputDevice.h
+1 −1 include/RE/B/BSKeyboardDevice.h
+13 −3 include/RE/B/BSMouseDevice.h
+1 −3 include/RE/B/BSOpenVRControllerDevice.h
+14 −2 include/RE/B/BSPCGamepadDeviceDelegate.h
+1 −5 include/RE/B/BSPCGamepadDeviceHandler.h
+29 −17 include/RE/B/BSPCOrbisGamepadDevice.h
+18 −20 include/RE/B/BSShadowLight.h
+16 −4 include/RE/B/BSTrackedControllerDevice.h
+1 −1 include/RE/B/BSVirtualKeyboardDevice.h
+29 −17 include/RE/B/BSWin32GamepadDevice.h
+22 −8 include/RE/B/BSWin32KeyboardDevice.h
+18 −6 include/RE/B/BSWin32MouseDevice.h
+1 −1 include/RE/B/BSWin32VirtualKeyboardDevice.h
+13 −3 include/RE/B/ButtonEvent.h
+1 −1 include/RE/E/Explosion.h
+1 −2 include/RE/H/Hazard.h
+9 −9 include/RE/N/NiCamera.h
+13 −0 include/RE/R/Renderer.h
+4 −4 include/RE/R/RendererShadowState.h
+54 −53 include/RE/S/ShadowSceneNode.h
+1 −1 include/RE/T/TESObjectCELL.h
+79 −5 include/REL/Common.h
+180 −0 include/SKSE/ContextHook.h
+9 −9 include/SKSE/Interfaces.h
+1 −0 include/SKSE/SKSE.h
+7 −6 src/RE/B/BSGamepadDevice.cpp
+9 −7 src/RE/B/BSInputDevice.cpp
+1 −1 src/RE/B/BSInputDeviceManager.cpp
+1 −1 src/RE/B/BSKeyboardDevice.cpp
+2 −2 src/RE/B/BSMouseDevice.cpp
+4 −3 src/RE/B/BSPCGamepadDeviceDelegate.cpp
+16 −15 src/RE/B/BSPCOrbisGamepadDevice.cpp
+18 −16 src/RE/B/BSWin32GamepadDevice.cpp
+11 −8 src/RE/B/BSWin32KeyboardDevice.cpp
+9 −7 src/RE/B/BSWin32MouseDevice.cpp
+1 −1 vcpkg.json
Comment thread
vrnord marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ namespace ExtendedMaterials
float2 GetParallaxCoords(float distance, float2 coords, float mipLevel, float3 viewDir, float3x3 tbn, float noise, Texture2D<float4> tex, SamplerState texSampler, uint channel, DisplacementParams params, out float pixelOffset)
#endif
{
pixelOffset = 0.5;
Comment thread
vrnord marked this conversation as resolved.
float3 viewDirTS = normalize(mul(tbn, viewDir));
#if defined(LANDSCAPE)
viewDirTS.xy /= viewDirTS.z * 0.7 + 0.3 + params[0].FlattenAmount; // Fix for objects at extreme viewing angles
Expand Down Expand Up @@ -496,7 +497,7 @@ namespace ExtendedMaterials
#endif
nearBlendToFar *= nearBlendToFar;
float offset = (1.0 - parallaxAmount) * -maxHeight + minHeight;
pixelOffset = lerp(parallaxAmount * scale, 0, nearBlendToFar);
pixelOffset = saturate(lerp(parallaxAmount, 0.5, nearBlendToFar));
return lerp(viewDirTS.xy * offset + coords.xy, coords, nearBlendToFar);
}

Expand All @@ -509,7 +510,7 @@ namespace ExtendedMaterials
weights[5] = input.LandBlendWeights2.y;
#endif

pixelOffset = 0;
pixelOffset = 0.5;
return coords;
}

Expand Down
3 changes: 3 additions & 0 deletions package/Shaders/Common/Math.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

#define EPSILON_SSS_ALBEDO 1e-3f // For albedo clamping in SSS calculations
#define EPSILON_DOT_CLAMP 1e-5f // For dot product clamping
#define EPSILON_DEPTH_SKY 1e-5f // Depth threshold for sky/unrendered pixel detection (raw reversed-Z near zero)
#define EPSILON_DIVISION 1e-6f // For division to avoid division by zero
#define EPSILON_GLINTS 1e-8f // For glints calculations
#define EPSILON_WEIGHT_SUM 1e-10f // For weight normalization

#define DEPTH_SKY_SENTINEL 999999.0f // Linearized depth sentinel for sky/unmapped pixels (beyond any real geometry)

namespace Math
{
static const float4x4 IdentityMatrix = {
Expand Down
4 changes: 2 additions & 2 deletions package/Shaders/Common/SharedData.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace SharedData
bool InInterior; // If the area lacks a directional shadow light e.g. the sun or moon
bool InMapMenu; // If the world/local map is open (note that the renderer is still deferred here)
bool HideSky; // HideSky flag in WorldSpace, e.g. Blackreach
float MipBias; // Offset to mip level for TAA sharpness#
float MipBias; // Offset to mip level for TAA sharpness
float pad0;
float4 AmbientSHR;
float4 AmbientSHG;
Expand Down Expand Up @@ -52,7 +52,7 @@ namespace SharedData
bool EnableShadows;
bool ExtendShadows;
bool EnableParallaxWarpingFix;
float1 pad0;
bool pad0;
Comment thread
vrnord marked this conversation as resolved.
};

struct CubemapCreatorSettings
Expand Down
15 changes: 15 additions & 0 deletions package/Shaders/DeferredCompositeCS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ RWTexture2D<float4> NormalTAAMaskSpecularMaskRW : register(u1);
RWTexture2D<float2> MotionVectorsRW : register(u2);
Texture2D<float> DepthTexture : register(t4);

#if defined(VR_STEREO_OPT)
# include "VRStereoOptimizations/modes.hlsli"
Texture2D<uint> StereoOptModeTexture : register(t16);
#endif

#if defined(DYNAMIC_CUBEMAPS)
Texture2D<float3> ReflectanceTexture : register(t5);
TextureCube<float3> EnvTexture : register(t6);
Expand Down Expand Up @@ -92,6 +97,16 @@ void SampleSSGISpecular(uint2 pixCoord, sh2 lobe, inout float ao, out float3 il,
uv *= FrameBuffer::DynamicResolutionParams2.xy; // adjust for dynamic res

uint eyeIndex = Stereo::GetEyeIndexFromTexCoord(uv);

#if defined(VR_STEREO_OPT)
if (eyeIndex == 1) {
uint mode = StereoOptModeTexture[uint2(dispatchID.xy)] & 0x0F;
if (mode == MODE_MAIN) { // stencil-culled in Eye 1, filled by ReprojectionCS
return;
}
}
#endif
Comment thread
vrnord marked this conversation as resolved.

uv = Stereo::ConvertFromStereoUV(uv, eyeIndex);

float3 normalGlossiness = NormalRoughnessTexture[dispatchID.xy];
Expand Down
10 changes: 9 additions & 1 deletion package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3166,7 +3166,15 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
}
# endif

psout.Reflectance = float4(indirectLobeWeights.specular, psout.Diffuse.w);
# if defined(VR) && (defined(EMAT) || defined(TRUE_PBR)) && (defined(PARALLAX) || defined(LANDSCAPE) || defined(EMAT_ENVMAP) || defined(TRUE_PBR))
// VR: store POM parallax amount for stereo reprojection depth correction.
// Read by StereoBlendCS to adjust Eye 1 (right eye) reprojection depth
// at POM-displaced surfaces. Not consumed on flat (SE/AE).
psout.Reflectance = float4(indirectLobeWeights.specular,
(pixelOffset > 0.0) ? saturate(pixelOffset) : 0.0);
# else
psout.Reflectance = float4(indirectLobeWeights.specular, 0.0);
# endif
psout.NormalGlossiness = float4(GBuffer::EncodeNormal(screenSpaceNormal), saturate(1.0 - material.Roughness), psout.Diffuse.w);

# if defined(SNOW)
Expand Down
1 change: 0 additions & 1 deletion package/Shaders/RunGrass.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,6 @@ PS_OUTPUT main(PS_INPUT input)

# if defined(RENDER_DEPTH)
float diffuseAlpha = input.VertexColor.w * baseColor.w;

Comment thread
alandtse marked this conversation as resolved.
if ((diffuseAlpha - AlphaTestRefRS) < 0) {
discard;
}
Expand Down
Loading
Loading