Wow I think I'm stepping into some serious dark magic with this, but:
I'm struggling to give this shape, essentially an extended pill, a gradient material. The issue is pretty visually apparent, the spheres that round off the pill shape aren't being included in the material.
This is my geometry node set up. As a note, this is all being applied to a cube, whose geometry is just being discarded. The spheres are created as instances at the endpoints of a curve. So far, I've gotten color to work with only the linear portion.
What baffles me is that any of the material works at all. From the geometry nodes set up, the color data is associated with a curve, not a mesh. Yet, the shader (below) takes that data and applies it, successfully, to part of the mesh. How Blender is deriving a mesh's color from data associated with a spline is beyond me. But, the material color for the spheres isn't being similarly derived, and that's my issue.
So, can anyone elucidate this at all? Maybe I have to approach it from a totally different angle. From what I've looked up already, this feels like arcane stuff. Any help would be appreciated!