From 1a785420ec47c78ac3f95bd0ece08c819653f6e8 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 19 Nov 2024 23:13:23 +0100 Subject: next commit --- new_shader.gdshader | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'new_shader.gdshader') diff --git a/new_shader.gdshader b/new_shader.gdshader index 32b1f7c..e9d2a08 100644 --- a/new_shader.gdshader +++ b/new_shader.gdshader @@ -1,17 +1,18 @@ shader_type spatial; uniform sampler2DArray textures : filter_nearest, source_color; +uniform int elements_per_row; void vertex() { // Called for every vertex the material is visible on. - //vec4 element = texture(textures, vec3(UV, UV2.x)); - //COLOR = element.rgba; } void fragment() { // Called for every pixel the material is visible on. - vec4 element = texture(textures, vec3(UV, UV2.x)); + int index = int(UV2.y) * elements_per_row + int(UV2.x); + vec4 element = texture(textures, vec3(UV, float(index))); ALBEDO = element.rgb; + //ALPHA = element.a; } //void light() { -- cgit v1.2.3