diff --git a/files/materials/watersim_heightmap.shader b/files/materials/watersim_heightmap.shader index 50d375efe..ec8ae4174 100644 --- a/files/materials/watersim_heightmap.shader +++ b/files/materials/watersim_heightmap.shader @@ -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); diff --git a/files/materials/watersim_heighttonormal.shader b/files/materials/watersim_heighttonormal.shader index 5402b6bb5..eaa4af498 100644 --- a/files/materials/watersim_heighttonormal.shader +++ b/files/materials/watersim_heighttonormal.shader @@ -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);