From cba8b0962d8f616fc123bf8ae132cc6f54cf462c Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 9 Oct 2015 13:29:59 -0700 Subject: [PATCH 1/6] Fix warnings --- libraries/gpu/src/gpu/GLBackendTexture.cpp | 2 -- .../input-plugins/src/input-plugins/SixenseManager.cpp | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackendTexture.cpp b/libraries/gpu/src/gpu/GLBackendTexture.cpp index b72fadafa0..71c5a83331 100755 --- a/libraries/gpu/src/gpu/GLBackendTexture.cpp +++ b/libraries/gpu/src/gpu/GLBackendTexture.cpp @@ -339,8 +339,6 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) { GLTexelFormat texelFormat = GLTexelFormat::evalGLTexelFormat(texture.getTexelFormat(), srcFormat); - auto semantic = texture.getTexelFormat().getSemantic(); - glTexImage2D(GL_TEXTURE_2D, 0, texelFormat.internalFormat, texture.getWidth(), texture.getHeight(), 0, texelFormat.format, texelFormat.type, bytes); diff --git a/libraries/input-plugins/src/input-plugins/SixenseManager.cpp b/libraries/input-plugins/src/input-plugins/SixenseManager.cpp index bc64ec4ccc..f542e63668 100644 --- a/libraries/input-plugins/src/input-plugins/SixenseManager.cpp +++ b/libraries/input-plugins/src/input-plugins/SixenseManager.cpp @@ -68,10 +68,10 @@ const float DEFAULT_REACH_LENGTH = 1.5f; SixenseManager::SixenseManager() : InputDevice("Hydra"), -#ifdef __APPLE__ - _sixenseLibrary(NULL), -#endif _reachLength(DEFAULT_REACH_LENGTH), +#ifdef __APPLE__ + _sixenseLibrary(nullptr), +#endif _hydrasConnected(false) { } From 4e72d945b634605ef37d7bb13dc282bef72aeb80 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 9 Oct 2015 14:00:35 -0700 Subject: [PATCH 2/6] try debuging the sh orientation on mac --- libraries/render-utils/src/DeferredGlobalLight.slh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index 983b8002f7..6621f52124 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -125,7 +125,10 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, vec3 positi vec4 fragEyeVector = invViewMat * vec4(-position, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - vec3 color = diffuse.rgb * evalSphericalLight(ambientSphere, fragNormal).xyz * getLightAmbientIntensity(light); + vec3 mapVal = evalSkyboxLight(fragNormal, 0).xyz; + vec3 shVal = evalSphericalLight(ambientSphere, fragNormal).xyz; + vec3 ambientLight = (normal.x > 0 ? mapVal : shVal) * getLightAmbientIntensity(light); + vec3 color = diffuse.rgb * ambientLight; vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); From f0af4f17753ae36a1a39109f9e03149de8abe066 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 9 Oct 2015 16:08:35 -0700 Subject: [PATCH 3/6] try debuging the sh orientation on mac --- libraries/render-utils/src/DeferredGlobalLight.slh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index 6621f52124..351a178968 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -41,7 +41,7 @@ struct SphericalHarmonics { vec4 evalSphericalLight(SphericalHarmonics sh, vec3 direction ) { - vec3 dir = direction.xzy; // we don;t understand why yet but we need to use z as vertical axis? + vec3 dir = direction.xyz; // we don;t understand why yet but we need to use z as vertical axis? const float C1 = 0.429043; const float C2 = 0.511664; From c02d33c17cebb798fbf7bff43b9579c9b6419a30 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 9 Oct 2015 17:27:50 -0700 Subject: [PATCH 4/6] Adding example mapping files --- .../resources/controllers/mapping-config.json | 24 +++++++++++++ .../resources/controllers/mapping-test0.json | 36 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 interface/resources/controllers/mapping-config.json create mode 100644 interface/resources/controllers/mapping-test0.json diff --git a/interface/resources/controllers/mapping-config.json b/interface/resources/controllers/mapping-config.json new file mode 100644 index 0000000000..053a637c6f --- /dev/null +++ b/interface/resources/controllers/mapping-config.json @@ -0,0 +1,24 @@ +{ + "name": "Full Mapping config including the standard hydra and gamepad and one more thing", + "mappings": [ + "src": "./mapping-hydra.json", + "src": "./mapping-xbox.json", + { + "name": "example mapping for standard to js function", + "channels": [ { + "from": "Standard.B", + "to": { + "type":"js", + "function": "function(value){ print("Standard.B = " + value );}" + } + }, { + "from": "Standard.B", + "to": { + "type":"js", + "src": "http://www.theNextBigThing.com/hifiInputSignalHandler.js" + } + } + ] + } + ] +} diff --git a/interface/resources/controllers/mapping-test0.json b/interface/resources/controllers/mapping-test0.json new file mode 100644 index 0000000000..c52b03be92 --- /dev/null +++ b/interface/resources/controllers/mapping-test0.json @@ -0,0 +1,36 @@ +{ + "name": "example mapping from Standard to actions", + "channels": [ { + "from": "Standard.LY", + "filters": [ { + "type": "clamp", + "min": 0, + "max": 1, + } + ], + "to": "Actions.Forward", + }, { + "from": "Standard.LY", + "filters": [ { + "type": "clamp", + "min": -1, + "max": 0, + }, { + "type": "invert" + } + ], + "to": "Actions.Backward", + }, { + "from": "Standard.LX", + "filters": [ { + "type": "scale", + "scale": 2.0, + } + ], + "to": "Actions.Yaw", + }, { + "from": "Standard.A", + "to": "Actions.Action0" + } + ] +} \ No newline at end of file From 297c3c9ed0dbacd7bcd3e9b82e6f98c69703451e Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 9 Oct 2015 17:37:51 -0700 Subject: [PATCH 5/6] Fixing json issues --- interface/resources/controllers/mapping-config.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/resources/controllers/mapping-config.json b/interface/resources/controllers/mapping-config.json index 053a637c6f..dd3bc7b05e 100644 --- a/interface/resources/controllers/mapping-config.json +++ b/interface/resources/controllers/mapping-config.json @@ -1,15 +1,15 @@ { "name": "Full Mapping config including the standard hydra and gamepad and one more thing", - "mappings": [ - "src": "./mapping-hydra.json", - "src": "./mapping-xbox.json", + "mappings": [ + { "src": "./mapping-hydra.json" }, + { "src": "./mapping-xbox.json" }, { "name": "example mapping for standard to js function", "channels": [ { "from": "Standard.B", "to": { "type":"js", - "function": "function(value){ print("Standard.B = " + value );}" + "function": "function(value){ print(\"Standard.B = \" + value );}" } }, { "from": "Standard.B", From 3d607f406f99a349504b32aedbfacef4d5ec296d Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 9 Oct 2015 17:40:36 -0700 Subject: [PATCH 6/6] revert change to the slf file --- libraries/render-utils/src/DeferredGlobalLight.slh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index 351a178968..983b8002f7 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -41,7 +41,7 @@ struct SphericalHarmonics { vec4 evalSphericalLight(SphericalHarmonics sh, vec3 direction ) { - vec3 dir = direction.xyz; // we don;t understand why yet but we need to use z as vertical axis? + vec3 dir = direction.xzy; // we don;t understand why yet but we need to use z as vertical axis? const float C1 = 0.429043; const float C2 = 0.511664; @@ -125,10 +125,7 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, vec3 positi vec4 fragEyeVector = invViewMat * vec4(-position, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - vec3 mapVal = evalSkyboxLight(fragNormal, 0).xyz; - vec3 shVal = evalSphericalLight(ambientSphere, fragNormal).xyz; - vec3 ambientLight = (normal.x > 0 ? mapVal : shVal) * getLightAmbientIntensity(light); - vec3 color = diffuse.rgb * ambientLight; + vec3 color = diffuse.rgb * evalSphericalLight(ambientSphere, fragNormal).xyz * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss);