I want the effect of the model to be similar to the HoverEffect effect, but not by staring with the eyes. Instead, by clicking a button elsewhere, the corresponding model will appear highlighted,How can it be achieved
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
I want the effect of the model to be similar to the HoverEffect effect
Hi @LazyCoder
I would recommend using Reality Composer Pro's Shader Graph to create such an effect.
For example, you can use the Additive Mix node to add a highlight color on top of your model's base color by connecting your base color to the node's Background
input, your desired highlight color to the node's Foreground
input, and then setting the Mix
value to your desired intensity for the highlight effect (in the range 0 to 1).
You can also programmatically pass parameters to your shader with setParameter(name:value:), allowing you to update the value you connect to the Mix
input dynamically based on a button press. To do this, add a new Uniform Input of type Float
to your material in Reality Composer Pro, and connect it to the Mix
input of the Additive Mix node. Then, when a button is pressed, call the setParameter(name:value:) method on your material with the name of the Uniform Input variable you created to dynamically set the highlight intensity. See Build materials in Shader Graph for more information.
Let me know if you have any further questions!