fix deprecated texture loading function name in glsl

This commit is contained in:
glitch 2023-06-30 18:32:59 -06:00
parent 9def9b04c9
commit 57adf66c58
2 changed files with 5 additions and 3 deletions

View file

@ -11,8 +11,6 @@ uniform vec4 colDiffuse;
// Output fragment color
out vec4 finalColor;
// NOTE: Add here your custom variables
// NOTE: Render size values should be passed from code
const float renderWidth = 800;
const float renderHeight = 450;
@ -20,6 +18,7 @@ const float renderHeight = 450;
float radius = 250.0;
float angle = 0.8;
// NOTE: center is connected to the golang code
uniform vec2 center = vec2(200.0, 200.0);
void main()
@ -41,7 +40,7 @@ void main()
}
tc += center;
vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;;
vec4 color = texture(texture0, tc/texSize)*colDiffuse*fragColor;;
finalColor = vec4(color.rgb, 1.0);;
}

View file

@ -31,6 +31,9 @@ func main() {
// Get variable (uniform) location on the shader to connect with the program
// NOTE: If uniform variable could not be found in the shader, function returns -1
swirlCenterLoc := rl.GetShaderLocation(shader, "center")
if swirlCenterLoc == -1 {
println("Warning: [SHDR] Swirl Center uniform not found on shader")
}
swirlCenter := make([]float32, 2)
swirlCenter[0] = float32(screenWidth) / 2