Texure in vertex shader

Hello, it’s me again but this time I have a correct working playground example from the start.
So basically I wanted to have an array uniform but since its size should be fixed I did a texture (runtime size then).

The problem is that when I do that it only picks the first value and the last value for all the other indexes:
https://playground.babylonjs.com/#6S1XQS

If anyone has a clue of where I fucked up.

your index is an unnormalized float so either you get back the value in the shader: https://playground.babylonjs.com/#6S1XQS#1

or you normalize upfront:
https://playground.babylonjs.com/#6S1XQS#2

nice thanks!
Tried once to normalize the value itself but forgot about the texture coordinates.

1 Like