Skip to content

Commit

Permalink
fixes 'variable indexing sampler array' : not supported for this vers…
Browse files Browse the repository at this point in the history
…ion or the enabled extensions
  • Loading branch information
arozx committed Feb 25, 2025
1 parent 7b3afb7 commit 12e56c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/shaders/batch_renderer_2d.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ out vec4 FragColor;

void main() {
vec4 texColor = v_Color;
texColor *= texture(u_Textures[int(v_TexIndex)], v_TexCoord * v_TilingFactor);
switch(int(v_TexIndex)) {
case 0: texColor *= texture(u_Textures[0], v_TexCoord * v_TilingFactor); break;
case 1: texColor *= texture(u_Textures[1], v_TexCoord * v_TilingFactor); break;
case 2: texColor *= texture(u_Textures[2], v_TexCoord * v_TilingFactor); break;
case 3: texColor *= texture(u_Textures[3], v_TexCoord * v_TilingFactor); break;
}
FragColor = texColor;
}

0 comments on commit 12e56c3

Please sign in to comment.