OpenGL Fragment shader error

0

Witam,
Piszę grę w Javie opartą na bibliotekach LWJGL. Znalazłem kod na shader winiety. W kodzie C++ (bodajże) shader'a kompilator wykrywa mi błąd na lini 7 i 12 - unexpected token ".", jako że nie znam się na tym języku/bibliotece to prosiłbym o pomoc:

varying vec4 v_color;
varying vec2 v_texCoord0;

uniform vec2 u_resolution;
uniform sampler2D u_sampler2D;

const float outerRadius = .65, innerRadius = .4, intensity = .6;

void main() {
	vec4 color = texture2D(u_sampler2D, v_texCoord0) * v_color;

	vec2 relativePosition = gl_FragCoord.xy / u_resolution - .5;
	// relativePosition.x *= u_resolution.x / u_resolution.y;
	float len = length(relativePosition);
	float vignette = smoothstep(outerRadius, innerRadius, len);
	color.rgb = mix(color.rgb, color.rgb * vignette, intensity);

	gl_FragColor = color;
}
0

Zamień:

const float outerRadius = .65, innerRadius = .4, intensity = .6;

=>

const float outerRadius = 0.65, innerRadius = 0.4, intensity = 0.6;
0

I jeszcze:

vec2 relativePosition = gl_FragCoord.xy / u_resolution - .5;

na

vec2 relativePosition = gl_FragCoord.xy / u_resolution - 0.5;

1 użytkowników online, w tym zalogowanych: 0, gości: 1