mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
HLSL shader fix
This commit is contained in:
parent
c9658031d2
commit
83932ebfe8
2 changed files with 24 additions and 6 deletions
|
@ -14,12 +14,21 @@
|
||||||
|
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
|
#if !SH_HLSL
|
||||||
const float3 offset[4] = float3[4](
|
const float3 offset[4] = float3[4](
|
||||||
float3(-1.0, 0.0, 0.25),
|
float3(-1.0, 0.0, 0.25),
|
||||||
float3( 1.0, 0.0, 0.25),
|
float3( 1.0, 0.0, 0.25),
|
||||||
float3( 0.0,-1.0, 0.25),
|
float3( 0.0,-1.0, 0.25),
|
||||||
float3( 0.0, 1.0, 0.25)
|
float3( 0.0, 1.0, 0.25)
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
const float3 offset[4] = {
|
||||||
|
float3(-1.0, 0.0, 0.25),
|
||||||
|
float3( 1.0, 0.0, 0.25),
|
||||||
|
float3( 0.0,-1.0, 0.25),
|
||||||
|
float3( 0.0, 1.0, 0.25)
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
float fHeightPrev = DecodeHeightmap(heightPrevSampler, UV.xy + previousFrameOffset.xy + currentFrameOffset.xy);
|
float fHeightPrev = DecodeHeightmap(heightPrevSampler, UV.xy + previousFrameOffset.xy + currentFrameOffset.xy);
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,21 @@
|
||||||
|
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
float2 offset[4] = float2[4] (
|
#if !SH_HLSL
|
||||||
vec2(-1.0, 0.0),
|
float2 offset[4] = float2[4] (
|
||||||
vec2( 1.0, 0.0),
|
float2(-1.0, 0.0),
|
||||||
vec2( 0.0,-1.0),
|
float2( 1.0, 0.0),
|
||||||
vec2( 0.0, 1.0)
|
float2( 0.0,-1.0),
|
||||||
);
|
float2( 0.0, 1.0)
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
float2 offset[4] = {
|
||||||
|
float2(-1.0, 0.0),
|
||||||
|
float2( 1.0, 0.0),
|
||||||
|
float2( 0.0,-1.0),
|
||||||
|
float2( 0.0, 1.0)
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
float fHeightL = DecodeHeightmap(heightCurrentSampler, UV.xy + offset[0]*rippleTextureSize.xy);
|
float fHeightL = DecodeHeightmap(heightCurrentSampler, UV.xy + offset[0]*rippleTextureSize.xy);
|
||||||
float fHeightR = DecodeHeightmap(heightCurrentSampler, UV.xy + offset[1]*rippleTextureSize.xy);
|
float fHeightR = DecodeHeightmap(heightCurrentSampler, UV.xy + offset[1]*rippleTextureSize.xy);
|
||||||
|
|
Loading…
Reference in a new issue