summaryrefslogtreecommitdiffhomepage
path: root/examples/core/core_vr_simulator.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-04-22 18:55:24 +0200
committerRay <[email protected]>2021-04-22 18:55:24 +0200
commitdcf52c132fb0ca28f37dae9d957155e2541df812 (patch)
treeb6c263e59daba00fc33badd0a45fa6756d5df14c /examples/core/core_vr_simulator.c
parentf92ee46d86b5a0cfb05c10b0c31fb966a4784b44 (diff)
downloadraylib-dcf52c132fb0ca28f37dae9d957155e2541df812.tar.gz
raylib-dcf52c132fb0ca28f37dae9d957155e2541df812.zip
Remove trail spaces
Diffstat (limited to 'examples/core/core_vr_simulator.c')
-rw-r--r--examples/core/core_vr_simulator.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/examples/core/core_vr_simulator.c b/examples/core/core_vr_simulator.c
index b57e1f7f..bba90b82 100644
--- a/examples/core/core_vr_simulator.c
+++ b/examples/core/core_vr_simulator.c
@@ -38,9 +38,9 @@ int main(void)
.eyeToScreenDistance = 0.041f, // Distance between eye and display in meters
.lensSeparationDistance = 0.07f, // Lens separation distance in meters
.interpupillaryDistance = 0.07f, // IPD (distance between pupils) in meters
-
+
// NOTE: CV1 uses fresnel-hybrid-asymmetric lenses with specific compute shaders
- // Following parameters are just an approximation to CV1 distortion stereo rendering
+ // Following parameters are just an approximation to CV1 distortion stereo rendering
.lensDistortionValues[0] = 1.0f, // Lens distortion constant parameter 0
.lensDistortionValues[1] = 0.22f, // Lens distortion constant parameter 1
.lensDistortionValues[2] = 0.24f, // Lens distortion constant parameter 2
@@ -50,32 +50,32 @@ int main(void)
.chromaAbCorrection[2] = 1.014f, // Chromatic aberration correction parameter 2
.chromaAbCorrection[3] = 0.0f, // Chromatic aberration correction parameter 3
};
-
+
// Load VR stereo config for VR device parameteres (Oculus Rift CV1 parameters)
VrStereoConfig config = LoadVrStereoConfig(device);
// Distortion shader (uses device lens distortion and chroma)
Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION));
-
+
// Update distortion shader with lens and distortion-scale parameters
- SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"),
config.leftLensCenter, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "rightLensCenter"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "rightLensCenter"),
config.rightLensCenter, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "leftScreenCenter"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "leftScreenCenter"),
config.leftScreenCenter, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "rightScreenCenter"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "rightScreenCenter"),
config.rightScreenCenter, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "scale"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "scale"),
config.scale, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "scaleIn"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "scaleIn"),
config.scaleIn, SHADER_UNIFORM_VEC2);
- SetShaderValue(distortion, GetShaderLocation(distortion, "deviceWarpParam"),
+ SetShaderValue(distortion, GetShaderLocation(distortion, "deviceWarpParam"),
device.lensDistortionValues, SHADER_UNIFORM_VEC4);
SetShaderValue(distortion, GetShaderLocation(distortion, "chromaAbParam"),
device.chromaAbCorrection, SHADER_UNIFORM_VEC4);
-
+
// Initialize framebuffer for stereo rendering
// NOTE: Screen size should match HMD aspect ratio
RenderTexture2D target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight());
@@ -121,9 +121,9 @@ int main(void)
EndMode3D();
EndVrStereoMode();
EndTextureMode();
-
+
BeginShaderMode(distortion);
- DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width,
+ DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width,
(float)-target.texture.height }, (Vector2){ 0.0f, 0.0f }, WHITE);
EndShaderMode();
@@ -136,7 +136,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadVrStereoConfig(config); // Unload stereo config
-
+
UnloadRenderTexture(target); // Unload stereo render fbo
UnloadShader(distortion); // Unload distortion shader