@nosarious wrote:
I am working with code found on shadertoy to replicate CRT monitor scanlines. There are a number of them, but this is the slimmest one I found:
FixingPixelArtKernel
Another one (a bit more complicated) FixingPixelArtIn these shaders there is a function Fetch which calls another function ToLinear, converting sRGB to Linear.
// sRGB to Linear. // Assuing using sRGB typed textures this should not be needed. float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} vec3 Fetch(vec2 pos,vec2 off){ pos=floor(pos*res+off)/res; if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return vec3(0.0,0.0,0.0); return Test(ToLinear(texture2DRect(tex0,vec2(pos.x,-pos.y),-16.0).rgb)); }
The original code had 'ToLinear(texture2D(' instead of 'ToLinear(texture2DRect'
my problem is that I am consistently getting this error:
No matching function for call to texture2DRect(sampler2DRect, vec2, float)I haven't been able to find a solution online that makes sense.
The image being used in the shader is an FBO created full-screen every frame from a 3d scene, so I can't use sampler2D.
Posts: 1
Participants: 1