mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
tweak shaders
This commit is contained in:
parent
f422ac1ee9
commit
b600cb36ba
@ -434,6 +434,8 @@ uniform sampler2D SurfaceTex;
|
|||||||
|
|
||||||
float4 TextureSize : register(c0);
|
float4 TextureSize : register(c0);
|
||||||
|
|
||||||
|
#define SourceSize float4(TextureSize.xy, 1.0 / TextureSize.xy)
|
||||||
|
|
||||||
float4 catmull_rom(float2 coord)
|
float4 catmull_rom(float2 coord)
|
||||||
{
|
{
|
||||||
// The following code is licensed under the MIT license: https://gist.github.com/TheRealMJP/bc503b0b87b643d3505d41eab8b332ae
|
// The following code is licensed under the MIT license: https://gist.github.com/TheRealMJP/bc503b0b87b643d3505d41eab8b332ae
|
||||||
@ -443,7 +445,7 @@ float4 catmull_rom(float2 coord)
|
|||||||
|
|
||||||
// Modified to use 5 texture fetches
|
// Modified to use 5 texture fetches
|
||||||
|
|
||||||
float2 samplePos = coord * TextureSize.xy;
|
float2 samplePos = coord * SourceSize.xy;
|
||||||
float2 texPos1 = floor(samplePos - 0.5f) + 0.5f;
|
float2 texPos1 = floor(samplePos - 0.5f) + 0.5f;
|
||||||
|
|
||||||
float2 f = samplePos - texPos1;
|
float2 f = samplePos - texPos1;
|
||||||
@ -460,9 +462,9 @@ float4 catmull_rom(float2 coord)
|
|||||||
float2 texPos3 = texPos1 + 2;
|
float2 texPos3 = texPos1 + 2;
|
||||||
float2 texPos12 = texPos1 + offset12;
|
float2 texPos12 = texPos1 + offset12;
|
||||||
|
|
||||||
texPos0 /= TextureSize.xy;
|
texPos0 *= SourceSize.zw;
|
||||||
texPos3 /= TextureSize.xy;
|
texPos3 *= SourceSize.zw;
|
||||||
texPos12 /= TextureSize.xy;
|
texPos12 *= SourceSize.zw;
|
||||||
|
|
||||||
float wtm = w12.x * w0.y;
|
float wtm = w12.x * w0.y;
|
||||||
float wml = w0.x * w12.y;
|
float wml = w0.x * w12.y;
|
||||||
|
@ -171,9 +171,9 @@ const char CATMULL_ROM_FRAG_SHADER[] =
|
|||||||
" vec2 texPos3 = texPos1 + 2.;\n"
|
" vec2 texPos3 = texPos1 + 2.;\n"
|
||||||
" vec2 texPos12 = texPos1 + offset12;\n"
|
" vec2 texPos12 = texPos1 + offset12;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" texPos0 /= SourceSize.xy;\n"
|
" texPos0 *= SourceSize.zw;\n"
|
||||||
" texPos3 /= SourceSize.xy;\n"
|
" texPos3 *= SourceSize.zw;\n"
|
||||||
" texPos12 /= SourceSize.xy;\n"
|
" texPos12 *= SourceSize.zw;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" float wtm = w12.x * w0.y;\n"
|
" float wtm = w12.x * w0.y;\n"
|
||||||
" float wml = w0.x * w12.y;\n"
|
" float wml = w0.x * w12.y;\n"
|
||||||
@ -229,9 +229,9 @@ const char CATMULL_ROM_FRAG_SHADER_CORE[] =
|
|||||||
" vec2 texPos3 = texPos1 + 2.;\n"
|
" vec2 texPos3 = texPos1 + 2.;\n"
|
||||||
" vec2 texPos12 = texPos1 + offset12;\n"
|
" vec2 texPos12 = texPos1 + offset12;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" texPos0 /= SourceSize.xy;\n"
|
" texPos0 *= SourceSize.zw;\n"
|
||||||
" texPos3 /= SourceSize.xy;\n"
|
" texPos3 *= SourceSize.zw;\n"
|
||||||
" texPos12 /= SourceSize.xy;\n"
|
" texPos12 *= SourceSize.zw;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" float wtm = w12.x * w0.y;\n"
|
" float wtm = w12.x * w0.y;\n"
|
||||||
" float wml = w0.x * w12.y;\n"
|
" float wml = w0.x * w12.y;\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user