Skip to content

Commit

Permalink
Merge pull request #3 from disketflu/master
Browse files Browse the repository at this point in the history
Update scene_vr lua with passId parameter
  • Loading branch information
astrofra authored Mar 22, 2022
2 parents f7e0383 + 2062284 commit e2d167e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scene_vr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,18 @@ while not hg.ReadKeyboard():Key(hg.K_Escape) do
left, right = hg.OpenVRStateToViewState(vr_state)

vid = 0 -- keep track of the next free view id
passId = hg.SceneForwardPipelinePassViewId()

-- Prepare view-independent render data once
vid, passId = hg.PrepareSceneForwardPipelineCommonRenderData(vid, scene, render_data, pipeline, res)
vid, passId = hg.PrepareSceneForwardPipelineCommonRenderData(vid, scene, render_data, pipeline, res, passId)
vr_eye_rect = hg.IntRect(0, 0, vr_state.width, vr_state.height)

-- Prepare the left eye render data then draw to its framebuffer
vid, passId = hg.PrepareSceneForwardPipelineViewDependentRenderData(vid, left, scene, render_data, pipeline, res)
vid, passId = hg.PrepareSceneForwardPipelineViewDependentRenderData(vid, left, scene, render_data, pipeline, res, passId)
vid, passId = hg.SubmitSceneToForwardPipeline(vid, scene, vr_eye_rect, left, pipeline, render_data, res, vr_left_fb:GetHandle())

-- Prepare the right eye render data then draw to its framebuffer
vid, passId = hg.PrepareSceneForwardPipelineViewDependentRenderData(vid, right, scene, render_data, pipeline, res)
vid, passId = hg.PrepareSceneForwardPipelineViewDependentRenderData(vid, right, scene, render_data, pipeline, res, passId)
vid, passId = hg.SubmitSceneToForwardPipeline(vid, scene, vr_eye_rect, right, pipeline, render_data, res, vr_right_fb:GetHandle())

-- Display the VR eyes texture to the backbuffer
Expand Down

0 comments on commit e2d167e

Please sign in to comment.