diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index ffd3d81b84..0beb28977e 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -172,7 +172,7 @@ StackView { source: InputConfiguration.configurationLayout(box.currentText); onLoaded: { if (loader.item.hasOwnProperty("pluginName")) { - if (box.currentText === "Vive") { + if (box.currentText === "HTC Vive") { loader.item.pluginName = "OpenVR"; } else { loader.item.pluginName = box.currentText; diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 5a3caa55fe..5062162b6e 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -251,7 +251,7 @@ void ZoneEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scen updateAmbientLightFromEntity(entity); } - if (skyboxChanged) { + if (skyboxChanged || _proceduralUserData != entity->getUserData()) { updateKeyBackgroundFromEntity(entity); } @@ -295,6 +295,10 @@ bool ZoneEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPoint return true; } + if (entity->getUserData() != _proceduralUserData) { + return true; + } + #if 0 if (_typedEntity->getCompoundShapeURL() != _lastShapeURL) { return true; diff --git a/libraries/graphics/src/graphics/skybox.slf b/libraries/graphics/src/graphics/skybox.slf index 7b25e36af7..153e73b9ef 100755 --- a/libraries/graphics/src/graphics/skybox.slf +++ b/libraries/graphics/src/graphics/skybox.slf @@ -35,8 +35,11 @@ void main(void) { #ifdef PROCEDURAL vec3 color = getSkyboxColor(); - // Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline - color = pow(color, vec3(2.2)); + // Protect from NaNs and negative values + color = mix(color, vec3(0), isnan(color)); + color = max(color, vec3(0)); + // Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline + color = pow(color, vec3(2.2)); _fragColor = vec4(color, 0.0); // FIXME: scribe does not yet scrub out else statements diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp index c155d5bd7f..259da163dd 100644 --- a/libraries/procedural/src/procedural/Procedural.cpp +++ b/libraries/procedural/src/procedural/Procedural.cpp @@ -270,18 +270,24 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm // Leave this here for debugging // qCDebug(procedural) << "FragmentShader:\n" << fragmentShaderSource.c_str(); + gpu::Shader::BindingSet slotBindings; + slotBindings.insert(gpu::Shader::Binding(std::string("iChannel0"), 0)); + slotBindings.insert(gpu::Shader::Binding(std::string("iChannel1"), 1)); + slotBindings.insert(gpu::Shader::Binding(std::string("iChannel2"), 2)); + slotBindings.insert(gpu::Shader::Binding(std::string("iChannel3"), 3)); + _opaqueFragmentShader = gpu::Shader::createPixel(opaqueShaderSource); _opaqueShader = gpu::Shader::createProgram(_vertexShader, _opaqueFragmentShader); - _transparentFragmentShader = gpu::Shader::createPixel(transparentShaderSource); - _transparentShader = gpu::Shader::createProgram(_vertexShader, _transparentFragmentShader); + gpu::Shader::makeProgram(*_opaqueShader, slotBindings); - gpu::Shader::BindingSet slotBindings; - slotBindings.insert(gpu::Shader::Binding(std::string("iChannel0"), 0)); - slotBindings.insert(gpu::Shader::Binding(std::string("iChannel1"), 1)); - slotBindings.insert(gpu::Shader::Binding(std::string("iChannel2"), 2)); - slotBindings.insert(gpu::Shader::Binding(std::string("iChannel3"), 3)); - gpu::Shader::makeProgram(*_opaqueShader, slotBindings); - gpu::Shader::makeProgram(*_transparentShader, slotBindings); + if (!transparentShaderSource.empty() && transparentShaderSource != opaqueShaderSource) { + _transparentFragmentShader = gpu::Shader::createPixel(transparentShaderSource); + _transparentShader = gpu::Shader::createProgram(_vertexShader, _transparentFragmentShader); + gpu::Shader::makeProgram(*_transparentShader, slotBindings); + } else { + _transparentFragmentShader = _opaqueFragmentShader; + _transparentShader = _opaqueShader; + } _opaquePipeline = gpu::Pipeline::create(_opaqueShader, _opaqueState); _transparentPipeline = gpu::Pipeline::create(_transparentShader, _transparentState); diff --git a/libraries/render-utils/src/forward_simple.slf b/libraries/render-utils/src/forward_simple.slf index 587fcbde73..1ac44750a7 100644 --- a/libraries/render-utils/src/forward_simple.slf +++ b/libraries/render-utils/src/forward_simple.slf @@ -16,11 +16,21 @@ <@include ForwardGlobalLight.slh@> <$declareEvalSkyboxGlobalColor()$> + // the interpolated normal in vec3 _normalWS; +in vec3 _normalMS; in vec4 _color; +in vec2 _texCoord0; +in vec4 _positionMS; in vec4 _positionES; +// For retro-compatibility +#define _normal _normalWS +#define _modelNormal _normalMS +#define _position _positionMS +#define _eyePosition _positionES + layout(location = 0) out vec4 _fragColor0; //PROCEDURAL_COMMON_BLOCK diff --git a/libraries/render-utils/src/forward_simple_transparent.slf b/libraries/render-utils/src/forward_simple_transparent.slf index f40ba2ed4f..8be2759571 100644 --- a/libraries/render-utils/src/forward_simple_transparent.slf +++ b/libraries/render-utils/src/forward_simple_transparent.slf @@ -18,9 +18,18 @@ // the interpolated normal in vec3 _normalWS; +in vec3 _normalMS; in vec4 _color; +in vec2 _texCoord0; +in vec4 _positionMS; in vec4 _positionES; +// For retro-compatibility +#define _normal _normalWS +#define _modelNormal _normalMS +#define _position _positionMS +#define _eyePosition _positionES + layout(location = 0) out vec4 _fragColor0; //PROCEDURAL_COMMON_BLOCK diff --git a/libraries/render-utils/src/simple.slf b/libraries/render-utils/src/simple.slf index ed77777184..7591dc1882 100644 --- a/libraries/render-utils/src/simple.slf +++ b/libraries/render-utils/src/simple.slf @@ -16,7 +16,17 @@ // the interpolated normal in vec3 _normalWS; +in vec3 _normalMS; in vec4 _color; +in vec2 _texCoord0; +in vec4 _positionMS; +in vec4 _positionES; + +// For retro-compatibility +#define _normal _normalWS +#define _modelNormal _normalMS +#define _position _positionMS +#define _eyePosition _positionES //PROCEDURAL_COMMON_BLOCK diff --git a/libraries/render-utils/src/simple_fade.slf b/libraries/render-utils/src/simple_fade.slf index 6e7aee2894..0710c3e10b 100644 --- a/libraries/render-utils/src/simple_fade.slf +++ b/libraries/render-utils/src/simple_fade.slf @@ -19,9 +19,19 @@ // the interpolated normal in vec3 _normalWS; +in vec3 _normalMS; in vec4 _color; +in vec2 _texCoord0; +in vec4 _positionMS; +in vec4 _positionES; in vec4 _positionWS; +// For retro-compatibility +#define _normal _normalWS +#define _modelNormal _normalMS +#define _position _positionMS +#define _eyePosition _positionES + //PROCEDURAL_COMMON_BLOCK #line 1001 diff --git a/libraries/render-utils/src/simple_transparent.slf b/libraries/render-utils/src/simple_transparent.slf index c9815e8a80..ee79d2c0c4 100644 --- a/libraries/render-utils/src/simple_transparent.slf +++ b/libraries/render-utils/src/simple_transparent.slf @@ -16,7 +16,17 @@ // the interpolated normal in vec3 _normalWS; +in vec3 _normalMS; in vec4 _color; +in vec2 _texCoord0; +in vec4 _positionMS; +in vec4 _positionES; + +// For retro-compatibility +#define _normal _normalWS +#define _modelNormal _normalMS +#define _position _positionMS +#define _eyePosition _positionES //PROCEDURAL_COMMON_BLOCK