How to get section/submesh position in shader.

Hi,

I have a skeleton mesh, and we’re trying to make a shader on the “eye” section(or called sub-mesh?), which need to get the eye’s world position to achieve a specific effect.

But the ActorPositionWS returns the skeleton mesh’s position,
The ObjectPositionWS returns the whole skeleton’s primitives’ bounds center(including body, head, etc) instead of the eye.

I know there’s a walkround by using blueprint to get the eye’s bone position and set the param on shader instance every frame.

But is there a way to get the eye’s position directly by using shader itself? (It’s the currently rendering section’s primitives’ bounds center position, not the whole mesh. )

Got reply in the forum: