Quick answer: Unity Shader Graph Sample Texture 2D Array node always sampling slice 0? The Index input may be a float but Texture2DArray indexing needs an integer slice — floor it or pass as uint.

A terrain shader uses a Texture2DArray for variation, but every cell shows the slice-0 texture. The slice index was lerped between cells.

Floor the Index

Use a Floor node before the index input. Sample Texture 2D Array expects discrete slices; a fractional value either snaps to slice 0 or interpolates unpredictably.

Branch for Smooth Variation

For smooth interpolation between slices, sample twice (floor, floor+1) and lerp the results. Costs an extra sample but blends seamlessly.

Index Range

Out-of-range indices clamp to slice 0 silently on some platforms. Validate the index is 0 <= i < sliceCount.

Verifying

Different cells pick different slices visibly. Slice transitions either snap (floor) or blend (lerp) cleanly.

“Texture2DArray indices are discrete. Floor for snap, sample twice and lerp for smooth.”

Bake the slice index into a vertex stream or material property to avoid recomputing per-pixel — same look, less work.