Colors in VR different than outside VR

When I tried coloring a gazeTrackerMesh, I noticed that the colors in VR are different than outside VR.

Here’s a playground with an example: https://www.babylonjs-playground.com/#4Y0DT7#1

The gazeTrackerMesh and the sphere in the scene both have full red as their color, but once you enter VR, that looks more light pink. This color stays even after leaving VR again:

Is there any way to get the same colors inside and outside of VR?

Pinging @trevordev

@jhadenfeldt Can you elaborate on how you would like to use this in an app? When a gaze mesh is set, it is duplicated multiple times (eg. each controller has its own gaze mesh). While using the gaze, depending on when it hits something of interest the gaze’s color is changed, otherwise it has a dull emissive color set (Im pretty sure this is what is occuring here). You can change the gaze color via vrHelper.changeGazeColor to set the emissive base color.

Are you looking for a setting that disables the color change of any gaze mesh? Or would you suggest another solution.

That’s what I’m looking for. I’m doing some shader stuff that requires the gaze mesh to be always a certain color, so no color change, no specular highlights.

@jhadenfeldt Ok, I can look into adding this. Just note that after you set a custom gaze tracker on the helper, updating it manually will not be supported as the cloned gaze trackers for the hands would not be updated as they are clones of what was originally passed in. Is that fine?

That sounds good!
One thing I’ve found a good solution is how A-Frame allows for cursor animations to show interaction (Cursor with Visual Feedback). I assume that’s not possible?

Ok, I can try to add the dont modify gaze flag. If you want to add cursor animations yourself you can do this manually eg. https://www.babylonjs-playground.com/#Q1VRX3#12 . I am hesitant to keep adding features to the experience helper as it is already getting pretty large causing bugs with certain combinations of flags. I am trying to address this when we move to webXR (Babylon.js Documentation ) Once the spec is approved and it makes its way into stable browsers.

Created PR here: vrHelperDisableColor by TrevorDev · Pull Request #5663 · BabylonJS/Babylon.js · GitHub

2 Likes

Works great, thank you!

1 Like