From d128af48db49f07ef5575b2d93a11ea9e6224822 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 28 Jun 2016 13:47:55 -0700 Subject: [PATCH] Fix the curvature issue in stereo by evaluating in the mono clip space, not stereo. INtegrate the scattering in simple ambient without IBL --- .../src/DeferredFrameTransform.cpp | 7 +- .../render-utils/src/DeferredFrameTransform.h | 2 + .../render-utils/src/DeferredGlobalLight.slh | 103 +++++++++++++++++- .../src/DeferredLightingEffect.cpp | 2 + .../render-utils/src/DeferredLightingEffect.h | 8 +- .../render-utils/src/DeferredTransform.slh | 4 + .../render-utils/src/SubsurfaceScattering.cpp | 17 +++ .../render-utils/src/SubsurfaceScattering.h | 16 ++- .../render-utils/src/SubsurfaceScattering.slh | 11 ++ .../render-utils/src/SurfaceGeometryPass.h | 2 +- .../src/directional_ambient_light.slf | 18 +++ .../src/surfaceGeometry_makeCurvature.slf | 45 ++++++-- libraries/render/src/render/BlurTask.h | 2 +- libraries/render/src/render/BlurTask.slh | 4 +- .../utilities/render/debugDeferredLighting.js | 4 +- .../render/debugSurfaceGeometryPass.js | 4 +- .../utilities/render/deferredLighting.qml | 10 ++ 17 files changed, 231 insertions(+), 28 deletions(-) diff --git a/libraries/render-utils/src/DeferredFrameTransform.cpp b/libraries/render-utils/src/DeferredFrameTransform.cpp index c5345e24f9..2f9d7b016a 100644 --- a/libraries/render-utils/src/DeferredFrameTransform.cpp +++ b/libraries/render-utils/src/DeferredFrameTransform.cpp @@ -36,13 +36,12 @@ void DeferredFrameTransform::update(RenderArgs* args) { cameraTransform.getMatrix(frameTransformBuffer.invView); cameraTransform.getInverseMatrix(frameTransformBuffer.view); + args->getViewFrustum().evalProjectionMatrix(frameTransformBuffer.projectionMono); + // Running in stero ? bool isStereo = args->_context->isStereo(); if (!isStereo) { - // Eval the mono projection - mat4 monoProjMat; - args->getViewFrustum().evalProjectionMatrix(monoProjMat); - frameTransformBuffer.projection[0] = monoProjMat; + frameTransformBuffer.projection[0] = frameTransformBuffer.projectionMono; frameTransformBuffer.stereoInfo = glm::vec4(0.0f, (float)args->_viewport.z, 0.0f, 0.0f); frameTransformBuffer.invpixelInfo = glm::vec4(1.0f / args->_viewport.z, 1.0f / args->_viewport.w, 0.0f, 0.0f); } else { diff --git a/libraries/render-utils/src/DeferredFrameTransform.h b/libraries/render-utils/src/DeferredFrameTransform.h index 82bc989028..70ac5fca92 100644 --- a/libraries/render-utils/src/DeferredFrameTransform.h +++ b/libraries/render-utils/src/DeferredFrameTransform.h @@ -45,6 +45,8 @@ protected: glm::vec4 stereoInfo{ 0.0 }; // Mono proj matrix or Left and Right proj matrix going from Mono Eye space to side clip space glm::mat4 projection[2]; + // THe mono projection for sure + glm::mat4 projectionMono; // Inv View matrix from eye space (mono) to world space glm::mat4 invView; // View matrix from world space to eye space (mono) diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index a5396958ea..0a75760fb0 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -110,6 +110,99 @@ vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, floa } <@endfunc@> +<@func declareEvalAmbientSphereGlobalColorScattering()@> + +<$declareDeferredCurvature()$> +<@include SubsurfaceScattering.slh@> +<$declareSubsurfaceScatteringResource()$> +!> + +vec3 evalAmbientSphereGlobalColorScattering(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec4 blurredCurvature, vec4 diffusedCurvature, float roughness) { + // prepareGlobalLight + + // Transform directions to worldspace + vec3 fragNormal = vec3((normal)); + vec3 fragEyeVector = vec3(invViewMat * vec4(-position, 0.0)); + vec3 fragEyeDir = normalize(fragEyeVector); + + // Get light + Light light = getLight(); + vec3 fresnel = vec3(0.028); // Default Di-electric fresnel value for skin + float metallic = 0.0; + + vec3 fragLightDir = -normalize(getLightDirection(light)); + + vec3 bentNormalHigh = normalize((blurredCurvature.xyz - 0.5f) * 2.0f); + vec3 bentNormalLow = normalize((diffusedCurvature.xyz - 0.5f) * 2.0f); + float curvature = unpackCurvature(diffusedCurvature.w); + + if (showDiffusedNormal()) { + return diffusedCurvature.xyz; + return bentNormalLow * 0.5 + vec3(0.5); + } + if (showCurvature()) { + float curvatureSigned = unpackCurvatureSigned(diffusedCurvature.w); + return (curvatureSigned > 0 ? vec3(curvatureSigned, 0.0, 0.0) : vec3(0.0, 0.0, -curvatureSigned)); + } + vec3 rS = bentNormalHigh; + + vec3 bendFactorSpectrum = getBendFactor(); + // vec3 rN = normalize(mix(normal, bentNormalLow, bendFactorSpectrum.x)); + vec3 rN = normalize(mix(bentNormalHigh, bentNormalLow, bendFactorSpectrum.x)); + vec3 gN = normalize(mix(bentNormalHigh, bentNormalLow, bendFactorSpectrum.y)); + vec3 bN = normalize(mix(bentNormalHigh, bentNormalLow, bendFactorSpectrum.z)); + + vec3 NdotLSpectrum = vec3(dot(rN, fragLightDir), dot(gN, fragLightDir), dot(bN, fragLightDir)); + + //return 0.5 * (NdotLSpectrum + vec3(1.0)); + // --> Look up the pre-integrated curvature-dependent BDRF textures + vec3 brdf = fetchBRDFSpectrum(NdotLSpectrum, curvature); + + // The position of the pixel fragment in Eye space then in world space + + float scatteringLevel = getScatteringLevel(); + + vec4 shading; + float standardDiffuse = clamp(dot(normal, fragLightDir), 0.0, 1.0); + { // Key Sun Lighting + // Diffuse Lighting + //float diffuse = clamp(dot(normal, fragLightDir), 0.0, 1.0); + + // Specular Lighting + vec3 halfDir = normalize(fragEyeDir + fragLightDir); + vec3 fresnelColor = fresnelSchlick(fresnel, fragLightDir, halfDir); + float power = specularDistribution(roughness, fragNormal, halfDir); + vec3 specular = power * fresnelColor * standardDiffuse; + + shading = vec4(specular, (1 - fresnelColor.x)); + } + + if (scatteringLevel < 0.1) { + brdf = vec3(standardDiffuse); + } + + vec3 color = vec3(albedo * vec3(brdf.xyz) * shading.w + shading.rgb) * getLightColor(light) * getLightIntensity(light); + + + // Diffuse from ambient + // color += albedo * evalSphericalLight(getLightAmbientSphere(light), bentNormalHigh).xyz *getLightAmbientIntensity(light); + + // Specular highlight from ambient + vec3 specularLighting = evalGlobalSpecularIrradiance(light, fragEyeDir, fragNormal, roughness, fresnel, 1.0); + // color += specularLighting; + + if (showBRDF()) + return brdf; + + //vec3 debugNdotL = 0.5 * (NdotLSpectrum + vec3(1.0)); + //return vec3(debugNdotL.z, curvature, 0.0 ); + + return vec3(color); +} +<@endfunc@> + + + <@func declareEvalSkyboxGlobalColor()@> <$declareEvalGlobalSpecularIrradiance(0, 1, 0)$> @@ -169,7 +262,7 @@ vec3 evalSkyboxGlobalColorScattering(mat4 invViewMat, float shadowAttenuation, f // Get light Light light = getLight(); - vec3 fresnel = vec3(0.03); // Default Di-electric fresnel value + vec3 fresnel = vec3(0.028); // Default Di-electric fresnel value for skin float metallic = 0.0; vec3 fragLightDir = -normalize(getLightDirection(light)); @@ -178,6 +271,14 @@ vec3 evalSkyboxGlobalColorScattering(mat4 invViewMat, float shadowAttenuation, f vec3 bentNormalLow = normalize( (diffusedCurvature.xyz - 0.5f) * 2.0f ); float curvature = unpackCurvature(diffusedCurvature.w); + if (showDiffusedNormal()) { + return diffusedCurvature.xyz; + return bentNormalLow * 0.5 + vec3(0.5); + } + if (showCurvature()) { + float curvatureSigned = unpackCurvatureSigned(diffusedCurvature.w); + return (curvatureSigned > 0 ? vec3(curvatureSigned, 0.0, 0.0) : vec3(0.0, 0.0, -curvatureSigned)); + } vec3 rS = bentNormalHigh; vec3 bendFactorSpectrum = getBendFactor(); diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index ff89a3fc46..217c6f726c 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -626,6 +626,8 @@ void RenderDeferred::configure(const Config& config) { _subsurfaceScatteringResource->setLevel((float)config.enableScattering); _subsurfaceScatteringResource->setShowBRDF(config.showScatteringBRDF); + _subsurfaceScatteringResource->setShowCurvature(config.showCurvature); + _subsurfaceScatteringResource->setShowDiffusedNormal(config.showDiffusedNormal); _enablePointLights = config.enablePointLights; _enableSpotLights = config.enableSpotLights; diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 85b9038046..4c64fdf93e 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -148,6 +148,8 @@ class RenderDeferredConfig : public render::Job::Config { Q_PROPERTY(bool enableScattering MEMBER enableScattering NOTIFY dirty) Q_PROPERTY(bool showScatteringBRDF MEMBER showScatteringBRDF NOTIFY dirty) + Q_PROPERTY(bool showCurvature MEMBER showCurvature NOTIFY dirty) + Q_PROPERTY(bool showDiffusedNormal MEMBER showDiffusedNormal NOTIFY dirty) Q_PROPERTY(bool enablePointLights MEMBER enablePointLights NOTIFY dirty) Q_PROPERTY(bool enableSpotLights MEMBER enableSpotLights NOTIFY dirty) @@ -162,10 +164,12 @@ public: float bentScale{ 1.5f }; float curvatureOffset{ 0.08f }; - float curvatureScale{ 0.8f }; + float curvatureScale{ 0.9f }; bool enableScattering{ true }; - bool showScatteringBRDF{ true }; + bool showScatteringBRDF{ false }; + bool showCurvature{ false }; + bool showDiffusedNormal{ false }; bool enablePointLights{ true }; bool enableSpotLights{ true }; diff --git a/libraries/render-utils/src/DeferredTransform.slh b/libraries/render-utils/src/DeferredTransform.slh index 520ac77fde..814a59a407 100644 --- a/libraries/render-utils/src/DeferredTransform.slh +++ b/libraries/render-utils/src/DeferredTransform.slh @@ -19,6 +19,7 @@ struct DeferredFrameTransform { vec4 _depthInfo; vec4 _stereoInfo; mat4 _projection[2]; + mat4 _projectionMono; mat4 _viewInverse; mat4 _view; }; @@ -49,6 +50,9 @@ float getProjScale(int resolutionLevel) { mat4 getProjection(int side) { return frameTransform._projection[side]; } +mat4 getProjectionMono() { + return frameTransform._projectionMono; +} // positive near distance of the projection float getProjectionNear() { diff --git a/libraries/render-utils/src/SubsurfaceScattering.cpp b/libraries/render-utils/src/SubsurfaceScattering.cpp index 9a14a0ae5e..542f12b33e 100644 --- a/libraries/render-utils/src/SubsurfaceScattering.cpp +++ b/libraries/render-utils/src/SubsurfaceScattering.cpp @@ -84,6 +84,23 @@ bool SubsurfaceScatteringResource::isShowBRDF() const { return (bool)_parametersBuffer.get().showBRDF; } +void SubsurfaceScatteringResource::setShowCurvature(bool show) { + if (show != isShowCurvature()) { + _parametersBuffer.edit().showCurvature = show; + } +} +bool SubsurfaceScatteringResource::isShowCurvature() const { + return (bool)_parametersBuffer.get().showCurvature; +} + +void SubsurfaceScatteringResource::setShowDiffusedNormal(bool show) { + if (show != isShowDiffusedNormal()) { + _parametersBuffer.edit().showDiffusedNormal = show; + } +} +bool SubsurfaceScatteringResource::isShowDiffusedNormal() const { + return (bool)_parametersBuffer.get().showDiffusedNormal; +} void SubsurfaceScatteringResource::generateScatteringTable(RenderArgs* args) { if (!_scatteringProfile) { diff --git a/libraries/render-utils/src/SubsurfaceScattering.h b/libraries/render-utils/src/SubsurfaceScattering.h index 704f8cd421..b4ad511bf3 100644 --- a/libraries/render-utils/src/SubsurfaceScattering.h +++ b/libraries/render-utils/src/SubsurfaceScattering.h @@ -35,7 +35,10 @@ public: void setShowBRDF(bool show); bool isShowBRDF() const; - + void setShowCurvature(bool show); + bool isShowCurvature() const; + void setShowDiffusedNormal(bool show); + bool isShowDiffusedNormal() const; UniformBufferView getParametersBuffer() const { return _parametersBuffer; } @@ -56,7 +59,12 @@ protected: glm::vec4 normalBentInfo{ 1.5f, 0.8f, 0.3f, 1.5f }; glm::vec2 curvatureInfo{ 0.08f, 0.8f }; float level{ 1.0f }; - float showBRDF{ 1.0f }; + float showBRDF{ 0.0f }; + float showCurvature{ 0.0f }; + float showDiffusedNormal{ 0.0f }; + float spare1{ 0.0f }; + float spare2{ 0.0f }; + Parameters() {} }; @@ -96,8 +104,8 @@ public: float curvatureOffset{ 0.08f }; float curvatureScale{ 0.8f }; - bool showProfile{ true }; - bool showLUT{ true }; + bool showProfile{ false }; + bool showLUT{ false }; signals: void dirty(); diff --git a/libraries/render-utils/src/SubsurfaceScattering.slh b/libraries/render-utils/src/SubsurfaceScattering.slh index b0a4596565..4aaaaff265 100644 --- a/libraries/render-utils/src/SubsurfaceScattering.slh +++ b/libraries/render-utils/src/SubsurfaceScattering.slh @@ -117,6 +117,7 @@ vec3 fetchBRDFSpectrum(vec3 LdotNSpectrum, float curvature) { struct ScatteringParameters { vec4 normalBendInfo; // R, G, B, factor vec4 curvatureInfo;// Offset, Scale, level + vec4 debugFlags; }; uniform subsurfaceScatteringParametersBuffer { @@ -135,6 +136,16 @@ bool showBRDF() { return parameters.curvatureInfo.w > 0.0; } +bool showCurvature() { + return parameters.debugFlags.x > 0.0; +} +bool showDiffusedNormal() { + return parameters.debugFlags.y > 0.0; +} +float unpackCurvatureSigned(float packedCurvature) { + return (packedCurvature * 2 - 1) * parameters.curvatureInfo.y + parameters.curvatureInfo.x; +} + float unpackCurvature(float packedCurvature) { return abs(packedCurvature * 2 - 1) * parameters.curvatureInfo.y + parameters.curvatureInfo.x; } diff --git a/libraries/render-utils/src/SurfaceGeometryPass.h b/libraries/render-utils/src/SurfaceGeometryPass.h index 697c93b745..834b404429 100644 --- a/libraries/render-utils/src/SurfaceGeometryPass.h +++ b/libraries/render-utils/src/SurfaceGeometryPass.h @@ -26,7 +26,7 @@ class SurfaceGeometryPassConfig : public render::Job::Config { public: SurfaceGeometryPassConfig() : render::Job::Config(true) {} - float depthThreshold{ 0.033f }; + float depthThreshold{ 0.02f }; // meters float basisScale{ 1.0f }; float curvatureScale{ 10.0f }; diff --git a/libraries/render-utils/src/directional_ambient_light.slf b/libraries/render-utils/src/directional_ambient_light.slf index b1142ffe9e..932f798a73 100755 --- a/libraries/render-utils/src/directional_ambient_light.slf +++ b/libraries/render-utils/src/directional_ambient_light.slf @@ -17,6 +17,8 @@ <$declareEvalLightmappedColor()$> <$declareEvalAmbientSphereGlobalColor()$> +<$declareEvalAmbientSphereGlobalColorScattering()$> + in vec2 _texCoord0; out vec4 _fragColor; @@ -38,6 +40,22 @@ void main(void) { frag.diffuse, frag.specularVal.xyz); _fragColor = vec4(color, 1.0); + } else if (frag.mode == FRAG_MODE_SCATTERING) { + + vec4 blurredCurvature = fetchCurvature(_texCoord0); + vec4 diffusedCurvature = fetchDiffusedCurvature(_texCoord0); + + vec3 color = evalAmbientSphereGlobalColorScattering( + getViewInverse(), + shadowAttenuation, + frag.obscurance, + frag.position.xyz, + frag.normal, + frag.diffuse, + blurredCurvature, + diffusedCurvature, + frag.roughness); + _fragColor = vec4(color, 1.0); } else { vec3 color = evalAmbientSphereGlobalColor( getViewInverse(), diff --git a/libraries/render-utils/src/surfaceGeometry_makeCurvature.slf b/libraries/render-utils/src/surfaceGeometry_makeCurvature.slf index f896cb657d..6c19982c2c 100644 --- a/libraries/render-utils/src/surfaceGeometry_makeCurvature.slf +++ b/libraries/render-utils/src/surfaceGeometry_makeCurvature.slf @@ -112,6 +112,14 @@ void main(void) { // The position of the pixel fragment in Eye space then in world space vec3 eyePos = evalEyePositionFromZeye(stereoSide.x, Zeye, texcoordPos); + vec3 worldPos = (frameTransform._viewInverse * vec4(eyePos, 1.0)).xyz; + + if (texcoordPos.y > 0.5) { + outFragColor = vec4(fract(10.0 * worldPos.xyz), 1.0); + } else { + outFragColor = vec4(fract(10.0 * eyePos.xyz), 1.0); + } + // return; // Calculate the perspective scale. // Clamp to 0.5 @@ -142,14 +150,14 @@ void main(void) { vec4 py = vec4(eyePos + ay, 0.0); vec4 pz = vec4(eyePos + az, 0.0); - /* + if (texcoordPos.y > 0.5) { outFragColor = vec4(fract(px.xyz), 1.0); } else { outFragColor = vec4(fract(eyePos.xyz), 1.0); } - return; - */ + // return; + /* IN case the axis end point goes behind mid way near plane, this shouldn't happen if (px.z >= -nearPlaneScale) { @@ -165,11 +173,13 @@ void main(void) { // Project px, py pz to homogeneous clip space - mat4 viewProj = getProjection(stereoSide.x); + // mat4 viewProj = getProjection(stereoSide.x); + mat4 viewProj = getProjectionMono(); px = viewProj * px; py = viewProj * py; pz = viewProj * pz; + // then to normalized clip space px.xy /= px.w; py.xy /= py.w; @@ -177,20 +187,37 @@ void main(void) { vec2 nclipPos = (texcoordPos - 0.5) * 2.0; -/* + + //vec4 clipPos = frameTransform._projection[stereoSide.x] * vec4(eyePos, 1.0); + vec4 clipPos = getProjectionMono() * vec4(eyePos, 1.0); + nclipPos = clipPos.xy / clipPos.w; + if (texcoordPos.y > 0.5) { - outFragColor = vec4(px.xy * 0.5 + 0.5, 0.0, 1.0); + // outFragColor = vec4(fract(10.0 * worldPos.xyz), 1.0); + outFragColor = vec4(fract(10.0 * (nclipPos)), 0.0, 1.0); + } else { - outFragColor = vec4(nclipPos * 0.5 + 0.5, 0.0, 1.0); + outFragColor = vec4(fract(10.0 * (clipPos.xy / clipPos.w)), 0.0, 1.0); + // outFragColor = vec4(nclipPos * 0.5 + 0.5, 0.0, 1.0); } - return; -*/ + //return; + float pixPerspectiveScaleInv = 1.0 / (perspectiveScale); px.xy = (px.xy - nclipPos) * pixPerspectiveScaleInv; py.xy = (py.xy - nclipPos) * pixPerspectiveScaleInv; pz.xy = (pz.xy - nclipPos) * pixPerspectiveScaleInv; + if (texcoordPos.y > 0.5) { + // outFragColor = vec4(fract(10.0 * worldPos.xyz), 1.0); + outFragColor = vec4(fract(10.0 * (px.xy)), 0.0, 1.0); + + } else { + outFragColor = vec4(fract(10.0 * (py.xy)), 0.0, 1.0); + // outFragColor = vec4(nclipPos * 0.5 + 0.5, 0.0, 1.0); + } + // return; + // Calculate dF/dx, dF/dy and dF/dz using chain rule vec4 dFdx = dFdu * px.x + dFdv * px.y; vec4 dFdy = dFdu * py.x + dFdv * py.y; diff --git a/libraries/render/src/render/BlurTask.h b/libraries/render/src/render/BlurTask.h index b0a3e14e57..6a0cd55a95 100644 --- a/libraries/render/src/render/BlurTask.h +++ b/libraries/render/src/render/BlurTask.h @@ -79,7 +79,7 @@ public: BlurGaussianConfig() : Job::Config(true) {} - float filterScale{ 1.2f }; + float filterScale{ 0.2f }; signals : void dirty(); diff --git a/libraries/render/src/render/BlurTask.slh b/libraries/render/src/render/BlurTask.slh index ece1bdf202..dd1a229599 100644 --- a/libraries/render/src/render/BlurTask.slh +++ b/libraries/render/src/render/BlurTask.slh @@ -99,7 +99,7 @@ vec4 pixelShaderGaussianDepthAware(vec2 texcoord, vec2 direction, vec2 pixelStep float filterScale = getFilterScale(); float scale = distanceToProjectionWindow / sampleDepth; - vec2 finalStep = filterScale * scale * direction * pixelStep; // *1000.0; + vec2 finalStep = filterScale * scale * direction * pixelStep; // Accumulate the center sample vec4 srcBlurred = gaussianDistributionCurve[0] * sampleCenter; @@ -112,7 +112,7 @@ vec4 pixelShaderGaussianDepthAware(vec2 texcoord, vec2 direction, vec2 pixelStep // If the difference in depth is huge, we lerp color back. - float s = clamp(/*depthThreshold */12.0 * distanceToProjectionWindow * filterScale * abs(srcDepth - sampleDepth), 0.0, 1.0); + float s = clamp(depthThreshold * distanceToProjectionWindow * filterScale * abs(srcDepth - sampleDepth), 0.0, 1.0); // float s = clamp(depthThreshold * distanceToProjectionWindow * filterScale * abs(srcDepth - sampleDepth), 0.0, 1.0); srcSample = mix(srcSample, sampleCenter, s); diff --git a/scripts/developer/utilities/render/debugDeferredLighting.js b/scripts/developer/utilities/render/debugDeferredLighting.js index f2fab61717..9d48845ec9 100644 --- a/scripts/developer/utilities/render/debugDeferredLighting.js +++ b/scripts/developer/utilities/render/debugDeferredLighting.js @@ -13,8 +13,8 @@ var qml = Script.resolvePath('deferredLighting.qml'); var window = new OverlayWindow({ title: 'Deferred Lighting Pass', source: qml, - width: 400, height: 400, + width: 400, height: 350, }); -window.setPosition(250, 750); +window.setPosition(250, 800); window.closed.connect(function() { Script.stop(); }); diff --git a/scripts/developer/utilities/render/debugSurfaceGeometryPass.js b/scripts/developer/utilities/render/debugSurfaceGeometryPass.js index fed9ce4ef3..b28bb5269e 100644 --- a/scripts/developer/utilities/render/debugSurfaceGeometryPass.js +++ b/scripts/developer/utilities/render/debugSurfaceGeometryPass.js @@ -13,8 +13,8 @@ var qml = Script.resolvePath('surfaceGeometryPass.qml'); var window = new OverlayWindow({ title: 'Surface Geometry Pass', source: qml, - width: 400, height: 400, + width: 400, height: 300, }); -window.setPosition(250, 500); +window.setPosition(250, 400); window.closed.connect(function() { Script.stop(); }); diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index ec5fe07a7e..e82f142763 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -40,6 +40,16 @@ Column { checked: Render.getConfig("RenderDeferred").showScatteringBRDF onCheckedChanged: { Render.getConfig("RenderDeferred").showScatteringBRDF = checked } } + CheckBox { + text: "Show Curvature" + checked: Render.getConfig("RenderDeferred").showCurvature + onCheckedChanged: { Render.getConfig("RenderDeferred").showCurvature = checked } + } + CheckBox { + text: "Show Diffused Normal" + checked: Render.getConfig("RenderDeferred").showDiffusedNormal + onCheckedChanged: { Render.getConfig("RenderDeferred").showDiffusedNormal = checked } + } Repeater { model: [ "Scattering Bent Red:RenderDeferred:bentRed:2.0", "Scattering Bent Green:RenderDeferred:bentGreen:2.0",