qcrocknet Posted March 26, 2021 Share Posted March 26, 2021 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: 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! Quote Link to comment Share on other sites More sharing options...
Josh Posted March 28, 2021 Share Posted March 28, 2021 What happens if you create a new project from the VR game template? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
qcrocknet Posted March 29, 2021 Author Share Posted March 29, 2021 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 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 29, 2021 Share Posted March 29, 2021 I am thinking maybe there is an extra camera in the scene that is behaving in an unpredictable way? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
qcrocknet Posted March 29, 2021 Author Share Posted March 29, 2021 Humm... that's a good point. It does seems like there is 2 cameras now that you mention it. Althought I do not see any extra camera in my scene. I will double check. Thank you @Josh Quote Link to comment Share on other sites More sharing options...
qcrocknet Posted March 29, 2021 Author Share Posted March 29, 2021 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 Quote Link to comment Share on other sites More sharing options...
qcrocknet Posted March 30, 2021 Author Share Posted March 30, 2021 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.