|
153 | 153 | import net.minecraft.world.EnumDifficulty; |
154 | 154 | import net.minecraft.world.WorldProviderEnd; |
155 | 155 | import net.minecraft.world.WorldProviderHell; |
156 | | -@@ -150,2988 +224,4801 @@ |
| 156 | +@@ -150,2988 +224,4838 @@ |
157 | 157 | import net.minecraft.world.storage.ISaveFormat; |
158 | 158 | import net.minecraft.world.storage.ISaveHandler; |
159 | 159 | import net.minecraft.world.storage.WorldInfo; |
|
1941 | 1941 | + public int _DepthMask_viewMatrix = -1; |
1942 | 1942 | + public int _DepthMask_passUniform = -1; |
1943 | 1943 | + public int _DepthMask_keyColorUniform = -1; |
| 1944 | ++ public int _FOVReduction_RadiusUniform = -1; |
| 1945 | ++ public int _FOVReduction_BorderUniform = -1; |
| 1946 | ++ public int _FOVReduction_TextureUniform= -1; |
| 1947 | ++ public int _FOVReduction_shaderProgramId = -1; |
1944 | 1948 | + private FloatBuffer matrixBuffer = GLAllocation.createDirectFloatBuffer(16); |
1945 | 1949 | + private Framebuffer mirrorFB = null; |
1946 | 1950 | + private Framebuffer fsaaFirstPassResultFBO; |
|
1983 | 1987 | + * The minecriftVerString will be automatically updated by the build scripts, do not modify here. |
1984 | 1988 | + * Modify minecriftversion.py in root minecrift dir. |
1985 | 1989 | + */ |
1986 | | -+ public final String minecriftVerString = "Vivecraft 1.7.10 Vivecraft-jrbudda32"; |
| 1990 | ++ public final String minecriftVerString = "Vivecraft 1.7.10 Vivecraft-jrbudda33"; |
1987 | 1991 | + /* end version */ |
1988 | 1992 | + /** END MINECRIFT */ |
1989 | 1993 | + |
|
3071 | 3075 | + mcProfiler.endSection(); |
3072 | 3076 | + |
3073 | 3077 | + mcProfiler.startSection("Display/Reproject"); |
| 3078 | ++ try { |
3074 | 3079 | + this.stereoProvider.endFrame(); |
| 3080 | ++ } catch (Exception e) { |
| 3081 | ++ logger.error(e); |
| 3082 | ++ } |
3075 | 3083 | + mcProfiler.endSection(); |
3076 | 3084 | + |
3077 | 3085 | + ////END MAIN VIVECRAFT RENDERING |
|
3180 | 3188 | + framebufferEye0.bindFramebuffer(true); //draw to L eye tex |
3181 | 3189 | + else |
3182 | 3190 | + framebufferEye1.bindFramebuffer(true); //draw to R eye tex |
3183 | | -+ framebuffer.framebufferRender(framebufferEye0.framebufferWidth, framebufferEye0.framebufferHeight); |
3184 | | -+ } |
| 3191 | ++ if(vrSettings.useFOVReduction && vrSettings.vrFreeMove){ |
| 3192 | ++ if( thePlayer !=null && (Math.abs(thePlayer.moveForward) > 0 || Math.abs(thePlayer.moveStrafing) > 0)) { |
| 3193 | ++ fov -=0.05; |
| 3194 | ++ if(fov < 0.22) fov = 0.22f; |
| 3195 | ++ } else { |
| 3196 | ++ fov +=0.01; |
| 3197 | ++ if(fov > 0.8) fov = 0.8f; |
| 3198 | ++ } |
| 3199 | ++ ARBShaderObjects.glUseProgramObjectARB(_FOVReduction_shaderProgramId); |
| 3200 | ++ ARBShaderObjects.glUniform1fARB(_FOVReduction_RadiusUniform, fov); |
| 3201 | ++ ARBShaderObjects.glUniform1iARB(_FOVReduction_TextureUniform, 0); |
| 3202 | ++ ARBShaderObjects.glUniform1fARB(_FOVReduction_BorderUniform, 0.06f); |
| 3203 | ++ framebuffer.framebufferRender(framebufferEye0.framebufferWidth, framebufferEye0.framebufferHeight); |
| 3204 | ++ ARBShaderObjects.glUseProgramObjectARB(0); |
| 3205 | ++ } |
| 3206 | ++ else{ |
| 3207 | ++ framebuffer.framebufferRender(framebufferEye0.framebufferWidth, framebufferEye0.framebufferHeight); |
| 3208 | ++ } } |
3185 | 3209 | + this.mcProfiler.endSection(); |
3186 | 3210 | + |
3187 | 3211 | + //this.mcProfiler.startSection("OpenGL Finish"); |
|
3192 | 3216 | + if(this.stereoProvider.isStereo()) |
3193 | 3217 | + this.stereoProvider.endFrame(this.currentPass); |
3194 | 3218 | + else |
3195 | | -+ this.stereoProvider.endFrame(); |
| 3219 | ++ try { |
| 3220 | ++ this.stereoProvider.endFrame(); |
| 3221 | ++ } catch (RenderConfigException e) { |
| 3222 | ++ // TODO Auto-generated catch block |
| 3223 | ++ e.printStackTrace(); |
| 3224 | ++ } |
3196 | 3225 | + this.mcProfiler.endSection(); |
3197 | 3226 | + } |
3198 | 3227 | + |
|
3206 | 3235 | + return shouldupdate; |
3207 | 3236 | + } |
3208 | 3237 | + |
| 3238 | ++ private float fov; |
| 3239 | ++ |
3209 | 3240 | + /** |
3210 | 3241 | + * Called to ensure everything gets drawn right when window size is changed |
3211 | 3242 | + */ |
|
7155 | 7186 | + _DepthMask_passUniform = ARBShaderObjects.glGetUniformLocationARB(_DepthMask_shaderProgramId, "pass"); |
7156 | 7187 | + _DepthMask_keyColorUniform = ARBShaderObjects.glGetUniformLocationARB(_DepthMask_shaderProgramId, "keyColor"); |
7157 | 7188 | + |
| 7189 | ++ |
| 7190 | ++ _FOVReduction_shaderProgramId = ShaderHelper.initShaders(VRShaders.FOV_REDUCTION_VERTEX_SHADER, VRShaders.FOV_REDUCTION_FRAGMENT_SHADER, true); |
| 7191 | ++ if (_FOVReduction_shaderProgramId == 0) { |
| 7192 | ++ throw new Exception("Failed to validate FOV shader!"); |
| 7193 | ++ } |
| 7194 | ++ |
| 7195 | ++ ShaderHelper.checkGLError("@1"); |
| 7196 | ++ |
| 7197 | ++ // Setup uniform IDs |
| 7198 | ++ _FOVReduction_RadiusUniform = ARBShaderObjects.glGetUniformLocationARB(_FOVReduction_shaderProgramId, "circle_radius"); |
| 7199 | ++ _FOVReduction_BorderUniform = ARBShaderObjects.glGetUniformLocationARB(_FOVReduction_shaderProgramId, "border"); |
| 7200 | ++ _FOVReduction_TextureUniform = ARBShaderObjects.glGetUniformLocationARB(_FOVReduction_shaderProgramId, "tex0"); |
| 7201 | ++ |
| 7202 | ++ ShaderHelper.checkGLError("FBO init FOV shader"); |
7158 | 7203 | + checkGLError("post select"); |
7159 | 7204 | + entityRenderer.setupClipPlanes(); |
7160 | 7205 | + |
|
7470 | 7515 | + } |
7471 | 7516 | + } |
7472 | 7517 | + |
7473 | | -+ public boolean endFrame() |
7474 | | -+ { |
7475 | | -+ if (this.stereoProvider != null) |
7476 | | -+ this.stereoProvider.endFrame(); |
7477 | | -+ |
7478 | | -+ return true; |
7479 | | -+ } |
7480 | | -+ |
7481 | 7518 | + public double getCurrentTimeSecs() |
7482 | 7519 | + { |
7483 | 7520 | + return this.stereoProvider.getCurrentTimeSecs(); |
|
0 commit comments