#ivec3 array in shader shows as PackedInt32Array in editor.

1 messages · Page 1 of 1 (latest)

neat geyser
#

I'm trying to address a 16x16 grid with my shader, and I wanted to do so using ivec3's since then I can call a tile by its coordinates (1,1 through 16,16). However, when I try to make an ivec3 array it doesn't show properly in the editor for me to edit it. A single ivec3 does, but not an array. Is there something I'm doing wrong that's causing it to show in the editor incorrectly?

The reason I want them to be integer vectors is so I can use the z portion of the ivec3 to indicate what type of highlight should be drawn. The comparison code is if(highlighted_tiles[i].z == 0.0) (and so on), which would work fine if I was able to use an ivec3. I know I can implement an Epsilon to do the equivalent of is_equal_approx() inside the shader, but I don't care about the floating point information and would rather just have ivec3.

crystal nebula
#

I think it won't display an ivec3 array properly since there's no Packed*Array equivalent (e.g. no PackedVector3iArray, only PackedVector3Array)

#

Looks like you can't even apply uniform hints to arrays

neat geyser
#

Sorry for the late response, but if there's no way to get around it then I guess I'll just stick with using a normal vec3 array and account for floating point errors in my code. Hopefully eventually we'll be able to see ivec3 arrays in the editor.

crystal nebula