Jump to content

Gas Mask effect on VR


photo

Recommended Posts

Hi,

I'm working on a VR project where at some point we want to display a gas mask attached to the player's face. I first tried creating a scriptable material where I render a gas mask texture on the scene, but that looked weird. It didn't create a stereographic effect. Then, I tried placing a gas mask mesh in front of the player. There is a body mesh and the gas mask is attached to the body mesh. On update, I move the body mesh, therefore, the gas mask should move. But, even if I update the body mesh every frame, there is a delay in the gas mask, it looks like it does not look like it's attached to the player's face. How can I overcome this problem?

Note: Forgot to mention, we are using the ComponentSystem. I update the transform on every COMPONENT_UPDATE(myUpdate).

Thanks!

Edited by tolga
Link to comment
  • tolga changed the title to Gas Mask effect on VR

Hello! 

maybe something with the update order, for example, the head is updated after the gas mask.

try changing the code to

COMPONENT_UPDATE(myUpdate, 255)
or 
COMPONENT_POST_UPDATE(myUpdate)

if this does not help, please attach a video with a problem (if possible) or a piece of implementation GasMask components (or at least myUpdate method)

Link to comment

Hi tolga,

so you are my successor in this project?! :) Did you had a look in the ObjMovable component file? There are some code for head attachment, like head_pos and head_rot. This should be the way you go. You can also have a look in UNIGINEs Superposition demo project. They have an example component for an attachable hat, that can be picked up by the user and placed on top of it.

Cheers

Christian

Link to comment
5 hours ago, christian.wolf2 said:

Hi tolga,

so you are my successor in this project?! :) Did you had a look in the ObjMovable component file? There are some code for head attachment, like head_pos and head_rot. This should be the way you go. You can also have a look in UNIGINEs Superposition demo project. They have an example component for an attachable hat, that can be picked up by the user and placed on top of it.

Cheers

Christian

Thanks for the tips man! It's fun working on your code anyway. I didn't have to do major changes :)

Link to comment

Hi Christian,

I tried the Superposition with max settings and when you wear the hat, the exact same problem occurs :) It's fine in optimal or minimum settings, because the FPS is very good (90 FPS). I wonder if there is support for VR in scriptable materials, maybe like the ability to render half of a texture to left and the other half to right?

Thanks.

Link to comment
×
×
  • Create New...