Hi all,
I’m porting a project over from an older version of Touch into the latest vulkan release and I’m getting a ‘#extension ’ : extension not supported: GL_EXT_gpu_shader4’ error message.
First hit of google gives me this page: ubuntu - vtk error: extension `GL_EXT_gpu_shader4' unsupported in fragment shader - Stack Overflow but I don’t see how I could apply this to save my patch.
I’m specifically looking to adapt this file: GitHub - yeataro/TD-Anisotropic-Kuwahara: Jan Eric Kyprianidis' Anisotropic Kuwahara filter in TouchDesigner.
Does anyone have any tips or insight?
Thank-you,
Owen
What happens if you just remove that line? What feature from that extension is needed that isn’t supported in the core GLSL 4.60?
Hi Malcom,
Thanks for the quick response. I was just about to delete this thread as I’ve found a solution. It involves replacing “textureSize2D” with “textureSize”, “texture2D” with “texture” and “uniform sampler2D src” with sTD2DInputs.
Now it works.
·
Wingto
September 8, 2022, 6:13am
4
Hi, @owenkirby could you tell me how to use textureSize2D() please?
Hi,
Just replace “textureSize2d” in your text box with “textureSize”.
1 Like
Hi Owen,
I’m also trying to update Anisotrophic Kuwahara - but I’m stuck on “replacing uniform sampler2D src” with sTD2DInputs.”
Can you show how that is done?
// by Jan Eric Kyprianidis <www.kyprianidis.com>
layout (location = 0) out vec4 fragColor;
extension GL_EXT_gpu_shader4 : enable
vec4 src = texture(sTD2DInputs[0], vUV.st) <-- wrong
void main (void) {
vec2 src_size = vec2(textureSize(src, 0));
vec2 uv = gl_FragCoord.xy / src_size;
vec2 d = 1.0 / src_size;
vec3 c = texture(src, uv).xyz;
vec3 u = (
-1.0 * texture(src, uv + vec2(-d.x, -d.y)).xyz +
-2.0 * texture(src, uv + vec2(-d.x, 0.0)).xyz +
-1.0 * texture(src, uv + vec2(-d.x, d.y)).xyz +
+1.0 * texture(src, uv + vec2( d.x, -d.y)).xyz +
+2.0 * texture(src, uv + vec2( d.x, 0.0)).xyz +
+1.0 * texture(src, uv + vec2( d.x, d.y)).xyz
) / 4.0;
vec3 v = (
-1.0 * texture(src, uv + vec2(-d.x, -d.y)).xyz +
-2.0 * texture(src, uv + vec2( 0.0, -d.y)).xyz +
-1.0 * texture(src, uv + vec2( d.x, -d.y)).xyz +
+1.0 * texture(src, uv + vec2(-d.x, d.y)).xyz +
+2.0 * texture(src, uv + vec2( 0.0, d.y)).xyz +
+1.0 * texture(src, uv + vec2( d.x, d.y)).xyz
) / 4.0;
fragColor = vec4(dot(u, u), dot(v, v), dot(u, v), 1.0);
}
You can’t sample your texture outside of the main() function. This line:
vec3 c = texture(src, uv).xyz;
should be
vec3 c = texture(sTD2DInputs[0], uv).xyz;
1 Like