Gaze, Eye Tracking responsive Stuff

I am wondering, is it possible to somehow configure a 3D object to respond to the gaze of a person, like change colors of some parts of the 3D-Model where a person is looking, i.e. where a person's gaze lands on the surface of the 3D-model ?

For example, if there is a 3D model of a Cool Dragon 🐉 in the physical space of a person, when seen through with the mixed reality view, of a VisionPro. Now, it would be really cool to change only the color, or make some specific parts of the dragon skin shimmer, but only in the areas where a person is looking. Is this possible ? Is it do-able with eye-tracking of VisionPro ?

Any advice would be appreciated. 🤝 🤓 I am new to iOS and VisionOS development.

Answered by Vision Pro Engineer in 828414022

Hi @s750kd

The effect you're describing can be created with Reality Composer Pro's ShaderGraph.

Specifically, you can leverage the Hover State node to obtain the person's gaze position. To change the color of the material near the gaze position, you can then take the Distance between the hover state gaze position and a Position node. Next, you can use a Remap node to remap that distance to the range 0 to 1, and then connect that value to a Mix node to mix between two colors. Note that the Hover State node outputs a position in world space, so you'll need to set the Position node to be in world space as well.

Let me know if you have any questions, and consider checking out Explore materials in Reality Composer Pro in the meantime for an introduction to working with materials in RCP!

Accepted Answer

Hi @s750kd

The effect you're describing can be created with Reality Composer Pro's ShaderGraph.

Specifically, you can leverage the Hover State node to obtain the person's gaze position. To change the color of the material near the gaze position, you can then take the Distance between the hover state gaze position and a Position node. Next, you can use a Remap node to remap that distance to the range 0 to 1, and then connect that value to a Mix node to mix between two colors. Note that the Hover State node outputs a position in world space, so you'll need to set the Position node to be in world space as well.

Let me know if you have any questions, and consider checking out Explore materials in Reality Composer Pro in the meantime for an introduction to working with materials in RCP!

Gaze, Eye Tracking responsive Stuff
 
 
Q