HLSL shader fix

actorid
scrawl 12 years ago
parent c9658031d2
commit 83932ebfe8

@ -14,12 +14,21 @@
SH_START_PROGRAM
{
#if !SH_HLSL
const float3 offset[4] = float3[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)
);
#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);

@ -8,12 +8,21 @@
SH_START_PROGRAM
{
float2 offset[4] = float2[4] (
vec2(-1.0, 0.0),
vec2( 1.0, 0.0),
vec2( 0.0,-1.0),
vec2( 0.0, 1.0)
);
#if !SH_HLSL
float2 offset[4] = float2[4] (
float2(-1.0, 0.0),
float2( 1.0, 0.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 fHeightR = DecodeHeightmap(heightCurrentSampler, UV.xy + offset[1]*rippleTextureSize.xy);

Loading…
Cancel
Save