Skip to content

Commit

Permalink
Fix "Tried to invert singular LMatrix4." at start-up
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Jan 25, 2021
1 parent 57256f0 commit d8c38c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rpcore/common_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ def _setup_inputs(self):
# Set the correct frame rate interval
Globals.clock.set_average_frame_rate_interval(3.0)

# Set initial value for view_proj_mat_no_jitter
view_mat = Globals.render.get_transform(self._showbase.cam).get_mat()
proj_mat = Mat4(self._showbase.camLens.get_projection_mat())
proj_mat.set_cell(1, 0, 0.0)
proj_mat.set_cell(1, 1, 0.0)
self._input_ubo.update_input("view_proj_mat_no_jitter", view_mat * proj_mat)

def write_config(self):
""" Generates the shader configuration for the common inputs """
content = self._input_ubo.generate_shader_code()
Expand Down

0 comments on commit d8c38c0

Please sign in to comment.