[Fix] texture to texture2D

This commit is contained in:
2024-05-23 21:57:55 +03:00
parent e434b96ec2
commit 482635845b

View File

@ -112,12 +112,12 @@ void CoolSphere( out vec4 fragColor, in vec2 fragCoord )
// raymarch
vec3 col = raymarch(ro,rd,tmm);
if (tmm.x<0.)col = texture(texture_sampler, rd).rgb;
if (tmm.x<0.)col = texture2D(texture_sampler, rd).rgb;
else {
vec3 nor=(ro+tmm.x*rd)/2.;
nor = reflect(rd, nor);
float fre = pow(.5+ clamp(dot(nor,rd),0.0,1.0), 3. )*1.3;
col += texture(texture_sampler, nor).rgb * fre;
col += texture2D(texture_sampler, nor).rgb * fre;
}
@ -306,7 +306,7 @@ void main(void)
vec2 texttop = vec2(0., -.35), pt = (gl_FragCoord.xy / resolution) - texttop;
if (pt.y > 0.)
l = gl_FragColor + texture(texts, pt);
l = gl_FragColor + texture2D(texts, pt);
gl_FragColor = vec4(l * (1.0), 1.0);