diff options
| author | Ray <raysan5@gmail.com> | 2016-07-04 01:29:23 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-07-04 01:29:23 +0200 |
| commit | ee72654b557202a673f042484c83d3020ae618b8 (patch) | |
| tree | 3479ad33ec4feafe25b7b32ee8c9df973d5f1a3f /examples | |
| parent | 164ead03c9f4d8af6d2e2e0eabcf40a60ad47cb3 (diff) | |
| download | raylib-ee72654b557202a673f042484c83d3020ae618b8.tar.gz raylib-ee72654b557202a673f042484c83d3020ae618b8.zip | |
Redesigned stereo rendering mechanism
Now it's easier for the user! Just init Oculus device and get stereo
rendering!
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core_oculus_rift.c | 11 | ||||
| -rw-r--r-- | examples/resources/shaders/glsl330/distortion.fs | 9 |
2 files changed, 7 insertions, 13 deletions
diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index c073d3d6..131a21c2 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -50,22 +50,15 @@ int main() // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - + ClearBackground(RAYWHITE); - + Begin3dMode(camera); - for (int eye = 0; eye < 2; eye++) - { - SetOculusView(eye); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); DrawGrid(10, 1.0f); - - DrawDefaultBuffers(); // Process internal dynamic buffers - } End3dMode(); diff --git a/examples/resources/shaders/glsl330/distortion.fs b/examples/resources/shaders/glsl330/distortion.fs index 4cd9937f..62856341 100644 --- a/examples/resources/shaders/glsl330/distortion.fs +++ b/examples/resources/shaders/glsl330/distortion.fs @@ -10,12 +10,13 @@ uniform sampler2D texture0; out vec4 finalColor; // NOTE: Add here your custom variables -const vec2 LeftLensCenter = vec2(0.2863248, 0.5); -const vec2 RightLensCenter = vec2(0.7136753, 0.5); +const vec2 LeftLensCenter = vec2(0.288, 0.5); +const vec2 RightLensCenter = vec2(0.712, 0.5); const vec2 LeftScreenCenter = vec2(0.25, 0.5); const vec2 RightScreenCenter = vec2(0.75, 0.5); -const vec2 Scale = vec2(0.25, 0.45); //vec2(0.1469278, 0.2350845); -const vec2 ScaleIn = vec2(4, 2.2222); +uniform vec2 Scale = vec2(0.25, 0.45); //vec2(0.1469278, 0.2350845); +uniform vec2 ScaleIn = vec2(4, 2.2222); + const vec4 HmdWarpParam = vec4(1, 0.22, 0.24, 0); const vec4 ChromaAbParam = vec4(0.996, -0.004, 1.014, 0.0); |
