Jump to content

Issues when running project in VR - Sync?


qcrocknet
 Share

Recommended Posts

Hello,

I am having a weird issue with VR in Leadwerks 4.6.

I started a new project using the FPS template, to set up a scene to be able to pre-test it in FPS before in VR.

So when I was ready to test it in VR, I changed the fps lua script for the player to the vr lua script.
And also switch the main.lua from FPS to the main.lua found in the VR template.

Then when I ran it in VR (works OK in FPS mode) the synching is all weird in my headset, and also in the debug window. 

Video example here:

https://youtu.be/8skcB_wn3yU

Debug window shot here:

leadwerksdebugwindow.thumb.png.6579e4ec94d73b0ddd9b32355b2fb620.png
So am I missing something? BTW if I test the VR template with the same setup, everything is fine.

My setup:
- VR headset - Oculus Quest 2 via Virtual desktop
- NVidia GTX 1060 3 Megs
- PC i7 Intel + 16 Gigs ram

I attached the 2 lua scripts also.Main.luamdb_VRPlayer.lua

Thanks in advance!

 

Link to comment
Share on other sites

Like I mentioned, if I use the default  VR Template (without any of my own models, ect..), the display is fine.

In my project I did the following without any success:

- I disabled Sync

- I made sure I did not have any post processing.

- I hide all my candle light flames (which uses the spritesheet shader)

- I am not using any other shaders also.

So, what I will end up doing is recreate my project from scratch with the VR template instead. Not what I really wanted to do. Hopefully it will work better this time.

Thank you

Link to comment
Share on other sites

Ok, found the issue. Well by hiding my candle fire prefabs (based on the firepit lua scripts), it seems that the scripts were still being executed (my bad). So after removing the firepitcontrol.lua and faceme.lua from my candle lights (4 total running) prefabs I had in my scene, everything is fine in VR. Good!

But I will need to see why one of those scripts seems to duplicates/de-sync the camera in VR. 

My guess it's something in the faceme.lua script that causes the issue in VR (and not in FPS):

function Script:Start()
    --self.entity:SetParent(nil)
end


function Script:UpdateWorld()
    self.world=World:GetCurrent()
    if self.camera==nil then
        for i=0,self.world:CountEntities()-1 do
                if self.world:GetEntity(i):GetClass()==Object.CameraClass then
                self.camera=self.world:GetEntity(i)
                                tolua.cast(self.camera,"Camera")
                                System:Print(self.world:GetEntity(i):GetClassName())
                                break
                        end
                end
    end
    if self.camera then
        self.entity:Point(self.camera,1,1);
    end
end

I did not create that script, so if you have any ideas? I will try myself also to find the problem.

Thank you

Link to comment
Share on other sites

Ok, so I did some more digging. It does not seem like the faceme.lua is the problem. But within the firepit.lua in conjuction with the spritesheet.shader that is used with the fire material that is included. If I use only the firepit.lua I get the double camera problem. So I guess that this shader cannot run well under VR only.

I know nothing about shaders honestly. So if someone has an idea on how to fix this (or unless it's an issue with Leadwerks + VR), it would be greatly appreciated.?

Thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...