SHARE
TWEET
Untitled
a guest
Jul 7th, 2013
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- diff --git a/Quake/r_renderhmd.c b/Quake/r_renderhmd.c
- index cfa87a0..6dab593 100644
- --- a/Quake/r_renderhmd.c
- +++ b/Quake/r_renderhmd.c
- @@ -359,15 +359,15 @@ qboolean R_InitHMDRenderer(hmd_settings_t *hmd)
- // Set up eyes
- left_eye.offset = -player_height_units * (hmd->interpupillary_distance/player_height_m) * 0.5;
- left_eye.lens_shift = lens_shift;
- - left_eye.fbo = CreateFBO(glwidth*left_eye.viewport.width, glheight*left_eye.viewport.height);
- + left_eye.fbo = CreateFBO(glwidth*left_eye.viewport.width * 3, glheight*left_eye.viewport.height * 3);
- CreatePerspectiveMatrix(left_eye.projection_matrix, fovy, aspect, 4, gl_farclip.value, h);
- right_eye.offset = player_height_units * (hmd->interpupillary_distance/player_height_m) * 0.5;
- right_eye.lens_shift = -lens_shift;
- - right_eye.fbo = CreateFBO(glwidth*right_eye.viewport.width, glheight*right_eye.viewport.height);
- + right_eye.fbo = CreateFBO(glwidth*right_eye.viewport.width * 3, glheight*right_eye.viewport.height * 3);
- CreatePerspectiveMatrix(right_eye.projection_matrix, fovy, aspect, 4, gl_farclip.value, -h);
- -
- +
- // Get uniform location and set some values
- glUseProgramObjectARB(lens_warp_shader.program);
- lens_warp_shader_uniforms.scale = glGetUniformLocationARB(lens_warp_shader.program, "scale");
- @@ -418,7 +418,13 @@ void RenderScreenForEye(hmd_eye_t *eye)
- // Remember the current vrect.width and vieworg; we have to modify it here
- // for each eye
- int oldwidth = r_refdef.vrect.width;
- + int oldheight = r_refdef.vrect.height;
- + int oldglheight = glheight;
- + int oldglwidth = glwidth;
- + glheight *= 3;
- r_refdef.vrect.width *= eye->viewport.width;
- + r_refdef.vrect.width *= 3;
- + r_refdef.vrect.height *= 3;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, eye->fbo.framebuffer);
- glClear(GL_DEPTH_BUFFER_BIT);
- @@ -443,8 +449,11 @@ void RenderScreenForEye(hmd_eye_t *eye)
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- r_refdef.vrect.width = oldwidth;
- + r_refdef.vrect.height = oldheight;
- hmd_projection_matrix = NULL;
- hmd_view_offset = 0;
- + glheight = oldglheight;
- + glwidth = oldglwidth;
- }
- void RenderEyeOnScreen(hmd_eye_t *eye)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

