From 6968753783c8ad691982d6f3c0893a35dc4d95c4 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Tue, 19 Dec 2017 17:40:34 +0100 Subject: [PATCH 01/40] Added G factor in PBR shading and removed evalPBRShadingGloss --- libraries/render-utils/src/LightingModel.slh | 92 +++++++++----------- 1 file changed, 39 insertions(+), 53 deletions(-) diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index 521c4894dc..64e819cf38 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -121,86 +121,72 @@ float fresnelSchlickScalar(float fresnelScalar, vec3 lightDir, vec3 halfDir) { return (exponential) + fresnelScalar * (1.0 - exponential); } -float specularDistribution(float roughness, vec3 normal, vec3 halfDir) { - float ndoth = clamp(dot(halfDir, normal), 0.0, 1.0); -// float gloss2 = pow(0.001 + roughness, 4); - float gloss2 = (0.001 + roughness); - gloss2 *= gloss2; // pow 2 - gloss2 *= gloss2; // pow 4 - float denom = (ndoth * ndoth*(gloss2 - 1.0) + 1.0); - float power = gloss2 / (3.14159 * denom * denom); +float specularDistribution(float roughness, vec3 normal, vec3 halfDir, vec3 eyeDir, float ndotl) { + // See https://www.khronos.org/assets/uploads/developers/library/2017-web3d/glTF-2.0-Launch_Jun17.pdf + // for details of equations, especially page 20 + float ndoth = dot(halfDir, normal); + float ndotv = dot(eyeDir, normal); + vec3 nd = clamp(vec3(ndoth, ndotv, ndotl), vec3(0.0), vec3(1.0)); + vec3 nd2 = nd * nd; + float roughness2 = (0.001 + roughness*0.999); + roughness2 *= roughness2; // pow 2 + float roughness4 = roughness2; + roughness4 *= roughness4; // pow 4 + float denom = (nd2.x * (roughness2 - 1.0) + 1.0); + denom *= denom; + // Add geometric factors G1(n,l) and G1(n,v) + float oneMinusRoughness4 = 1.0-roughness4; + vec2 invG = nd.yz + sqrt(vec2(roughness4)+nd2.yz*oneMinusRoughness4); + denom *= invG.x * invG.y; + // Don't divide by PI as diffuse isn't either. The real PBR formula normalizes + // by PI on both but if we decide to not do it, it is just as if we + // multiplied all our lights by PI + //denom *= 3.1415926; + float power = roughness4 / denom; return power; } -float specularDistributionGloss(float gloss2, vec3 normal, vec3 halfDir) { - float ndoth = clamp(dot(halfDir, normal), 0.0, 1.0); -// float gloss2 = pow(0.001 + roughness, 4); - float denom = (ndoth * ndoth*(gloss2 - 1.0) + 1.0); - float power = gloss2 / (3.14159 * denom * denom); - return power; -} - + // Frag Shading returns the diffuse amount as W and the specular rgb as xyz vec4 evalPBRShading(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float metallic, vec3 fresnel, float roughness) { - // Diffuse Lighting - float diffuse = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + // Incident angle attenuation + float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); // Specular Lighting vec3 halfDir = normalize(fragEyeDir + fragLightDir); vec3 fresnelColor = fresnelSchlickColor(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir); - vec3 specular = fresnelColor * power * diffuse; + float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + vec3 specular = fresnelColor * power * angleAttenuation; - return vec4(specular, (1.0 - metallic) * diffuse * (1.0 - fresnelColor.x)); + return vec4(specular, (1.0 - metallic) * angleAttenuation * (1.0 - fresnelColor.x)); } // Frag Shading returns the diffuse amount as W and the specular rgb as xyz vec4 evalPBRShadingDielectric(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float roughness, float fresnel) { - // Diffuse Lighting - float diffuse = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + // Incident angle attenuation + float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); // Specular Lighting vec3 halfDir = normalize(fragEyeDir + fragLightDir); float fresnelScalar = fresnelSchlickScalar(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir); - vec3 specular = vec3(fresnelScalar) * power * diffuse; + float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + vec3 specular = vec3(fresnelScalar) * power * angleAttenuation; - return vec4(specular, diffuse * (1.0 - fresnelScalar)); + return vec4(specular, angleAttenuation * (1.0 - fresnelScalar)); } vec4 evalPBRShadingMetallic(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float roughness, vec3 fresnel) { - // Diffuse Lighting - float diffuse = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + // Incident angle attenuation + float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); // Specular Lighting vec3 halfDir = normalize(fragEyeDir + fragLightDir); vec3 fresnelColor = fresnelSchlickColor(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir); - vec3 specular = fresnelColor * power * diffuse; + float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + vec3 specular = fresnelColor * power * angleAttenuation; return vec4(specular, 0.f); } -// Frag Shading returns the diffuse amount as W and the specular rgb as xyz -vec4 evalPBRShadingGloss(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float metallic, vec3 fresnel, float gloss2) { - // Diffuse Lighting - float diffuse = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); - - // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - vec3 fresnelColor = fresnelSchlickColor(fresnel, fragLightDir, halfDir); - float power = specularDistributionGloss(gloss2, fragNormal, halfDir); - vec3 specular = fresnelColor * power * diffuse; - - return vec4(specular, (1.0 - metallic) * diffuse * (1.0 - fresnelColor.x)); -} - <@endfunc@> @@ -244,7 +230,7 @@ void evalFragShading(out vec3 diffuse, out vec3 specular, diffuse *= specularBrdf.y; specular = vec3(specularBrdf.x); } else { - vec4 shading = evalPBRShadingGloss(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, roughness); + vec4 shading = evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, roughness); diffuse = vec3(shading.w); specular = shading.xyz; } @@ -274,7 +260,7 @@ void evalFragShadingGloss(out vec3 diffuse, out vec3 specular, vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float metallic, vec3 fresnel, float gloss, vec3 albedo ) { - vec4 shading = evalPBRShadingGloss(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, gloss); + vec4 shading = evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, gloss); diffuse = vec3(shading.w); diffuse *= mix(vec3(1.0), albedo, isAlbedoEnabled()); specular = shading.xyz; From 0e666ce671c024b2bfc6b2332c7e9d710b72535d Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Wed, 20 Dec 2017 09:34:53 +0100 Subject: [PATCH 02/40] Metallic value is now continuous and materials can be linearly blended between pure dielectric and pure metal --- .../render-utils/src/DeferredBufferRead.slh | 23 +++++++------------ libraries/render-utils/src/LightingModel.slh | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/libraries/render-utils/src/DeferredBufferRead.slh b/libraries/render-utils/src/DeferredBufferRead.slh index fbca241bb9..5667f63d13 100644 --- a/libraries/render-utils/src/DeferredBufferRead.slh +++ b/libraries/render-utils/src/DeferredBufferRead.slh @@ -46,6 +46,12 @@ struct DeferredFragment { float depthVal; }; +vec3 getFresnelF0(float metallic, vec3 metalF0) { + // Enable continuous metallness value by lerping between dielectric + // and metal fresnel F0 value based on the "metallic" parameter + return mix(vec3(0.03), metalF0, metallic); +} + DeferredFragment unpackDeferredFragmentNoPosition(vec2 texcoord) { vec4 normalVal; vec4 diffuseVal; @@ -73,13 +79,7 @@ DeferredFragment unpackDeferredFragmentNoPosition(vec2 texcoord) { frag.scattering = specularVal.x; } - if (frag.metallic <= 0.5) { - frag.metallic = 0.0; - frag.fresnel = vec3(0.03); // Default Di-electric fresnel value - } else { - frag.fresnel = vec3(diffuseVal.xyz); - frag.metallic = 1.0; - } + frag.fresnel = getFresnelF0(frag.metallic, diffuseVal.xyz); return frag; } @@ -106,14 +106,7 @@ DeferredFragment unpackDeferredFragmentNoPositionNoAmbient(vec2 texcoord) { //frag.emissive = specularVal.xyz; frag.obscurance = 1.0; - - if (frag.metallic <= 0.5) { - frag.metallic = 0.0; - frag.fresnel = vec3(0.03); // Default Di-electric fresnel value - } else { - frag.fresnel = vec3(diffuseVal.xyz); - frag.metallic = 1.0; - } + frag.fresnel = getFresnelF0(frag.metallic, diffuseVal.xyz); return frag; } diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index 64e819cf38..d77e19f13a 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -128,7 +128,7 @@ float specularDistribution(float roughness, vec3 normal, vec3 halfDir, vec3 eyeD float ndotv = dot(eyeDir, normal); vec3 nd = clamp(vec3(ndoth, ndotv, ndotl), vec3(0.0), vec3(1.0)); vec3 nd2 = nd * nd; - float roughness2 = (0.001 + roughness*0.999); + float roughness2 = mix(0.001, 1.0, roughness); roughness2 *= roughness2; // pow 2 float roughness4 = roughness2; roughness4 *= roughness4; // pow 4 From e8b88cd3f845dcd9ce5624f406ad6058b69c9564 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Wed, 20 Dec 2017 11:14:07 +0100 Subject: [PATCH 03/40] Specular lighting comming from ambient sphere map is now multiplied by PI to be at the same level as normal light specular --- libraries/render-utils/src/LightAmbient.slh | 29 ++++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index 5f74b46d3e..f3f1411394 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -22,8 +22,10 @@ vec4 evalSkyboxLight(vec3 direction, float lod) { <@func declareEvalAmbientSpecularIrradiance(supportAmbientSphere, supportAmbientMap, supportIfAmbientMapElseAmbientSphere)@> -vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, float gloss) { - return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * pow(1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0), 5.0); +vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, float gloss) { + float f = pow(1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0), 5.0); + return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * f; +// return mix(fresnelColor, vec3(1.0), f); } <@if supportAmbientMap@> @@ -31,7 +33,7 @@ vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, float <@endif@> vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 fragNormal, float roughness) { - vec3 direction = -reflect(fragEyeDir, fragNormal); + vec3 lightDir = -reflect(fragEyeDir, fragNormal); vec3 specularLight; <@if supportIfAmbientMapElseAmbientSphere@> if (getLightHasAmbientMap(ambient)) @@ -40,7 +42,13 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f { float levels = getLightAmbientMapNumMips(ambient); float lod = min(((roughness)* levels), levels); - specularLight = evalSkyboxLight(direction, lod).xyz; + specularLight = evalSkyboxLight(lightDir, lod).xyz; + // We multiply specular by Pi to match specular / diffuse normalization in + // LightingModel.slh where diffuse and specular arent divided by Pi (when they should, rigourously + // speaking, based on physical equations). The spherical harmonics evaluation, on + // the other hand, seems to be Pi times stronger than usual. So all in all, everything + // should be at the right level now. + specularLight *= 3.1415926; } <@endif@> <@if supportIfAmbientMapElseAmbientSphere@> @@ -48,11 +56,11 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f <@endif@> <@if supportAmbientSphere@> { - specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), direction).xyz; + specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lightDir).xyz; } <@endif@> - return specularLight; + return specularLight; } <@endfunc@> @@ -67,14 +75,14 @@ float curvatureAO(in float k) { <@endif@> void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambient, vec3 eyeDir, vec3 normal, - float roughness, float metallic, vec3 fresnel, vec3 albedo, float obscurance + float roughness, float metallic, vec3 fresnelF0, vec3 albedo, float obscurance <@if supportScattering@> , float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature <@endif@> ) { // Fresnel - vec3 ambientFresnel = fresnelSchlickAmbient(fresnel, eyeDir, normal, 1.0 - roughness); + vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, eyeDir, normal, 1.0 - roughness); // Diffuse from ambient diffuse = (1.0 - metallic) * (vec3(1.0) - ambientFresnel) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), normal).xyz; @@ -107,8 +115,9 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie diffuse *= albedo; } - diffuse *= lightEnergy * isDiffuseEnabled() * isAmbientEnabled(); - specular *= lightEnergy * isSpecularEnabled() * isAmbientEnabled(); + lightEnergy *= isAmbientEnabled(); + diffuse *= lightEnergy * isDiffuseEnabled(); + specular *= lightEnergy * isSpecularEnabled(); } <@endfunc@> From 053bd2ba9826a13311219e30cb3ede9214783310 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Thu, 21 Dec 2017 17:41:36 +0100 Subject: [PATCH 04/40] Created SurfaceData structure to centralize computation of frequently used shader temporary values --- .../render-utils/src/DeferredBufferRead.slh | 3 + .../render-utils/src/DeferredGlobalLight.slh | 24 ++- .../render-utils/src/ForwardGlobalLight.slh | 18 +- libraries/render-utils/src/LightAmbient.slh | 25 +-- .../render-utils/src/LightDirectional.slh | 11 +- libraries/render-utils/src/LightPoint.slh | 11 +- libraries/render-utils/src/LightSpot.slh | 10 +- libraries/render-utils/src/LightingModel.slh | 166 +++++++++++------- .../render-utils/src/SubsurfaceScattering.slh | 32 ---- .../render-utils/src/local_lights_shading.slf | 17 +- .../render-utils/src/model_translucent.slf | 8 +- .../src/model_translucent_fade.slf | 8 +- libraries/render-utils/src/overlay3D.slf | 4 +- .../src/overlay3D_translucent.slf | 4 +- 14 files changed, 180 insertions(+), 161 deletions(-) diff --git a/libraries/render-utils/src/DeferredBufferRead.slh b/libraries/render-utils/src/DeferredBufferRead.slh index 5667f63d13..3cbed3fcef 100644 --- a/libraries/render-utils/src/DeferredBufferRead.slh +++ b/libraries/render-utils/src/DeferredBufferRead.slh @@ -46,11 +46,14 @@ struct DeferredFragment { float depthVal; }; +<@if not GETFRESNEL0@> +<@def GETFRESNEL0@> vec3 getFresnelF0(float metallic, vec3 metalF0) { // Enable continuous metallness value by lerping between dielectric // and metal fresnel F0 value based on the "metallic" parameter return mix(vec3(0.03), metalF0, metallic); } +<@endif@> DeferredFragment unpackDeferredFragmentNoPosition(vec2 texcoord) { vec4 normalVal; diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index de2d41be6b..ad4a9a3006 100644 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -65,10 +65,12 @@ vec3 albedo, vec3 fresnel, float metallic, float roughness <$prepareGlobalLight($supportScattering$)$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); @@ -79,7 +81,7 @@ vec3 albedo, vec3 fresnel, float metallic, float roughness // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); @@ -110,10 +112,12 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu ) { <$prepareGlobalLight($supportScattering$)$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> @@ -123,7 +127,7 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> @@ -174,19 +178,21 @@ vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscur vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec3 fresnel, float metallic, vec3 emissive, float roughness, float opacity) { <$prepareGlobalLight()$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + color += emissive * isEmissiveEnabled(); // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance); + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation); + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; color += directionalSpecular / opacity; @@ -199,19 +205,21 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze( { <$prepareGlobalLight()$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + color += emissive * isEmissiveEnabled(); // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance); + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation); + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; color += directionalSpecular / opacity; diff --git a/libraries/render-utils/src/ForwardGlobalLight.slh b/libraries/render-utils/src/ForwardGlobalLight.slh index aba0498ef5..3f77f85b51 100644 --- a/libraries/render-utils/src/ForwardGlobalLight.slh +++ b/libraries/render-utils/src/ForwardGlobalLight.slh @@ -65,10 +65,12 @@ vec3 albedo, vec3 fresnel, float metallic, float roughness <$prepareGlobalLight($supportScattering$)$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); @@ -79,7 +81,7 @@ vec3 albedo, vec3 fresnel, float metallic, float roughness // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); @@ -109,10 +111,12 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu ) { <$prepareGlobalLight($supportScattering$)$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> @@ -124,7 +128,7 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> @@ -173,19 +177,21 @@ vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscur vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec3 fresnel, float metallic, vec3 emissive, float roughness, float opacity) { <$prepareGlobalLight()$> + SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir); + color += emissive * isEmissiveEnabled(); // Ambient vec3 ambientDiffuse; vec3 ambientSpecular; - evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, obscurance); + evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surface, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation); + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; color += directionalSpecular / opacity; diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index f3f1411394..e466702a34 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -22,8 +22,9 @@ vec4 evalSkyboxLight(vec3 direction, float lod) { <@func declareEvalAmbientSpecularIrradiance(supportAmbientSphere, supportAmbientMap, supportIfAmbientMapElseAmbientSphere)@> -vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, float gloss) { - float f = pow(1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0), 5.0); +vec3 fresnelSchlickAmbient(vec3 fresnelColor, SurfaceData surface) { + float gloss = 1.0 - surface.roughness; + float f = pow(1.0 - surface.ldoth, 5.0); return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * f; // return mix(fresnelColor, vec3(1.0), f); } @@ -32,8 +33,8 @@ vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, floa <$declareSkyboxMap()$> <@endif@> -vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 fragNormal, float roughness) { - vec3 lightDir = -reflect(fragEyeDir, fragNormal); +vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { + vec3 lightDir = -reflect(surface.eyeDir, surface.normal); vec3 specularLight; <@if supportIfAmbientMapElseAmbientSphere@> if (getLightHasAmbientMap(ambient)) @@ -41,8 +42,8 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f <@if supportAmbientMap@> { float levels = getLightAmbientMapNumMips(ambient); - float lod = min(((roughness)* levels), levels); - specularLight = evalSkyboxLight(lightDir, lod).xyz; + float lod = min(((surface.roughness)* levels), levels); + specularLight = evalSkyboxLight(surface.lightDir, lod).xyz; // We multiply specular by Pi to match specular / diffuse normalization in // LightingModel.slh where diffuse and specular arent divided by Pi (when they should, rigourously // speaking, based on physical equations). The spherical harmonics evaluation, on @@ -56,7 +57,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f <@endif@> <@if supportAmbientSphere@> { - specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lightDir).xyz; + specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), surface.lightDir).xyz; } <@endif@> @@ -74,21 +75,21 @@ float curvatureAO(in float k) { } <@endif@> -void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambient, vec3 eyeDir, vec3 normal, - float roughness, float metallic, vec3 fresnelF0, vec3 albedo, float obscurance +void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambient, SurfaceData surface, + float metallic, vec3 fresnelF0, vec3 albedo, float obscurance <@if supportScattering@> , float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature <@endif@> ) { // Fresnel - vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, eyeDir, normal, 1.0 - roughness); + vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, surface); // Diffuse from ambient - diffuse = (1.0 - metallic) * (vec3(1.0) - ambientFresnel) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), normal).xyz; + diffuse = (1.0 - metallic) * (vec3(1.0) - ambientFresnel) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), surface.normal).xyz; // Specular highlight from ambient - specular = evalAmbientSpecularIrradiance(ambient, eyeDir, normal, roughness) * ambientFresnel; + specular = evalAmbientSpecularIrradiance(ambient, surface) * ambientFresnel; <@if supportScattering@> if (scattering * isScatteringEnabled() > 0.0) { diff --git a/libraries/render-utils/src/LightDirectional.slh b/libraries/render-utils/src/LightDirectional.slh index 749709c600..b6e1720a2c 100644 --- a/libraries/render-utils/src/LightDirectional.slh +++ b/libraries/render-utils/src/LightDirectional.slh @@ -12,7 +12,7 @@ <@func declareLightingDirectional(supportScattering)@> void evalLightingDirectional(out vec3 diffuse, out vec3 specular, vec3 lightDir, vec3 lightIrradiance, - vec3 eyeDir, vec3 normal, float roughness, + SurfaceData surface, float metallic, vec3 fresnel, vec3 albedo, float shadow <@if supportScattering@> , float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature @@ -22,14 +22,17 @@ void evalLightingDirectional(out vec3 diffuse, out vec3 specular, vec3 lightDir, // Attenuation vec3 lightEnergy = shadow * lightIrradiance; - evalFragShading(diffuse, specular, normal, -lightDir, eyeDir, metallic, fresnel, roughness, albedo + updateSurfaceDataWithLight(surface, -lightDir); + + evalFragShading(diffuse, specular, metallic, fresnel, surface, albedo <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); - diffuse *= lightEnergy * isDiffuseEnabled() * isDirectionalEnabled(); - specular *= lightEnergy * isSpecularEnabled() * isDirectionalEnabled(); + lightEnergy *= isDirectionalEnabled(); + diffuse *= lightEnergy * isDiffuseEnabled(); + specular *= lightEnergy * isSpecularEnabled(); } <@endfunc@> diff --git a/libraries/render-utils/src/LightPoint.slh b/libraries/render-utils/src/LightPoint.slh index 7e389e11f6..91a1260fcc 100644 --- a/libraries/render-utils/src/LightPoint.slh +++ b/libraries/render-utils/src/LightPoint.slh @@ -12,7 +12,7 @@ <@func declareLightingPoint(supportScattering)@> void evalLightingPoint(out vec3 diffuse, out vec3 specular, Light light, - vec4 fragLightDirLen, vec3 fragEyeDir, vec3 normal, float roughness, + vec4 fragLightDirLen, SurfaceData surface, float metallic, vec3 fresnel, vec3 albedo, float shadow <@if supportScattering@> , float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature @@ -23,19 +23,22 @@ void evalLightingPoint(out vec3 diffuse, out vec3 specular, Light light, float fragLightDistance = fragLightDirLen.w; vec3 fragLightDir = fragLightDirLen.xyz; + updateSurfaceDataWithLight(surface, fragLightDir); + // Eval attenuation float radialAttenuation = lightIrradiance_evalLightAttenuation(light.irradiance, fragLightDistance); vec3 lightEnergy = radialAttenuation * shadow * getLightIrradiance(light); // Eval shading - evalFragShading(diffuse, specular, normal, fragLightDir, fragEyeDir, metallic, fresnel, roughness, albedo + evalFragShading(diffuse, specular, metallic, fresnel, surface, albedo <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); - diffuse *= lightEnergy * isDiffuseEnabled() * isPointEnabled(); - specular *= lightEnergy * isSpecularEnabled() * isPointEnabled(); + lightEnergy *= isPointEnabled(); + diffuse *= lightEnergy * isDiffuseEnabled(); + specular *= lightEnergy * isSpecularEnabled(); if (isShowLightContour() > 0.0) { // Show edge diff --git a/libraries/render-utils/src/LightSpot.slh b/libraries/render-utils/src/LightSpot.slh index 8627dae0eb..73c5bd9559 100644 --- a/libraries/render-utils/src/LightSpot.slh +++ b/libraries/render-utils/src/LightSpot.slh @@ -12,7 +12,7 @@ <@func declareLightingSpot(supportScattering)@> void evalLightingSpot(out vec3 diffuse, out vec3 specular, Light light, - vec4 fragLightDirLen, float cosSpotAngle, vec3 fragEyeDir, vec3 normal, float roughness, + vec4 fragLightDirLen, float cosSpotAngle, SurfaceData surface, float metallic, vec3 fresnel, vec3 albedo, float shadow <@if supportScattering@> , float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature @@ -23,6 +23,7 @@ void evalLightingSpot(out vec3 diffuse, out vec3 specular, Light light, float fragLightDistance = fragLightDirLen.w; vec3 fragLightDir = fragLightDirLen.xyz; + updateSurfaceDataWithLight(surface, fragLightDir); // Eval attenuation float radialAttenuation = lightIrradiance_evalLightAttenuation(light.irradiance, fragLightDistance); @@ -30,14 +31,15 @@ void evalLightingSpot(out vec3 diffuse, out vec3 specular, Light light, vec3 lightEnergy = angularAttenuation * radialAttenuation * shadow *getLightIrradiance(light); // Eval shading - evalFragShading(diffuse, specular, normal, fragLightDir, fragEyeDir, metallic, fresnel, roughness, albedo + evalFragShading(diffuse, specular, metallic, fresnel, surface, albedo <@if supportScattering@> ,scattering, midNormalCurvature, lowNormalCurvature <@endif@> ); - diffuse *= lightEnergy * isDiffuseEnabled() * isSpotEnabled(); - specular *= lightEnergy * isSpecularEnabled() * isSpotEnabled(); + lightEnergy *= isSpotEnabled(); + diffuse *= lightEnergy * isDiffuseEnabled(); + specular *= lightEnergy * isSpecularEnabled(); if (isShowLightContour() > 0.0) { // Show edges diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index d77e19f13a..27b5327b09 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -77,6 +77,30 @@ float isWireframeEnabled() { <@endfunc@> <$declareLightingModel()$> +struct SurfaceData { + vec3 normal; + vec3 eyeDir; + vec3 lightDir; + vec3 halfDir; + float roughness; + float roughness2; + float roughness4; + float ndotv; + float ndotl; + float ndoth; + float ldoth; + float smithInvG1NdotV; +}; + +<@if not GETFRESNEL0@> +<@def GETFRESNEL0@> +vec3 getFresnelF0(float metallic, vec3 metalF0) { + // Enable continuous metallness value by lerping between dielectric + // and metal fresnel F0 value based on the "metallic" parameter + return mix(vec3(0.03), metalF0, metallic); +} +<@endif@> + <@func declareBeckmannSpecular()@> uniform sampler2D scatteringSpecularBeckmann; @@ -85,17 +109,13 @@ float fetchSpecularBeckmann(float ndoth, float roughness) { return pow(2.0 * texture(scatteringSpecularBeckmann, vec2(ndoth, roughness)).r, 10.0); } -vec2 skinSpecular(vec3 N, vec3 L, vec3 V, float roughness, float intensity) { +vec2 skinSpecular(SurfaceData surface, float intensity) { vec2 result = vec2(0.0, 1.0); - float ndotl = dot(N, L); - if (ndotl > 0.0) { - vec3 h = L + V; - vec3 H = normalize(h); - float ndoth = dot(N, H); - float PH = fetchSpecularBeckmann(ndoth, roughness); - float F = fresnelSchlickScalar(0.028, H, V); - float frSpec = max(PH * F / dot(h, h), 0.0); - result.x = ndotl * intensity * frSpec; + if (surface.ndotl > 0.0) { + float PH = fetchSpecularBeckmann(surface.ndoth, surface.roughness); + float F = fresnelSchlickScalar(0.028, surface); + float frSpec = max(PH * F / dot(surface.halfDir, surface.halfDir), 0.0); + result.x = surface.ndotl * intensity * frSpec; result.y -= F; } @@ -105,83 +125,105 @@ vec2 skinSpecular(vec3 N, vec3 L, vec3 V, float roughness, float intensity) { <@func declareEvalPBRShading()@> -vec3 fresnelSchlickColor(vec3 fresnelColor, vec3 lightDir, vec3 halfDir) { - float base = 1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0); +float evalSmithInvG1(float roughness4, float ndotd) { + return ndotd + sqrt(roughness4+ndotd*ndotd*(1.0-roughness4)); +} + +SurfaceData initSurfaceData(float roughness, vec3 normal, vec3 eyeDir) { + SurfaceData surface; + surface.eyeDir = eyeDir; + surface.normal = normal; + surface.lightDir = vec3(0,0,0); + surface.halfDir = vec3(0,0,0); + surface.roughness = mix(0.001, 1.0, roughness); + surface.roughness2 = surface.roughness * surface.roughness; + surface.roughness4 = surface.roughness2 * surface.roughness2; + surface.ndotv = clamp(dot(normal, eyeDir), 0.0, 1.0); + surface.ndoth = 0.0; + surface.ndotl = 0.0; + surface.ldoth = 0.0; + surface.smithInvG1NdotV = evalSmithInvG1(surface.roughness4, surface.ndotv); + return surface; +} + +void updateSurfaceDataWithLight(inout SurfaceData surface, vec3 lightDir) { + surface.lightDir = lightDir; + surface.halfDir = normalize(surface.eyeDir + lightDir); + vec3 dots; + dots.x = dot(surface.normal, surface.halfDir); + dots.y = dot(surface.normal, surface.lightDir); + dots.z = dot(surface.halfDir, surface.lightDir); + dots = clamp(dots, vec3(0), vec3(1)); + surface.ndoth = dots.x; + surface.ndotl = dots.y; + surface.ldoth = dots.z; +} + +vec3 fresnelSchlickColor(vec3 fresnelColor, SurfaceData surface) { + float base = 1.0 - surface.ldoth; //float exponential = pow(base, 5.0); float base2 = base * base; float exponential = base * base2 * base2; return vec3(exponential) + fresnelColor * (1.0 - exponential); } -float fresnelSchlickScalar(float fresnelScalar, vec3 lightDir, vec3 halfDir) { - float base = 1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0); +float fresnelSchlickScalar(float fresnelScalar, SurfaceData surface) { + float base = 1.0 - surface.ldoth; //float exponential = pow(base, 5.0); float base2 = base * base; float exponential = base * base2 * base2; return (exponential) + fresnelScalar * (1.0 - exponential); } -float specularDistribution(float roughness, vec3 normal, vec3 halfDir, vec3 eyeDir, float ndotl) { +float specularDistribution(SurfaceData surface) { // See https://www.khronos.org/assets/uploads/developers/library/2017-web3d/glTF-2.0-Launch_Jun17.pdf // for details of equations, especially page 20 - float ndoth = dot(halfDir, normal); - float ndotv = dot(eyeDir, normal); - vec3 nd = clamp(vec3(ndoth, ndotv, ndotl), vec3(0.0), vec3(1.0)); - vec3 nd2 = nd * nd; - float roughness2 = mix(0.001, 1.0, roughness); - roughness2 *= roughness2; // pow 2 - float roughness4 = roughness2; - roughness4 *= roughness4; // pow 4 - float denom = (nd2.x * (roughness2 - 1.0) + 1.0); + float denom = (surface.ndoth*surface.ndoth * (surface.roughness2 - 1.0) + 1.0); denom *= denom; // Add geometric factors G1(n,l) and G1(n,v) - float oneMinusRoughness4 = 1.0-roughness4; - vec2 invG = nd.yz + sqrt(vec2(roughness4)+nd2.yz*oneMinusRoughness4); - denom *= invG.x * invG.y; + float smithInvG1NdotL = evalSmithInvG1(surface.roughness4, surface.ndotl); + denom *= surface.smithInvG1NdotV * smithInvG1NdotL; // Don't divide by PI as diffuse isn't either. The real PBR formula normalizes // by PI on both but if we decide to not do it, it is just as if we // multiplied all our lights by PI //denom *= 3.1415926; - float power = roughness4 / denom; + float power = surface.roughness4 / denom; return power; } // Frag Shading returns the diffuse amount as W and the specular rgb as xyz -vec4 evalPBRShading(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float metallic, vec3 fresnel, float roughness) { +vec4 evalPBRShading(float metallic, vec3 fresnel, SurfaceData surface) { // Incident angle attenuation - float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + float angleAttenuation = surface.ndotl; // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - vec3 fresnelColor = fresnelSchlickColor(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + vec3 fresnelColor = fresnelSchlickColor(fresnel, surface); + float power = specularDistribution(surface); vec3 specular = fresnelColor * power * angleAttenuation; return vec4(specular, (1.0 - metallic) * angleAttenuation * (1.0 - fresnelColor.x)); } // Frag Shading returns the diffuse amount as W and the specular rgb as xyz -vec4 evalPBRShadingDielectric(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float roughness, float fresnel) { +vec4 evalPBRShadingDielectric(SurfaceData surface, float fresnel) { // Incident angle attenuation - float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + float angleAttenuation = surface.ndotl; // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - float fresnelScalar = fresnelSchlickScalar(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + float fresnelScalar = fresnelSchlickScalar(fresnel, surface); + float power = specularDistribution(surface); vec3 specular = vec3(fresnelScalar) * power * angleAttenuation; return vec4(specular, angleAttenuation * (1.0 - fresnelScalar)); } -vec4 evalPBRShadingMetallic(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float roughness, vec3 fresnel) { +vec4 evalPBRShadingMetallic(SurfaceData surface, vec3 fresnel) { // Incident angle attenuation - float angleAttenuation = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + float angleAttenuation = surface.ndotl; // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - vec3 fresnelColor = fresnelSchlickColor(fresnel, fragLightDir, halfDir); - float power = specularDistribution(roughness, fragNormal, halfDir, fragEyeDir, angleAttenuation); + vec3 fresnelColor = fresnelSchlickColor(fresnel, surface); + float power = specularDistribution(surface); vec3 specular = fresnelColor * power * angleAttenuation; return vec4(specular, 0.f); @@ -193,15 +235,9 @@ vec4 evalPBRShadingMetallic(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, <$declareEvalPBRShading()$> -// Return xyz the specular/reflection component and w the diffuse component -//vec4 evalFragShading(vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, float metallic, vec3 fresnel, float roughness) { -// return evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, roughness); -//} - void evalFragShading(out vec3 diffuse, out vec3 specular, - vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, - float metallic, vec3 fresnel, float roughness, vec3 albedo) { - vec4 shading = evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, roughness); + float metallic, vec3 fresnel, SurfaceData surface, vec3 albedo) { + vec4 shading = evalPBRShading(metallic, fresnel, surface); diffuse = vec3(shading.w); if (isAlbedoEnabled() > 0.0) { diffuse *= albedo; @@ -215,22 +251,19 @@ void evalFragShading(out vec3 diffuse, out vec3 specular, void evalFragShading(out vec3 diffuse, out vec3 specular, - vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, - float metallic, vec3 fresnel, float roughness, vec3 albedo, + float metallic, vec3 fresnel, SurfaceData surface, vec3 albedo, float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature) { if (scattering * isScatteringEnabled() > 0.0) { - vec3 brdf = evalSkinBRDF(fragLightDir, fragNormal, midNormalCurvature.xyz, lowNormalCurvature.xyz, lowNormalCurvature.w); - float NdotL = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); - diffuse = mix(vec3(NdotL), brdf, scattering); + vec3 brdf = evalSkinBRDF(surface.lightDir, surface.normal, midNormalCurvature.xyz, lowNormalCurvature.xyz, lowNormalCurvature.w); + diffuse = mix(vec3(surface.ndotl), brdf, scattering); // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - vec2 specularBrdf = skinSpecular(fragNormal, fragLightDir, fragEyeDir, roughness, 1.0); + vec2 specularBrdf = skinSpecular(surface, 1.0); diffuse *= specularBrdf.y; specular = vec3(specularBrdf.x); } else { - vec4 shading = evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, roughness); + vec4 shading = evalPBRShading(metallic, fresnel, surface); diffuse = vec3(shading.w); specular = shading.xyz; } @@ -239,17 +272,15 @@ void evalFragShading(out vec3 diffuse, out vec3 specular, void evalFragShadingScattering(out vec3 diffuse, out vec3 specular, - vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, - float metallic, vec3 fresnel, float roughness, vec3 albedo + float metallic, vec3 fresnel, SurfaceData surface, vec3 albedo ,float scattering, vec4 midNormalCurvature, vec4 lowNormalCurvature ) { - vec3 brdf = evalSkinBRDF(fragLightDir, fragNormal, midNormalCurvature.xyz, lowNormalCurvature.xyz, lowNormalCurvature.w); - float NdotL = clamp(dot(fragNormal, fragLightDir), 0.0, 1.0); + vec3 brdf = evalSkinBRDF(surface.lightDir, surface.normal, midNormalCurvature.xyz, lowNormalCurvature.xyz, lowNormalCurvature.w); + float NdotL = surface.ndotl; diffuse = mix(vec3(NdotL), brdf, scattering); // Specular Lighting - vec3 halfDir = normalize(fragEyeDir + fragLightDir); - vec2 specularBrdf = skinSpecular(fragNormal, fragLightDir, fragEyeDir, roughness, 1.0); + vec2 specularBrdf = skinSpecular(surface, 1.0); diffuse *= specularBrdf.y; specular = vec3(specularBrdf.x); @@ -257,10 +288,9 @@ void evalFragShadingScattering(out vec3 diffuse, out vec3 specular, } void evalFragShadingGloss(out vec3 diffuse, out vec3 specular, - vec3 fragNormal, vec3 fragLightDir, vec3 fragEyeDir, - float metallic, vec3 fresnel, float gloss, vec3 albedo + float metallic, vec3 fresnel, SurfaceData surface, vec3 albedo ) { - vec4 shading = evalPBRShading(fragNormal, fragLightDir, fragEyeDir, metallic, fresnel, gloss); + vec4 shading = evalPBRShading(metallic, fresnel, surface); diffuse = vec3(shading.w); diffuse *= mix(vec3(1.0), albedo, isAlbedoEnabled()); specular = shading.xyz; diff --git a/libraries/render-utils/src/SubsurfaceScattering.slh b/libraries/render-utils/src/SubsurfaceScattering.slh index 201ec2291a..233dfd7a0c 100644 --- a/libraries/render-utils/src/SubsurfaceScattering.slh +++ b/libraries/render-utils/src/SubsurfaceScattering.slh @@ -63,38 +63,6 @@ vec3 scatter(float r) { <@endfunc@> -<@func declareSkinSpecularLighting()@> - -uniform sampler2D scatteringSpecularBeckmann; - -float fetchSpecularBeckmann(float ndoth, float roughness) { - return pow( 2.0 * texture(scatteringSpecularBeckmann, vec2(ndoth, roughness)).r, 10.0); -} - -float fresnelReflectance(vec3 H, vec3 V, float Fo) { - float base = 1.0 - dot(V, H); - float exponential = pow(base, 5.0); - return exponential + Fo * (1.0 - exponential); -} - -float skinSpecular(vec3 N, vec3 L, vec3 V, float roughness, float intensity) { - float result = 0.0; - float ndotl = dot(N, L); - if (ndotl > 0.0) { - vec3 h = L + V; - vec3 H = normalize(h); - float ndoth = dot(N, H); - float PH = fetchSpecularBeckmann(ndoth, roughness); - float F = fresnelReflectance(H, V, 0.028); - float frSpec = max(PH * F / dot(h, h), 0.0); - result = ndotl * intensity * frSpec; - } - - return result; -} - -<@endfunc@> - <@func declareSubsurfaceScatteringIntegrate(NumIntegrationSteps)@> diff --git a/libraries/render-utils/src/local_lights_shading.slf b/libraries/render-utils/src/local_lights_shading.slf index c6310cb079..a935a8cb89 100644 --- a/libraries/render-utils/src/local_lights_shading.slf +++ b/libraries/render-utils/src/local_lights_shading.slf @@ -84,9 +84,8 @@ void main(void) { // Frag to eye vec vec4 fragEyeVector = invViewMat * vec4(-frag.position.xyz, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - - // Compute the rougness into gloss2 once: - float fragGloss2 = pow(frag.roughness + 0.001, 4.0); + + SurfaceData surface = initSurfaceData(frag.roughness, frag.normal, fragEyeDir); bool withScattering = (frag.scattering * isScatteringEnabled() > 0.0); int numLightTouching = 0; @@ -119,16 +118,18 @@ void main(void) { float fragLightDistance = fragLightDirLen.w; vec3 fragLightDir = fragLightDirLen.xyz; + updateSurfaceDataWithLight(surface, fragLightDir); + // Eval attenuation float radialAttenuation = lightIrradiance_evalLightAttenuation(light.irradiance, fragLightDistance); vec3 lightEnergy = radialAttenuation * getLightIrradiance(light); // Eval shading if (withScattering) { - evalFragShadingScattering(diffuse, specular, frag.normal, fragLightDir, fragEyeDir, frag.metallic, frag.fresnel, frag.roughness, frag.albedo + evalFragShadingScattering(diffuse, specular, frag.metallic, frag.fresnel, surface, frag.albedo ,frag.scattering, midNormalCurvature, lowNormalCurvature ); } else { - evalFragShadingGloss(diffuse, specular, frag.normal, fragLightDir, fragEyeDir, frag.metallic, frag.fresnel, fragGloss2, frag.albedo); + evalFragShadingGloss(diffuse, specular, frag.metallic, frag.fresnel, surface, frag.albedo); } diffuse *= lightEnergy * isDiffuseEnabled(); @@ -173,6 +174,8 @@ void main(void) { float fragLightDistance = fragLightDirLen.w; vec3 fragLightDir = fragLightDirLen.xyz; + updateSurfaceDataWithLight(surface, fragLightDir); + // Eval attenuation float radialAttenuation = lightIrradiance_evalLightAttenuation(light.irradiance, fragLightDistance); float angularAttenuation = lightIrradiance_evalLightSpotAttenuation(light.irradiance, cosSpotAngle); @@ -180,10 +183,10 @@ void main(void) { // Eval shading if (withScattering) { - evalFragShadingScattering(diffuse, specular, frag.normal, fragLightDir, fragEyeDir, frag.metallic, frag.fresnel, frag.roughness, frag.albedo + evalFragShadingScattering(diffuse, specular, frag.metallic, frag.fresnel, surface, frag.albedo ,frag.scattering, midNormalCurvature, lowNormalCurvature ); } else { - evalFragShadingGloss(diffuse, specular, frag.normal, fragLightDir, fragEyeDir, frag.metallic, frag.fresnel, fragGloss2, frag.albedo); + evalFragShadingGloss(diffuse, specular, frag.metallic, frag.fresnel, surface, frag.albedo); } diffuse *= lightEnergy * isDiffuseEnabled(); diff --git a/libraries/render-utils/src/model_translucent.slf b/libraries/render-utils/src/model_translucent.slf index 38f162fdc3..7e64c5ab8b 100644 --- a/libraries/render-utils/src/model_translucent.slf +++ b/libraries/render-utils/src/model_translucent.slf @@ -50,13 +50,7 @@ void main(void) { <$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>; float metallic = getMaterialMetallic(mat); - vec3 fresnel = vec3(0.03); // Default Di-electric fresnel value - if (metallic <= 0.5) { - metallic = 0.0; - } else { - fresnel = albedo; - metallic = 1.0; - } + vec3 fresnel = getFresnelF0(metallic, albedo); vec3 emissive = getMaterialEmissive(mat); <$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>; diff --git a/libraries/render-utils/src/model_translucent_fade.slf b/libraries/render-utils/src/model_translucent_fade.slf index 9d5477304c..0d5a452fed 100644 --- a/libraries/render-utils/src/model_translucent_fade.slf +++ b/libraries/render-utils/src/model_translucent_fade.slf @@ -60,13 +60,7 @@ void main(void) { <$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>; float metallic = getMaterialMetallic(mat); - vec3 fresnel = vec3(0.03); // Default Di-electric fresnel value - if (metallic <= 0.5) { - metallic = 0.0; - } else { - fresnel = albedo; - metallic = 1.0; - } + vec3 fresnel = getFresnelF0(metallic, albedo); vec3 emissive = getMaterialEmissive(mat); <$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>; diff --git a/libraries/render-utils/src/overlay3D.slf b/libraries/render-utils/src/overlay3D.slf index 0cb3340845..b58dd5afac 100644 --- a/libraries/render-utils/src/overlay3D.slf +++ b/libraries/render-utils/src/overlay3D.slf @@ -40,12 +40,14 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a vec3 fragEyeDir; <$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$> + SurfaceData surface = initSurfaceData(roughness, normal, fragEyeDir); + vec3 color = opacity * albedo * getLightColor(light) * getLightAmbientIntensity(ambient); // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation); + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse * isDiffuseEnabled() * isDirectionalEnabled(); color += directionalSpecular * isSpecularEnabled() * isDirectionalEnabled(); diff --git a/libraries/render-utils/src/overlay3D_translucent.slf b/libraries/render-utils/src/overlay3D_translucent.slf index 9bdac2d21f..72bd0d740e 100644 --- a/libraries/render-utils/src/overlay3D_translucent.slf +++ b/libraries/render-utils/src/overlay3D_translucent.slf @@ -40,12 +40,14 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 a vec3 fragEyeDir; <$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$> + SurfaceData surface = initSurfaceData(roughness, normal, fragEyeDir); + vec3 color = opacity * albedo * getLightColor(light) * getLightAmbientIntensity(ambient); // Directional vec3 directionalDiffuse; vec3 directionalSpecular; - evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, fragEyeDir, fragNormal, roughness, metallic, fresnel, albedo, shadowAttenuation); + evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surface, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; color += directionalSpecular / opacity; From cb4d78ce5ce7d21638480973ac0d000accdfaedf Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Thu, 21 Dec 2017 18:47:18 +0100 Subject: [PATCH 05/40] Fixed bug in specular ambient --- libraries/render-utils/src/LightAmbient.slh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index e466702a34..1c13de3221 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -22,11 +22,9 @@ vec4 evalSkyboxLight(vec3 direction, float lod) { <@func declareEvalAmbientSpecularIrradiance(supportAmbientSphere, supportAmbientMap, supportIfAmbientMapElseAmbientSphere)@> -vec3 fresnelSchlickAmbient(vec3 fresnelColor, SurfaceData surface) { - float gloss = 1.0 - surface.roughness; - float f = pow(1.0 - surface.ldoth, 5.0); +vec3 fresnelSchlickAmbient(vec3 fresnelColor, float ndotd, float gloss) { + float f = pow(1.0 - ndotd, 5.0); return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * f; -// return mix(fresnelColor, vec3(1.0), f); } <@if supportAmbientMap@> @@ -43,7 +41,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { { float levels = getLightAmbientMapNumMips(ambient); float lod = min(((surface.roughness)* levels), levels); - specularLight = evalSkyboxLight(surface.lightDir, lod).xyz; + specularLight = evalSkyboxLight(lightDir, lod).xyz; // We multiply specular by Pi to match specular / diffuse normalization in // LightingModel.slh where diffuse and specular arent divided by Pi (when they should, rigourously // speaking, based on physical equations). The spherical harmonics evaluation, on @@ -57,7 +55,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { <@endif@> <@if supportAmbientSphere@> { - specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), surface.lightDir).xyz; + specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lightDir).xyz; } <@endif@> @@ -83,7 +81,7 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie ) { // Fresnel - vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, surface); + vec3 ambientFresnel = fresnelSchlickAmbient(fresnelF0, surface.ndotv, 1.0-surface.roughness); // Diffuse from ambient diffuse = (1.0 - metallic) * (vec3(1.0) - ambientFresnel) * sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), surface.normal).xyz; From a6d5e33ecaae18250e05c158d8b3d118a5c71adf Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Fri, 22 Dec 2017 10:39:45 +0100 Subject: [PATCH 06/40] Fixed levels between specular, diffuse, ambient specular, ambiend diffuse and background sky --- libraries/render-utils/src/LightAmbient.slh | 16 +++++++--------- libraries/render-utils/src/LightingModel.slh | 16 ++++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index 1c13de3221..8c6dbb85a2 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -22,9 +22,10 @@ vec4 evalSkyboxLight(vec3 direction, float lod) { <@func declareEvalAmbientSpecularIrradiance(supportAmbientSphere, supportAmbientMap, supportIfAmbientMapElseAmbientSphere)@> -vec3 fresnelSchlickAmbient(vec3 fresnelColor, float ndotd, float gloss) { +vec3 fresnelSchlickAmbient(vec3 fresnelColor, float ndotd, float gloss) { float f = pow(1.0 - ndotd, 5.0); return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * f; +// return fresnelColor + (vec3(1.0) - fresnelColor) * f; } <@if supportAmbientMap@> @@ -40,14 +41,10 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { <@if supportAmbientMap@> { float levels = getLightAmbientMapNumMips(ambient); - float lod = min(((surface.roughness)* levels), levels); + float m = 12.0 / (1.0+5.0*surface.roughness); + float lod = levels - m; + lod = max(lod, 0); specularLight = evalSkyboxLight(lightDir, lod).xyz; - // We multiply specular by Pi to match specular / diffuse normalization in - // LightingModel.slh where diffuse and specular arent divided by Pi (when they should, rigourously - // speaking, based on physical equations). The spherical harmonics evaluation, on - // the other hand, seems to be Pi times stronger than usual. So all in all, everything - // should be at the right level now. - specularLight *= 3.1415926; } <@endif@> <@if supportIfAmbientMapElseAmbientSphere@> @@ -56,6 +53,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { <@if supportAmbientSphere@> { specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lightDir).xyz; + specularLight /= 3.1415926; } <@endif@> @@ -99,7 +97,7 @@ void evalLightingAmbient(out vec3 diffuse, out vec3 specular, LightAmbient ambie // Diffuse from ambient diffuse = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lowNormalCurvature.xyz).xyz; - + diffuse /= 3.1415926; specular = vec3(0.0); } <@endif@> diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index 27b5327b09..8a6c03d423 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -183,10 +183,7 @@ float specularDistribution(SurfaceData surface) { // Add geometric factors G1(n,l) and G1(n,v) float smithInvG1NdotL = evalSmithInvG1(surface.roughness4, surface.ndotl); denom *= surface.smithInvG1NdotV * smithInvG1NdotL; - // Don't divide by PI as diffuse isn't either. The real PBR formula normalizes - // by PI on both but if we decide to not do it, it is just as if we - // multiplied all our lights by PI - //denom *= 3.1415926; + // Don't divide by PI as it will be done later float power = surface.roughness4 / denom; return power; } @@ -200,8 +197,11 @@ vec4 evalPBRShading(float metallic, vec3 fresnel, SurfaceData surface) { vec3 fresnelColor = fresnelSchlickColor(fresnel, surface); float power = specularDistribution(surface); vec3 specular = fresnelColor * power * angleAttenuation; + float diffuse = (1.0 - metallic) * angleAttenuation * (1.0 - fresnelColor.x); - return vec4(specular, (1.0 - metallic) * angleAttenuation * (1.0 - fresnelColor.x)); + specular /= 3.1415926; + diffuse /= 3.1415926; + return vec4(specular, diffuse); } // Frag Shading returns the diffuse amount as W and the specular rgb as xyz @@ -213,8 +213,11 @@ vec4 evalPBRShadingDielectric(SurfaceData surface, float fresnel) { float fresnelScalar = fresnelSchlickScalar(fresnel, surface); float power = specularDistribution(surface); vec3 specular = vec3(fresnelScalar) * power * angleAttenuation; + float diffuse = angleAttenuation * (1.0 - fresnelScalar); - return vec4(specular, angleAttenuation * (1.0 - fresnelScalar)); + specular /= 3.1415926; + diffuse /= 3.1415926; + return vec4(specular, diffuse); } vec4 evalPBRShadingMetallic(SurfaceData surface, vec3 fresnel) { @@ -226,6 +229,7 @@ vec4 evalPBRShadingMetallic(SurfaceData surface, vec3 fresnel) { float power = specularDistribution(surface); vec3 specular = fresnelColor * power * angleAttenuation; + specular /= 3.1415926; return vec4(specular, 0.f); } From 93ba9ad3b19c0e6fa90ff17cd736e4a939152930 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Tue, 26 Dec 2017 15:43:23 +0100 Subject: [PATCH 07/40] Adjusted roughness aspect on specular reflection of sky box to more closely match Unity's PBR look especially on high roughness values --- libraries/render-utils/src/LightAmbient.slh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index 8c6dbb85a2..409b8b0587 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -41,7 +41,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { <@if supportAmbientMap@> { float levels = getLightAmbientMapNumMips(ambient); - float m = 12.0 / (1.0+5.0*surface.roughness); + float m = 12.0 / (1.0+11.0*surface.roughness); float lod = levels - m; lod = max(lod, 0); specularLight = evalSkyboxLight(lightDir, lod).xyz; From dcfeed9b2cb99713c4d6adb982674d27409a9e43 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Wed, 27 Dec 2017 15:52:17 +0100 Subject: [PATCH 08/40] Switched to using getFresnelF0 function in overlay3D model shaders --- libraries/render-utils/src/overlay3D_model.slf | 8 +------- .../render-utils/src/overlay3D_model_translucent.slf | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/libraries/render-utils/src/overlay3D_model.slf b/libraries/render-utils/src/overlay3D_model.slf index bb0d84a513..ea61c2bb75 100644 --- a/libraries/render-utils/src/overlay3D_model.slf +++ b/libraries/render-utils/src/overlay3D_model.slf @@ -46,13 +46,7 @@ void main(void) { albedo *= _color; float metallic = getMaterialMetallic(mat); - vec3 fresnel = vec3(0.03); // Default Di-electric fresnel value - if (metallic <= 0.5) { - metallic = 0.0; - } else { - fresnel = albedo; - metallic = 1.0; - } + vec3 fresnel = getFresnelF0(metallic, albedo); float roughness = getMaterialRoughness(mat); <$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>; diff --git a/libraries/render-utils/src/overlay3D_model_translucent.slf b/libraries/render-utils/src/overlay3D_model_translucent.slf index b26e70f465..b6ae8eb75e 100644 --- a/libraries/render-utils/src/overlay3D_model_translucent.slf +++ b/libraries/render-utils/src/overlay3D_model_translucent.slf @@ -44,13 +44,7 @@ void main(void) { albedo *= _color; float metallic = getMaterialMetallic(mat); - vec3 fresnel = vec3(0.03); // Default Di-electric fresnel value - if (metallic <= 0.5) { - metallic = 0.0; - } else { - fresnel = albedo; - metallic = 1.0; - } + vec3 fresnel = getFresnelF0(metallic, albedo); float roughness = getMaterialRoughness(mat); <$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>; From c904302057ac5d827849963413854c532757ad23 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Mon, 8 Jan 2018 15:23:39 +0100 Subject: [PATCH 09/40] Added back multiplication of specular for point / directional / spot lighting by PI as Naty Hoffman recommends. Limited texture LOD of ambient map by LOD computed for filtering to prevent aliasing --- libraries/render-utils/src/LightAmbient.slh | 4 +++- libraries/render-utils/src/LightingModel.slh | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index 409b8b0587..3decdbcf7c 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -16,6 +16,9 @@ uniform samplerCube skyboxMap; vec4 evalSkyboxLight(vec3 direction, float lod) { // textureQueryLevels is not available until #430, so we require explicit lod // float mipmapLevel = lod * textureQueryLevels(skyboxMap); + float filterLod = textureQueryLod(skyboxMap, direction); + // Keep texture filtering LOD as limit to prevent aliasing on specular reflection + lod = max(lod, filterLod); return textureLod(skyboxMap, direction, lod); } <@endfunc@> @@ -53,7 +56,6 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, SurfaceData surface) { <@if supportAmbientSphere@> { specularLight = sphericalHarmonics_evalSphericalLight(getLightAmbientSphere(ambient), lightDir).xyz; - specularLight /= 3.1415926; } <@endif@> diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index 8a6c03d423..279a010cf4 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -199,8 +199,12 @@ vec4 evalPBRShading(float metallic, vec3 fresnel, SurfaceData surface) { vec3 specular = fresnelColor * power * angleAttenuation; float diffuse = (1.0 - metallic) * angleAttenuation * (1.0 - fresnelColor.x); - specular /= 3.1415926; diffuse /= 3.1415926; + // Diffuse is divided by PI but specular isn't because an infinitesimal volume light source + // has a multiplier of PI, says Naty Hoffman. + // (see http://blog.selfshadow.com/publications/s2013-shading-course/hoffman/s2013_pbs_physics_math_notes.pdf + // page 23 paragraph "Punctual light sources") + return vec4(specular, diffuse); } @@ -215,8 +219,11 @@ vec4 evalPBRShadingDielectric(SurfaceData surface, float fresnel) { vec3 specular = vec3(fresnelScalar) * power * angleAttenuation; float diffuse = angleAttenuation * (1.0 - fresnelScalar); - specular /= 3.1415926; diffuse /= 3.1415926; + // Diffuse is divided by PI but specular isn't because an infinitesimal volume light source + // has a multiplier of PI, says Naty Hoffman. + // (see http://blog.selfshadow.com/publications/s2013-shading-course/hoffman/s2013_pbs_physics_math_notes.pdf + // page 23 paragraph "Punctual light sources") return vec4(specular, diffuse); } @@ -229,7 +236,10 @@ vec4 evalPBRShadingMetallic(SurfaceData surface, vec3 fresnel) { float power = specularDistribution(surface); vec3 specular = fresnelColor * power * angleAttenuation; - specular /= 3.1415926; + // Specular isn't divided by PI because an infinitesimal volume light source + // has a multiplier of PI, says Naty Hoffman. + // (see http://blog.selfshadow.com/publications/s2013-shading-course/hoffman/s2013_pbs_physics_math_notes.pdf + // page 23 paragraph "Punctual light sources") return vec4(specular, 0.f); } From cfa20b6eb3e86ce72a1b37fd3b3409060740a1c5 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 8 Jan 2018 15:28:59 -0800 Subject: [PATCH 10/40] Oculus Touch: More accurate spin on thrown objects The internal computation of angular velocity was incorrect. Apparently, the ovrPoseStatef.AngularRotation is not in sensor frame but local to the controller rotation. (cherry picked from commit dd0e57026e123779784102658a264f6aaeb70f67) --- plugins/oculus/src/OculusHelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/oculus/src/OculusHelpers.cpp b/plugins/oculus/src/OculusHelpers.cpp index 3d06a4b223..4632c8ab76 100644 --- a/plugins/oculus/src/OculusHelpers.cpp +++ b/plugins/oculus/src/OculusHelpers.cpp @@ -262,7 +262,7 @@ controller::Pose ovrControllerPoseToHandPose( pose.translation = toGlm(handPose.ThePose.Position); pose.translation += rotation * translationOffset; pose.rotation = rotation * rotationOffset; - pose.angularVelocity = toGlm(handPose.AngularVelocity); + pose.angularVelocity = rotation * toGlm(handPose.AngularVelocity); pose.velocity = toGlm(handPose.LinearVelocity); pose.valid = true; return pose; From 319913e6afd462d7eb1cb9bbf4edd29c3d3e9edd Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Mon, 8 Jan 2018 20:37:07 -0700 Subject: [PATCH 11/40] Fix toolbar appears on HMD mode --- interface/src/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f3c41565f8..1cc1b6b15a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7357,6 +7357,7 @@ void Application::updateThreadPoolCount() const { } void Application::updateSystemTabletMode() { + if (!_settingsLoaded) return; qApp->setProperty(hifi::properties::HMD, isHMDMode()); if (isHMDMode()) { DependencyManager::get()->setToolbarMode(getHmdTabletBecomesToolbarSetting()); From 9a8141076235185b0d7239682bc0525cc0498b47 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Mon, 8 Jan 2018 20:51:15 -0700 Subject: [PATCH 12/40] refactor --- interface/src/Application.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1cc1b6b15a..6cabab6c01 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7357,12 +7357,13 @@ void Application::updateThreadPoolCount() const { } void Application::updateSystemTabletMode() { - if (!_settingsLoaded) return; - qApp->setProperty(hifi::properties::HMD, isHMDMode()); - if (isHMDMode()) { - DependencyManager::get()->setToolbarMode(getHmdTabletBecomesToolbarSetting()); - } else { - DependencyManager::get()->setToolbarMode(getDesktopTabletBecomesToolbarSetting()); + if (_settingsLoaded) { + qApp->setProperty(hifi::properties::HMD, isHMDMode()); + if (isHMDMode()) { + DependencyManager::get()->setToolbarMode(getHmdTabletBecomesToolbarSetting()); + } else { + DependencyManager::get()->setToolbarMode(getDesktopTabletBecomesToolbarSetting()); + } } } From 776a2e83734d5655d18b4da16877ce49134bf2a4 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 8 Jan 2018 17:18:16 -0800 Subject: [PATCH 13/40] Fix concurrent access crash in avatar mixer --- .../src/avatars/AvatarMixerClientData.h | 5 +++-- libraries/avatars/src/AvatarData.cpp | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixerClientData.h b/assignment-client/src/avatars/AvatarMixerClientData.h index acd9be0702..7a7210a0e8 100644 --- a/assignment-client/src/avatars/AvatarMixerClientData.h +++ b/assignment-client/src/avatars/AvatarMixerClientData.h @@ -116,8 +116,9 @@ public: void setLastOtherAvatarEncodeTime(const QUuid& otherAvatar, const uint64_t& time); QVector& getLastOtherAvatarSentJoints(QUuid otherAvatar) { - _lastOtherAvatarSentJoints[otherAvatar].resize(_avatar->getJointCount()); - return _lastOtherAvatarSentJoints[otherAvatar]; + auto& lastOtherAvatarSentJoints = _lastOtherAvatarSentJoints[otherAvatar]; + lastOtherAvatarSentJoints.resize(_avatar->getJointCount()); + return lastOtherAvatarSentJoints; } void queuePacket(QSharedPointer message, SharedNodePointer node); diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index f2053e29d7..94df5bf7f4 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -530,9 +530,13 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent destinationBuffer += numValidityBytes; // Move pointer past the validity bytes + // sentJointDataOut and lastSentJointData might be the same vector + // build sentJointDataOut locally and then swap it at the end. + QVector localSentJointDataOut; if (sentJointDataOut) { - sentJointDataOut->resize(_jointData.size()); // Make sure the destination is resized before using it + localSentJointDataOut.resize(numJoints); // Make sure the destination is resized before using it } + float minRotationDOT = !distanceAdjust ? AVATAR_MIN_ROTATION_DOT : getDistanceBasedMinRotationDOT(viewerPosition); for (int i = 0; i < _jointData.size(); i++) { @@ -552,8 +556,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent destinationBuffer += packOrientationQuatToSixBytes(destinationBuffer, data.rotation); if (sentJointDataOut) { - auto jointDataOut = *sentJointDataOut; - jointDataOut[i].rotation = data.rotation; + localSentJointDataOut[i].rotation = data.rotation; } } @@ -602,8 +605,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent packFloatVec3ToSignedTwoByteFixed(destinationBuffer, data.translation, TRANSLATION_COMPRESSION_RADIX); if (sentJointDataOut) { - auto jointDataOut = *sentJointDataOut; - jointDataOut[i].translation = data.translation; + localSentJointDataOut[i].translation = data.translation; } } @@ -646,6 +648,11 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent if (outboundDataRateOut) { outboundDataRateOut->jointDataRate.increment(numBytes); } + + if (sentJointDataOut) { + // Push new sent joint data to sentJointDataOut + sentJointDataOut->swap(localSentJointDataOut); + } } int avatarDataSize = destinationBuffer - startPosition; From 125eb9ce445132f7fcf6c3159b058953cf2af2b7 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 9 Jan 2018 14:31:57 -0800 Subject: [PATCH 14/40] add new tablet model and adjust screen offset --- .../meshes/tablet-with-home-button.fbx | Bin 196940 -> 198012 bytes .../controllers/controllerDispatcher.js | 8 ++++---- scripts/system/libraries/utils.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/meshes/tablet-with-home-button.fbx b/interface/resources/meshes/tablet-with-home-button.fbx index 70b8008bad32a7288bf3b2e9a3b33a982af8be79..37247022f6431306639156fa99def798cbef41e6 100644 GIT binary patch delta 18748 zcmZ{s2|QHa|Nj}4c8ZcLlQv3Gsfb~cB#B9qk1SJ3(qiAnGPhC@WpGJl8C$ku60)1D zV~I(2hOzJ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e zBH?|)0_Gx?{lcK6$TrBi{^$sjaH`0|eqpeDa64qaKiXzU__4^D0pX}N3kd5+!Tw?4 zs!`dugTJG$e$?Y1>h-dhk4KAEL-s)&%cBohL$-@3RzOyRuHRe%5qwMJ6{tM8H#({s z;w7S80TIM6sEAgnfdoKAE2BTvKujPZg9Y<7kT-I&S?u2ct6$*w2cR%D92y-p0@(|h z8~hEBP7(k>;z`kz5lEs)HR*TMGegnYqY!_Q@F55|+<6i5iCy432H7tscS9h>?_-0$ zo2#qSEw6iSuAWRbH>mi%K_eJT(b{=^*p$M9!L^`A4uxxZPh&QSgeb>ttz5s7t*e;Ka) zV_3Zh|78IFG5om`{s$xFAH(X6<}X&wzYWL#jO+iQE6RfitzL<%vt40*>(x)Pm|K{v z4xobbSII_y5fRyXMf)Ge)p^Xnj;q7qe;ikTSg#in68gO%$<)#P(f^FTI-UtmTFqDx zeOKl`jtBpW{@;$#kr0vXDr5gM;Ge-uaDx>DRD<$==k<5MzZ_R7fKO^=R4)JH`?m&v zhA6?k@ORLN{~7cz$3HM$fDfiTwWnhd^FE diff --git a/scripts/system/controllers/controllerDispatcher.js b/scripts/system/controllers/controllerDispatcher.js index 7f2cbe0aee..16f1d086b7 100644 --- a/scripts/system/controllers/controllerDispatcher.js +++ b/scripts/system/controllers/controllerDispatcher.js @@ -148,8 +148,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); this.setIgnorePointerItems = function() { if (HMD.tabletID !== this.tabletID) { this.tabletID = HMD.tabletID; - Pointers.setIgnoreItems(_this.leftPointer, _this.blacklist.concat([HMD.tabletID])); - Pointers.setIgnoreItems(_this.rightPointer, _this.blacklist.concat([HMD.tabletID])); + Pointers.setIgnoreItems(_this.leftPointer, _this.blacklist); + Pointers.setIgnoreItems(_this.rightPointer, _this.blacklist); } }; @@ -378,8 +378,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); }; this.setBlacklist = function() { - RayPick.setIgnoreItems(_this.leftControllerRayPick, this.blacklist.concat([HMD.tabletID])); - RayPick.setIgnoreItems(_this.rightControllerRayPick, this.blacklist.concat([HMD.tabletID])); + RayPick.setIgnoreItems(_this.leftControllerRayPick, this.blacklist); + RayPick.setIgnoreItems(_this.rightControllerRayPick, this.blacklist); }; var MAPPING_NAME = "com.highfidelity.controllerDispatcher"; diff --git a/scripts/system/libraries/utils.js b/scripts/system/libraries/utils.js index a6e2751a83..bc83cc582c 100644 --- a/scripts/system/libraries/utils.js +++ b/scripts/system/libraries/utils.js @@ -400,7 +400,7 @@ resizeTablet = function (width, newParentJointIndex, sensorToWorldScaleOverride) }); // update webOverlay - var RAYPICK_OFFSET = 0.0001; // Sufficient for raypick to reliably intersect tablet screen before tablet model. + var RAYPICK_OFFSET = 0.0007; // Sufficient for raypick to reliably intersect tablet screen before tablet model. var WEB_ENTITY_Z_OFFSET = (tabletDepth / 2.0) * sensorScaleOffsetOverride + RAYPICK_OFFSET; var WEB_ENTITY_Y_OFFSET = 0.004 * sensorScaleFactor * sensorScaleOffsetOverride; var screenWidth = 0.82 * tabletWidth; From 2960ad845c0ddf0b0904d3e3c4b366c0b8dc607e Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Wed, 10 Jan 2018 10:55:45 +0100 Subject: [PATCH 15/40] Fixed weird rendering bug. --- libraries/render-utils/src/LightAmbient.slh | 2 +- libraries/render-utils/src/LightingModel.slh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/render-utils/src/LightAmbient.slh b/libraries/render-utils/src/LightAmbient.slh index 3decdbcf7c..eb565d60e4 100644 --- a/libraries/render-utils/src/LightAmbient.slh +++ b/libraries/render-utils/src/LightAmbient.slh @@ -16,7 +16,7 @@ uniform samplerCube skyboxMap; vec4 evalSkyboxLight(vec3 direction, float lod) { // textureQueryLevels is not available until #430, so we require explicit lod // float mipmapLevel = lod * textureQueryLevels(skyboxMap); - float filterLod = textureQueryLod(skyboxMap, direction); + float filterLod = textureQueryLod(skyboxMap, direction).x; // Keep texture filtering LOD as limit to prevent aliasing on specular reflection lod = max(lod, filterLod); return textureLod(skyboxMap, direction, lod); diff --git a/libraries/render-utils/src/LightingModel.slh b/libraries/render-utils/src/LightingModel.slh index 279a010cf4..d96c565b81 100644 --- a/libraries/render-utils/src/LightingModel.slh +++ b/libraries/render-utils/src/LightingModel.slh @@ -133,16 +133,19 @@ SurfaceData initSurfaceData(float roughness, vec3 normal, vec3 eyeDir) { SurfaceData surface; surface.eyeDir = eyeDir; surface.normal = normal; - surface.lightDir = vec3(0,0,0); - surface.halfDir = vec3(0,0,0); surface.roughness = mix(0.001, 1.0, roughness); surface.roughness2 = surface.roughness * surface.roughness; surface.roughness4 = surface.roughness2 * surface.roughness2; surface.ndotv = clamp(dot(normal, eyeDir), 0.0, 1.0); + surface.smithInvG1NdotV = evalSmithInvG1(surface.roughness4, surface.ndotv); + + // These values will be set when we know the light direction, in updateSurfaceDataWithLight surface.ndoth = 0.0; surface.ndotl = 0.0; surface.ldoth = 0.0; - surface.smithInvG1NdotV = evalSmithInvG1(surface.roughness4, surface.ndotv); + surface.lightDir = vec3(0,0,1); + surface.halfDir = vec3(0,0,1); + return surface; } From e54f7d5a45516f2fbd61f08de7311474b40684fb Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 10 Jan 2018 13:03:54 -0700 Subject: [PATCH 16/40] Fix Pal Master Volume overlap --- interface/resources/qml/hifi/NameCard.qml | 4 ++-- interface/resources/qml/hifi/Pal.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index 3f5cad655d..9993d1f2b6 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -50,7 +50,7 @@ Item { id: avatarImage visible: profileUrl !== "" && userName !== ""; // Size - height: isMyCard ? 70 : 42; + height: isMyCard ? 84 : 42; width: visible ? height : 0; anchors.top: parent.top; anchors.topMargin: isMyCard ? 0 : 8; @@ -520,7 +520,7 @@ Item { Slider { id: gainSlider // Size - width: thisNameCard.width; + width: thisNameCard.width - 20; height: 14 // Anchors anchors.verticalCenter: nameCardVUMeter.verticalCenter; diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 64f61f0d69..02971cc984 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -28,7 +28,7 @@ Rectangle { // Properties property bool debug: false; property int myCardWidth: width - upperRightInfoContainer.width; - property int myCardHeight: 80; + property int myCardHeight: 100; property int rowHeight: 60; property int actionButtonWidth: 55; property int locationColumnWidth: 170; From 250e4032b05314dd87899c471050bf2cdc20b275 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 10 Jan 2018 11:51:44 -0800 Subject: [PATCH 17/40] Bug fix to prevent wrists entering the avatar's torso. This was inadvertently disabled in PR #11978. (cherry picked from commit ae997928c138416744129769f9af07a40442696e) --- interface/src/avatar/MySkeletonModel.cpp | 16 ++++++------ libraries/animation/src/Rig.cpp | 31 ++++++++++++------------ libraries/animation/src/Rig.h | 12 ++++++--- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/interface/src/avatar/MySkeletonModel.cpp b/interface/src/avatar/MySkeletonModel.cpp index 8d07a878b9..a8bdafb607 100644 --- a/interface/src/avatar/MySkeletonModel.cpp +++ b/interface/src/avatar/MySkeletonModel.cpp @@ -106,7 +106,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { if (avatarHeadPose.isValid()) { AnimPose pose(avatarHeadPose.getRotation(), avatarHeadPose.getTranslation()); params.primaryControllerPoses[Rig::PrimaryControllerType_Head] = avatarToRigPose * pose; - params.primaryControllerActiveFlags[Rig::PrimaryControllerType_Head] = true; + params.primaryControllerFlags[Rig::PrimaryControllerType_Head] = (uint8_t)Rig::ControllerFlags::Enabled; } else { // even though full head IK is disabled, the rig still needs the head orientation to rotate the head up and // down in desktop mode. @@ -114,7 +114,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { // postMult 180 is necessary to convert head from -z forward to z forward. glm::quat headRot = Quaternions::Y_180 * head->getFinalOrientationInLocalFrame() * Quaternions::Y_180; params.primaryControllerPoses[Rig::PrimaryControllerType_Head] = AnimPose(glm::vec3(1.0f), headRot, glm::vec3(0.0f)); - params.primaryControllerActiveFlags[Rig::PrimaryControllerType_Head] = false; + params.primaryControllerFlags[Rig::PrimaryControllerType_Head] = 0; } // @@ -135,10 +135,10 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { if (controllerPose.isValid()) { AnimPose pose(controllerPose.getRotation(), controllerPose.getTranslation()); params.primaryControllerPoses[pair.second] = avatarToRigPose * pose; - params.primaryControllerActiveFlags[pair.second] = true; + params.primaryControllerFlags[pair.second] = (uint8_t)Rig::ControllerFlags::Enabled; } else { params.primaryControllerPoses[pair.second] = AnimPose::identity; - params.primaryControllerActiveFlags[pair.second] = false; + params.primaryControllerFlags[pair.second] = 0; } } @@ -166,15 +166,15 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { if (controllerPose.isValid()) { AnimPose pose(controllerPose.getRotation(), controllerPose.getTranslation()); params.secondaryControllerPoses[pair.second] = avatarToRigPose * pose; - params.secondaryControllerActiveFlags[pair.second] = true; + params.secondaryControllerFlags[pair.second] = (uint8_t)Rig::ControllerFlags::Enabled; } else { params.secondaryControllerPoses[pair.second] = AnimPose::identity; - params.secondaryControllerActiveFlags[pair.second] = false; + params.secondaryControllerFlags[pair.second] = 0; } } // if hips are not under direct control, estimate the hips position. - if (avatarHeadPose.isValid() && !params.primaryControllerActiveFlags[Rig::PrimaryControllerType_Hips]) { + if (avatarHeadPose.isValid() && !(params.primaryControllerFlags[Rig::PrimaryControllerType_Hips] & (uint8_t)Rig::ControllerFlags::Enabled)) { bool isFlying = (myAvatar->getCharacterController()->getState() == CharacterController::State::Hover || myAvatar->getCharacterController()->computeCollisionGroup() == BULLET_COLLISION_GROUP_COLLISIONLESS); if (!_prevHipsValid) { @@ -200,7 +200,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { AnimPose sensorToRigPose(invRigMat * myAvatar->getSensorToWorldMatrix()); params.primaryControllerPoses[Rig::PrimaryControllerType_Hips] = sensorToRigPose * hips; - params.primaryControllerActiveFlags[Rig::PrimaryControllerType_Hips] = true; + params.primaryControllerFlags[Rig::PrimaryControllerType_Hips] = (uint8_t)Rig::ControllerFlags::Enabled | (uint8_t)Rig::ControllerFlags::Estimated; } else { _prevHipsValid = false; diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 44745c5c2d..27ba7a38a4 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1265,7 +1265,8 @@ glm::vec3 Rig::deflectHandFromTorso(const glm::vec3& handPosition, const FBXJoin return position; } -void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnabled, bool leftArmEnabled, bool rightArmEnabled, float dt, +void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnabled, bool hipsEstimated, + bool leftArmEnabled, bool rightArmEnabled, float dt, const AnimPose& leftHandPose, const AnimPose& rightHandPose, const FBXJointShapeInfo& hipsShapeInfo, const FBXJointShapeInfo& spineShapeInfo, const FBXJointShapeInfo& spine1ShapeInfo, const FBXJointShapeInfo& spine2ShapeInfo) { @@ -1279,7 +1280,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab glm::vec3 handPosition = leftHandPose.trans(); glm::quat handRotation = leftHandPose.rot(); - if (!hipsEnabled) { + if (!hipsEnabled || hipsEstimated) { // prevent the hand IK targets from intersecting the torso handPosition = deflectHandFromTorso(handPosition, hipsShapeInfo, spineShapeInfo, spine1ShapeInfo, spine2ShapeInfo); } @@ -1326,7 +1327,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab glm::vec3 handPosition = rightHandPose.trans(); glm::quat handRotation = rightHandPose.rot(); - if (!hipsEnabled) { + if (!hipsEnabled || hipsEstimated) { // prevent the hand IK targets from intersecting the torso handPosition = deflectHandFromTorso(handPosition, hipsShapeInfo, spineShapeInfo, spine1ShapeInfo, spine2ShapeInfo); } @@ -1550,20 +1551,20 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo _animVars.set("isTalking", params.isTalking); _animVars.set("notIsTalking", !params.isTalking); - bool headEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_Head]; - bool leftHandEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_LeftHand]; - bool rightHandEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_RightHand]; - bool hipsEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_Hips]; - bool leftFootEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_LeftFoot]; - bool rightFootEnabled = params.primaryControllerActiveFlags[PrimaryControllerType_RightFoot]; - bool spine2Enabled = params.primaryControllerActiveFlags[PrimaryControllerType_Spine2]; - - bool leftArmEnabled = params.secondaryControllerActiveFlags[SecondaryControllerType_LeftArm]; - bool rightArmEnabled = params.secondaryControllerActiveFlags[SecondaryControllerType_RightArm]; + bool headEnabled = params.primaryControllerFlags[PrimaryControllerType_Head] & (uint8_t)ControllerFlags::Enabled; + bool leftHandEnabled = params.primaryControllerFlags[PrimaryControllerType_LeftHand] & (uint8_t)ControllerFlags::Enabled; + bool rightHandEnabled = params.primaryControllerFlags[PrimaryControllerType_RightHand] & (uint8_t)ControllerFlags::Enabled; + bool hipsEnabled = params.primaryControllerFlags[PrimaryControllerType_Hips] & (uint8_t)ControllerFlags::Enabled; + bool hipsEstimated = params.primaryControllerFlags[PrimaryControllerType_Hips] & (uint8_t)ControllerFlags::Estimated; + bool leftFootEnabled = params.primaryControllerFlags[PrimaryControllerType_LeftFoot] & (uint8_t)ControllerFlags::Enabled; + bool rightFootEnabled = params.primaryControllerFlags[PrimaryControllerType_RightFoot] & (uint8_t)ControllerFlags::Enabled; + bool spine2Enabled = params.primaryControllerFlags[PrimaryControllerType_Spine2] & (uint8_t)ControllerFlags::Enabled; + bool leftArmEnabled = params.secondaryControllerFlags[SecondaryControllerType_LeftArm] & (uint8_t)ControllerFlags::Enabled; + bool rightArmEnabled = params.secondaryControllerFlags[SecondaryControllerType_RightArm] & (uint8_t)ControllerFlags::Enabled; updateHead(headEnabled, hipsEnabled, params.primaryControllerPoses[PrimaryControllerType_Head]); - updateHands(leftHandEnabled, rightHandEnabled, hipsEnabled, leftArmEnabled, rightArmEnabled, dt, + updateHands(leftHandEnabled, rightHandEnabled, hipsEnabled, hipsEstimated, leftArmEnabled, rightArmEnabled, dt, params.primaryControllerPoses[PrimaryControllerType_LeftHand], params.primaryControllerPoses[PrimaryControllerType_RightHand], params.hipsShapeInfo, params.spineShapeInfo, params.spine1ShapeInfo, params.spine2ShapeInfo); @@ -1623,7 +1624,7 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo for (int i = 0; i < (int)NumSecondaryControllerTypes; i++) { int index = indexOfJoint(secondaryControllerJointNames[i]); if (index >= 0) { - if (params.secondaryControllerActiveFlags[i]) { + if (params.secondaryControllerFlags[i] & (uint8_t)ControllerFlags::Enabled) { ikNode->setSecondaryTargetInRigFrame(index, params.secondaryControllerPoses[i]); } else { ikNode->clearSecondaryTarget(index); diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h index 1ec4d9527f..2b276386a0 100644 --- a/libraries/animation/src/Rig.h +++ b/libraries/animation/src/Rig.h @@ -69,11 +69,16 @@ public: NumSecondaryControllerTypes }; + enum class ControllerFlags : uint8_t { + Enabled = 0x01, + Estimated = 0x02 + }; + struct ControllerParameters { AnimPose primaryControllerPoses[NumPrimaryControllerTypes]; // rig space - bool primaryControllerActiveFlags[NumPrimaryControllerTypes]; + uint8_t primaryControllerFlags[NumPrimaryControllerTypes]; AnimPose secondaryControllerPoses[NumSecondaryControllerTypes]; // rig space - bool secondaryControllerActiveFlags[NumSecondaryControllerTypes]; + uint8_t secondaryControllerFlags[NumSecondaryControllerTypes]; bool isTalking; FBXJointShapeInfo hipsShapeInfo; FBXJointShapeInfo spineShapeInfo; @@ -251,7 +256,8 @@ protected: void buildAbsoluteRigPoses(const AnimPoseVec& relativePoses, AnimPoseVec& absolutePosesOut); void updateHead(bool headEnabled, bool hipsEnabled, const AnimPose& headMatrix); - void updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnabled, bool leftArmEnabled, bool rightArmEnabled, float dt, + void updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnabled, bool hipsEstimated, + bool leftArmEnabled, bool rightArmEnabled, float dt, const AnimPose& leftHandPose, const AnimPose& rightHandPose, const FBXJointShapeInfo& hipsShapeInfo, const FBXJointShapeInfo& spineShapeInfo, const FBXJointShapeInfo& spine1ShapeInfo, const FBXJointShapeInfo& spine2ShapeInfo); From 6072780d243b7e3d1e74dd77bda260a980642f78 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Wed, 10 Jan 2018 13:19:53 -0800 Subject: [PATCH 18/40] keep requesting render update until textures load (cherry picked from commit df574c6bc94e5438a064c6420e9a108be011a12a) --- libraries/entities-renderer/src/RenderableModelEntityItem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index c756070bc3..0c1721ae44 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1080,7 +1080,7 @@ bool ModelEntityRenderer::needsRenderUpdate() const { return true; } - if (!_texturesLoaded && model->getGeometry() && model->getGeometry()->areTexturesLoaded()) { + if (!_texturesLoaded) { return true; } @@ -1310,6 +1310,8 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce if (!_texturesLoaded && model->getGeometry() && model->getGeometry()->areTexturesLoaded()) { _texturesLoaded = true; model->updateRenderItems(); + } else if (!_texturesLoaded) { + emit requestRenderUpdate(); } // When the individual mesh parts of a model finish fading, they will mark their Model as needing updating From d5e3b97c934bdd1435d60373e0f7aa60659e12c6 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 10 Jan 2018 16:03:53 -0800 Subject: [PATCH 19/40] Fix for black screen when clicking Settings from Snap app --- interface/resources/qml/hifi/tablet/TabletRoot.qml | 2 +- scripts/system/snapshot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index da544c2114..e7614e11b7 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -106,7 +106,7 @@ Item { if (isWebPage) { var webUrl = tabletApps.get(currentApp).appWebUrl; var scriptUrl = tabletApps.get(currentApp).scriptUrl; - loadSource("TabletWebView.qml"); + loadSource("hifi/tablet/TabletWebView.qml"); loadWebUrl(webUrl, scriptUrl); } else { loader.load(tabletApps.get(currentApp).appUrl); diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 9afdb4ec53..dad642075f 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -121,7 +121,7 @@ function onMessage(message) { || (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar", true))) { Desktop.show("hifi/dialogs/GeneralPreferencesDialog.qml", "GeneralPreferencesDialog"); } else { - tablet.loadQMLOnTop("TabletGeneralPreferences.qml"); + tablet.loadQMLOnTop("hifi/tablet/TabletGeneralPreferences.qml"); } break; case 'captureStillAndGif': From 753bd21e68af97cd5c936f3fba54c9f2710fc65f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 11 Jan 2018 13:44:16 +1300 Subject: [PATCH 20/40] location API JSDoc --- libraries/networking/src/AddressManager.h | 287 +++++++++++++++++++++- 1 file changed, 286 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 2f3d896509..cf9d8a085b 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -31,6 +31,31 @@ const QString INDEX_PATH = "/"; const QString GET_PLACE = "/api/v1/places/%1"; +/**jsdoc + * The location API provides facilities related to your current location in the metaverse. + * + * @namespace location + * @property {Uuid} domainId - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid|Uuid.NULL} if you're not + * connected to the domain. + * Read-only. + * @property {string} hostname - The name of the domain for your current metaverse address (e.g., "AvatarIsland", + * localhost, or an IP address. + * Read-only. + * @property {string} href - Your current metaverse address (e.g., "hifi://avatarisland/15,-10,26/0,0,0,1") + * regardless of whether or not you're connected to the domain. + * Read-only. + * @property {boolean} isConnected - true if you're connected to a domain, otherwise false. + * Read-only. + * @property {string} pathname - The location and orientation in your current href metaverse address + * (e.g., "/15,-10,26/0,0,0,1"). + * Read-only. + * @property {string} placename - The name of the place in your current href metaverse address + * (e.g., "AvatarIsland"). Is blank if your hostname is an IP address. + * Read-only. + * @property {string} protocol - The protocol of your current href metaverse address (e.g., "hifi"). + * Read-only. + */ + class AddressManager : public QObject, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY @@ -42,10 +67,77 @@ class AddressManager : public QObject, public Dependency { Q_PROPERTY(QString placename READ getPlaceName) Q_PROPERTY(QString domainId READ getDomainId) public: + + /**jsdoc + * Get Interface's protocol version. + * @function location.protocolVersion + * @returns {string} A string uniquely identifying the version of the metaverse protocol that Interface is using. + */ Q_INVOKABLE QString protocolVersion(); + using PositionGetter = std::function; using OrientationGetter = std::function; + /**jsdoc + *

The reasons for an address lookup via the metaverse API are defined by numeric values:

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
NameValueDescription
UserInput0User-typed input.
Back1Address from a {@link location.goBack|goBack} call.
Forward2Address from a {@link location.goForward|goForward} call.
StartupFromSettings3Initial location at Interface start-up from settings.
DomainPathResponse4A named path in the domain.
Internal5An internal attempt to resolve an alternative path.
AttemptedRefresh6A refresh after connecting to a domain.
Suggestions7Address from the Goto dialog.
VisitUserFromPAL8User from the People dialog.
+ * @typedef location.LookupTrigger + */ enum LookupTrigger { UserInput, Back, @@ -83,43 +175,236 @@ public: const QStack& getForwardStack() const { return _forwardStack; } public slots: + /**jsdoc + * Go to a specified metaverse address. + * @function location.handleLookupString + * @param {string} address - The address to go to: a "hifi:/" address, an IP address (e.g., + * "127.0.0.1" or "localhost"), a domain name, a named path on a domain (starts with + * "/"), a position or position and orientation, or a user (starts with "@"). + * @param {boolean} fromSuggestions=false - Set to true if the address is obtained from the "Goto" dialog. + */ void handleLookupString(const QString& lookupString, bool fromSuggestions = false); - + + /**jsdoc + * Go to a position and orientation resulting from a lookup for a named path in the domain (set in the domain server's + * settings). + * @function location.goToViewpointForPath + * @param {string} path - The position and orientation corresponding to the named path. + * @param {string} namedPath - The named path that was looked up on the server. + * @deprecated This function is deprecated and will be removed. + */ + // This function is marked as deprecated in anticipation that it will not be included in the JavaScript API if and when the + // functions and signals that should be exposed are moved to a scripting interface class. + // // we currently expect this to be called from NodeList once handleLookupString has been called with a path bool goToViewpointForPath(const QString& viewpointString, const QString& pathString) { return handleViewpoint(viewpointString, false, DomainPathResponse, false, pathString); } + /**jsdoc + * Go back to the previous location in your navigation history, if there is one. + * @function location.goBack + */ void goBack(); + + /**jsdoc + * Go forward to the next location in your navigation history, if there is one. + * @function location.goForward + */ void goForward(); + + /**jsdoc + * Go to the local Sandbox server that's running on the same PC as Interface. + * @function location.goToLocalSandbox + * @param {string} path="" - The position and orientation to go to (e.g., "/0,0,0"). + * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. + */ void goToLocalSandbox(QString path = "", LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(SANDBOX_HIFI_ADDRESS + path, trigger); } + + /**jsdoc + * Go to the default metaverse address. + * @function location.goToEntry + * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. + */ void goToEntry(LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(DEFAULT_HIFI_ADDRESS, trigger); } + /**jsdoc + * Go to the specified user's location. + * @function location.goToUser + * @param {string} username - The user's user name. + * @param {boolean} matchOrientation=true - If true then go to a location just in front of the user and turn to face + * them, otherwise go to the user's exact location and orientation. + */ void goToUser(const QString& username, bool shouldMatchOrientation = true); + /**jsdoc + * Refresh the current address, e.g., after connecting to a domain ion order to position the user to the desired location. + * @function location.refreshPreviousLookup + * @deprecated This function is deprecated and will be removed. + */ + // This function is marked as deprecated in anticipation that it will not be included in the JavaScript API if and when the + // functions and signals that should be exposed are moved to a scripting interface class. void refreshPreviousLookup(); + /**jsdoc + * Save your current metaverse location in Interface's settings file. + * @function location.storeCurrentAddress + */ void storeCurrentAddress(); + /**jsdoc + * Copy your current metaverse address (i.e., location.href property value) to the OS clipboard. + * @function location.copyAddress + */ void copyAddress(); + + /**jsdoc + * Copy your current metaverse location and orientation (i.e., location.pathname property value) to the OS + * clipboard. + * @function location.copyPath + */ void copyPath(); + /**jsdoc + * Retrieve and remember the place name for the given domain ID if the place name is not already known. + * @function location.lookupShareableNameForDomainID + * @param {Uuid} domainID - The UUID of the domain. + * @deprecated This function is deprecated and will be removed. + */ + // This function is marked as deprecated in anticipation that it will not be included in the JavaScript API if and when the + // functions and signals that should be exposed are moved to a scripting interface class. void lookupShareableNameForDomainID(const QUuid& domainID); signals: + /**jsdoc + * Triggered when looking up the details of a metaverse user or location to go to has completed (successfully or + * unsuccessfully). + * @function location.lookupResultsFinished + * @returns {Signal} + */ void lookupResultsFinished(); + + /**jsdoc + * Triggered when looking up the details of a metaverse user or location to go to has completed and the domain or user is + * offline. + * @function location.lookupResultIsOffline + * @returns {Signal} + */ void lookupResultIsOffline(); + + /**jsdoc + * Triggered when looking up the details of a metaverse user or location to go to has completed and the domain or user could + * not be found (i.e., is unknown). + * @function location.lookupResultIsNotFound + * @returns {Signal} + */ void lookupResultIsNotFound(); + /**jsdoc + * Triggered when a request is made to go to an IP address. + * @function location.possibleDomainChangeRequired + * @param {string} hostName - The name of the domain to go do. + * @param {number} port - The integer number of the network port to connect to. + * @param {Uuid} domainID - The UUID of the domain to go to. + * @returns {Signal} + */ + // No example because this function isn't typically used in scripts. void possibleDomainChangeRequired(const QString& newHostname, quint16 newPort, const QUuid& domainID); + + /**jsdoc + * Triggered when a request is made to go to a domain. + * @function location.possibleDomainChangeRequiredViaICEForID + * @param {string} iceServerHostName - IP address of the ICE server. + * @param {Uuid} domainID - The UUID of the domain to go to. + * @returns {Signal} + */ + // No example because this function isn't typically used in scripts. void possibleDomainChangeRequiredViaICEForID(const QString& iceServerHostname, const QUuid& domainID); + /**jsdoc + * Triggered when an attempt is made to send your avatar to a specified position on the current domain. For example, when + * you enter a position to go to in the "Goto" dialog or change domains. + * @function location.locationChangeRequired + * @param {Vec3} position - The position to go to. + * @param {boolean} hasOrientationChange - If true then a new orientation has been requested. + * @param {Quat} orientation - The orientation to change to. Is {@link Quat(0)|Quat.IDENTITY} if + * hasOrientationChange is false. + * @param {boolean} shouldFaceLocation - If true then the request is to go to a position near that specified + * and orient your avatar to face it. For example when you visit someone from the "People" dialog. + * @returns {Signal} + * @example Report location change requests. + * function onLocationChangeRequired(newPosition, hasOrientationChange, newOrientation, shouldFaceLocation) { + * print("Location change required:"); + * print("- New position = " + JSON.stringify(newPosition)); + * print("- Has orientation change = " + hasOrientationChange); + * print("- New orientation = " + JSON.stringify(newOrientation)); + * print("- Should face location = " + shouldFaceLocation); + * } + * + * location.locationChangeRequired.connect(onLocationChangeRequired); + */ void locationChangeRequired(const glm::vec3& newPosition, bool hasOrientationChange, const glm::quat& newOrientation, bool shouldFaceLocation); + + /**jsdoc + * Triggered when an attempt is made to send your avatar goes to a new named path on the domain (set in the domain server's + * settings). For example, when you enter a "/" followed by the path's name in the "GOTO" dialog. + * @function location.pathChangeRequired + * @param {string} path - The name of the path to go to. + * @returns {Signal} + * @example Report path change requests. + * function onPathChangeRequired(newPath) { + * print("onPathChangeRequired: newPath = " + newPath); + * } + * + * location.pathChangeRequired.connect(onPathChangeRequired); + */ void pathChangeRequired(const QString& newPath); + + /**jsdoc + * Triggered when you navigated to a new domain. + * @function location.hostChanged + * @param {string} hostname - The new domain's host name. + * @returns {Signal} + * @example Report when you navigate to a new domain. + * function onHostChanged(host) { + * print("Host changed to: " + host); + * } + * + * location.hostChanged.connect(onHostChanged); + */ void hostChanged(const QString& newHost); + /**jsdoc + * Triggered when whether or not there's a previous location to navigate to changes. (Reflects changes in the state of the + * "Goto" dialog's back arrow.) + * @function location.goBackPossible + * @param {boolean} isPossible - true if there's a previous location to navigate to, otherwise + * false. + * @returns {Signal} + * @example Report when ability to navigate back changes. + * function onGoBackPossible(isPossible) { + * print("Go back possible: " + isPossible); + * } + * + * location.goBackPossible.connect(onGoBackPossible); + */ void goBackPossible(bool isPossible); + + /**jsdoc + * Triggered when whether or not there's a forward location to navigate to changes. (Reflects changes in the state of the + * "Goto" dialog's forward arrow.) + * @function location.goForwardPossible + * @param {boolean} isPossible - true if there's a forward location to navigate to, otherwise + * false. + * @returns {Signal} + * @example Report when ability to navigate forward changes. + * function onGoForwardPossible(isPossible) { + * print("Go forward possible: " + isPossible); + * } + * + * location.goForwardPossible.connect(onGoForwardPossible); + */ void goForwardPossible(bool isPossible); protected: From 309e7f7333dd524e8cc650697b185dcebb2bea0b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 11 Jan 2018 14:48:45 +1300 Subject: [PATCH 21/40] Tidying --- libraries/networking/src/AddressManager.h | 27 ++++++++++++----------- libraries/networking/src/NodeList.cpp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index cf9d8a085b..2c342a1b93 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -39,17 +39,18 @@ const QString GET_PLACE = "/api/v1/places/%1"; * connected to the domain. * Read-only. * @property {string} hostname - The name of the domain for your current metaverse address (e.g., "AvatarIsland", - * localhost, or an IP address. + * localhost, or an IP address). * Read-only. * @property {string} href - Your current metaverse address (e.g., "hifi://avatarisland/15,-10,26/0,0,0,1") * regardless of whether or not you're connected to the domain. * Read-only. - * @property {boolean} isConnected - true if you're connected to a domain, otherwise false. + * @property {boolean} isConnected - true if you're connected to the domain in your current href + * metaverse address, otherwise false. * Read-only. * @property {string} pathname - The location and orientation in your current href metaverse address * (e.g., "/15,-10,26/0,0,0,1"). * Read-only. - * @property {string} placename - The name of the place in your current href metaverse address + * @property {string} placename - The place name in your current href metaverse address * (e.g., "AvatarIsland"). Is blank if your hostname is an IP address. * Read-only. * @property {string} protocol - The protocol of your current href metaverse address (e.g., "hifi"). @@ -230,7 +231,7 @@ public slots: /**jsdoc * Go to the specified user's location. * @function location.goToUser - * @param {string} username - The user's user name. + * @param {string} username - The user's username. * @param {boolean} matchOrientation=true - If true then go to a location just in front of the user and turn to face * them, otherwise go to the user's exact location and orientation. */ @@ -293,7 +294,7 @@ signals: /**jsdoc * Triggered when looking up the details of a metaverse user or location to go to has completed and the domain or user could - * not be found (i.e., is unknown). + * not be found. * @function location.lookupResultIsNotFound * @returns {Signal} */ @@ -311,7 +312,7 @@ signals: void possibleDomainChangeRequired(const QString& newHostname, quint16 newPort, const QUuid& domainID); /**jsdoc - * Triggered when a request is made to go to a domain. + * Triggered when a request is made to go to a named domain or user. * @function location.possibleDomainChangeRequiredViaICEForID * @param {string} iceServerHostName - IP address of the ICE server. * @param {Uuid} domainID - The UUID of the domain to go to. @@ -322,7 +323,7 @@ signals: /**jsdoc * Triggered when an attempt is made to send your avatar to a specified position on the current domain. For example, when - * you enter a position to go to in the "Goto" dialog or change domains. + * you change domains or enter a position to go to in the "Goto" dialog. * @function location.locationChangeRequired * @param {Vec3} position - The position to go to. * @param {boolean} hasOrientationChange - If true then a new orientation has been requested. @@ -347,7 +348,7 @@ signals: bool shouldFaceLocation); /**jsdoc - * Triggered when an attempt is made to send your avatar goes to a new named path on the domain (set in the domain server's + * Triggered when an attempt is made to send your avatar to a new named path on the domain (set in the domain server's * settings). For example, when you enter a "/" followed by the path's name in the "GOTO" dialog. * @function location.pathChangeRequired * @param {string} path - The name of the path to go to. @@ -362,7 +363,7 @@ signals: void pathChangeRequired(const QString& newPath); /**jsdoc - * Triggered when you navigated to a new domain. + * Triggered when you navigate to a new domain. * @function location.hostChanged * @param {string} hostname - The new domain's host name. * @returns {Signal} @@ -376,8 +377,8 @@ signals: void hostChanged(const QString& newHost); /**jsdoc - * Triggered when whether or not there's a previous location to navigate to changes. (Reflects changes in the state of the - * "Goto" dialog's back arrow.) + * Triggered when there's a change in whether or not there's a previous location that can be navigated to using + * {@link location.goBack|goBack}. (Reflects changes in the state of the "Goto" dialog's back arrow.) * @function location.goBackPossible * @param {boolean} isPossible - true if there's a previous location to navigate to, otherwise * false. @@ -392,8 +393,8 @@ signals: void goBackPossible(bool isPossible); /**jsdoc - * Triggered when whether or not there's a forward location to navigate to changes. (Reflects changes in the state of the - * "Goto" dialog's forward arrow.) + * Triggered when there's a change in whether or not there's a forward location that can be navigated to using + * {@link location.goForward|goForward}. (Reflects changes in the state of the "Goto" dialog's forward arrow.) * @function location.goForwardPossible * @param {boolean} isPossible - true if there's a forward location to navigate to, otherwise * false. diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 5a72006a8c..1c18125433 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -437,7 +437,7 @@ void NodeList::sendPendingDSPathQuery() { QString pendingPath = _domainHandler.getPendingPath(); if (!pendingPath.isEmpty()) { - qCDebug(networking) << "Attemping to send pending query to DS for path" << pendingPath; + qCDebug(networking) << "Attempting to send pending query to DS for path" << pendingPath; // this is a slot triggered if we just established a network link with a DS and want to send a path query sendDSPathQuery(_domainHandler.getPendingPath()); From 7ba42f0e76ec8269b5b6cd7a35deb625c09a870b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 11 Jan 2018 15:52:56 +1300 Subject: [PATCH 22/40] Update JSDoc per recent changes in Window API --- interface/src/scripting/WindowScriptingInterface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index af9c03a218..6d7a10c580 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -42,7 +42,7 @@ void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptR * @property {number} innerWidth - The width of the drawable area of the Interface window (i.e., without borders or other * chrome), in pixels. Read-only. * @property {number} innerHeight - The height of the drawable area of the Interface window (i.e., without borders or other - * chrome) plus the height of the menu bar, in pixels. Read-only. + * chrome), in pixels. Read-only. * @property {object} location - Provides facilities for working with your current metaverse location. See {@link location}. * @property {number} x - The x coordinate of the top left corner of the Interface window on the display. Read-only. * @property {number} y - The y coordinate of the top left corner of the Interface window on the display. Read-only. @@ -555,7 +555,7 @@ signals: /**jsdoc * Triggered when a still snapshot has been taken by calling {@link Window.takeSnapshot|takeSnapshot} with - * includeAnimated = false. + * includeAnimated = false or {@link Window.takeSecondaryCameraSnapshot|takeSecondaryCameraSnapshot}. * @function Window.stillSnapshotTaken * @param {string} pathStillSnapshot - The path and name of the snapshot image file. * @param {boolean} notify - The value of the notify parameter that {@link Window.takeSnapshot|takeSnapshot} From a543d90090968a0457d7b9e65eaf21ad69fb92d3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 11 Jan 2018 15:53:45 +1300 Subject: [PATCH 23/40] Miscellaneous fixes --- interface/src/scripting/WindowScriptingInterface.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index 6d7a10c580..bfad5644bf 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -301,7 +301,7 @@ public slots: /**jsdoc * Get Interface's build number. * @function Window.checkVersion - * @returns {string} - Interface's build number. + * @returns {string} Interface's build number. */ QString checkVersion(); @@ -327,7 +327,7 @@ public slots: * full resolution is used (window dimensions in desktop mode; HMD display dimensions in HMD mode), otherwise one of the * dimensions is adjusted in order to match the aspect ratio. * @example Using the snapshot function and signals. - * function onStillSnapshottaken(path, notify) { + * function onStillSnapshotTaken(path, notify) { * print("Still snapshot taken: " + path); * print("Notify: " + notify); * } @@ -340,7 +340,7 @@ public slots: * print("Animated snapshot taken: " + animatedPath); * } * - * Window.stillSnapshotTaken.connect(onStillSnapshottaken); + * Window.stillSnapshotTaken.connect(onStillSnapshotTaken); * Window.processingGifStarted.connect(onProcessingGifStarted); * Window.processingGifCompleted.connect(onProcessingGifCompleted); * From a3ca8e3a72d5c552e85681533e41d15380d24018 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Wed, 10 Jan 2018 17:01:01 -0800 Subject: [PATCH 24/40] try to avoid reusing uniform buffer locations (cherry picked from commit e9d751fd23f85b980aa47faf702b89292c01e20d) --- .../src/RenderableParticleEffectEntityItem.cpp | 7 ++++++- .../src/RenderablePolyLineEntityItem.cpp | 5 +++-- libraries/render-utils/src/LightClusters.cpp | 13 ++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index bc96e45881..a3e6cd4341 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -23,6 +23,8 @@ using namespace render::entities; static uint8_t CUSTOM_PIPELINE_NUMBER = 0; static gpu::Stream::FormatPointer _vertexFormat; static std::weak_ptr _texturedPipeline; +// FIXME: This is interfering with the uniform buffers in DeferredLightingEffect.cpp, so use 11 to avoid collisions +static int32_t PARTICLE_UNIFORM_SLOT { 11 }; static ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, const ShapeKey& key) { auto texturedPipeline = _texturedPipeline.lock(); @@ -38,6 +40,9 @@ static ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, co auto fragShader = gpu::Shader::createPixel(std::string(textured_particle_frag)); auto program = gpu::Shader::createProgram(vertShader, fragShader); + gpu::Shader::BindingSet slotBindings; + slotBindings.insert(gpu::Shader::Binding(std::string("particleBuffer"), PARTICLE_UNIFORM_SLOT)); + gpu::Shader::makeProgram(*program, slotBindings); _texturedPipeline = texturedPipeline = gpu::Pipeline::create(program, state); } @@ -320,7 +325,7 @@ void ParticleEffectEntityRenderer::doRender(RenderArgs* args) { transform.setScale(vec3(1)); } batch.setModelTransform(transform); - batch.setUniformBuffer(0, _uniformBuffer); + batch.setUniformBuffer(PARTICLE_UNIFORM_SLOT, _uniformBuffer); batch.setInputFormat(_vertexFormat); batch.setInputBuffer(0, _particleBuffer, 0, sizeof(GpuParticle)); diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index 21764dff7f..b362721cde 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -33,8 +33,9 @@ using namespace render; using namespace render::entities; static uint8_t CUSTOM_PIPELINE_NUMBER { 0 }; -static const int32_t PAINTSTROKE_TEXTURE_SLOT{ 0 }; -static const int32_t PAINTSTROKE_UNIFORM_SLOT{ 0 }; +static const int32_t PAINTSTROKE_TEXTURE_SLOT { 0 }; +// FIXME: This is interfering with the uniform buffers in DeferredLightingEffect.cpp, so use 11 to avoid collisions +static const int32_t PAINTSTROKE_UNIFORM_SLOT { 11 }; static gpu::Stream::FormatPointer polylineFormat; static gpu::PipelinePointer polylinePipeline; #ifdef POLYLINE_ENTITY_USE_FADE_EFFECT diff --git a/libraries/render-utils/src/LightClusters.cpp b/libraries/render-utils/src/LightClusters.cpp index eedb9053c7..d6ac7fd2e2 100644 --- a/libraries/render-utils/src/LightClusters.cpp +++ b/libraries/render-utils/src/LightClusters.cpp @@ -37,14 +37,13 @@ enum LightClusterGridShader_MapSlot { }; enum LightClusterGridShader_BufferSlot { - LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT = 0, - DEFERRED_FRAME_TRANSFORM_BUFFER_SLOT =1, - CAMERA_CORRECTION_BUFFER_SLOT = 2, + DEFERRED_FRAME_TRANSFORM_BUFFER_SLOT = 0, + CAMERA_CORRECTION_BUFFER_SLOT = 1, LIGHT_GPU_SLOT = render::ShapePipeline::Slot::LIGHT, - LIGHT_INDEX_GPU_SLOT = 5, - - LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT = 6, - LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT = 7, + LIGHT_INDEX_GPU_SLOT = 7, + LIGHT_CLUSTER_GRID_FRUSTUM_GRID_SLOT = 8, + LIGHT_CLUSTER_GRID_CLUSTER_GRID_SLOT = 9, + LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT = 10, }; FrustumGrid::FrustumGrid(const FrustumGrid& source) : From 54a1da8d73a3179e696590b9c90c0df187d9a671 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 11 Jan 2018 11:55:28 -0700 Subject: [PATCH 25/40] Only mod my card --- interface/resources/qml/hifi/NameCard.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index 9993d1f2b6..e08fdc53ff 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -520,7 +520,7 @@ Item { Slider { id: gainSlider // Size - width: thisNameCard.width - 20; + width: isMyCard ? thisNameCard.width - 20 : thisNameCard.width; height: 14 // Anchors anchors.verticalCenter: nameCardVUMeter.verticalCenter; From 11e918681aa622b6f939100771739a194691962b Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 12 Jan 2018 02:08:10 +0300 Subject: [PATCH 26/40] =?UTF-8?q?FB11241=20Changing=20options=20in=20menu?= =?UTF-8?q?=20causes=20the=20title=20=E2=80=9CMenu=E2=80=9D=20to=20change?= =?UTF-8?q?=20to=20=E2=80=9Croot=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit note: fix is based on removing duplicated top-level menu entry from stack view --- interface/resources/qml/hifi/tablet/TabletMenuStack.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/TabletMenuStack.qml b/interface/resources/qml/hifi/tablet/TabletMenuStack.qml index ff653b6457..4fa29de9a3 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenuStack.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenuStack.qml @@ -22,7 +22,6 @@ Item { anchors.fill: parent id: d objectName: "stack" - initialItem: topMenu property var menuStack: [] property var topMenu: null; From e627925bd3fa4f42e0fc3cc2908ef1ed6eb7af8d Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 12 Jan 2018 13:31:58 -0800 Subject: [PATCH 27/40] Fix 'Browse Avatars' button from Avatar Settings --- .../qml/dialogs/preferences/AvatarBrowser.qml | 85 -------------- .../dialogs/preferences/AvatarPreference.qml | 18 +-- .../preferences/TabletAvatarBrowser.qml | 111 ------------------ interface/src/Application.cpp | 9 ++ interface/src/Application.h | 1 + 5 files changed, 11 insertions(+), 213 deletions(-) delete mode 100644 interface/resources/qml/dialogs/preferences/AvatarBrowser.qml delete mode 100644 interface/resources/qml/hifi/tablet/tabletWindows/preferences/TabletAvatarBrowser.qml diff --git a/interface/resources/qml/dialogs/preferences/AvatarBrowser.qml b/interface/resources/qml/dialogs/preferences/AvatarBrowser.qml deleted file mode 100644 index 5949adffca..0000000000 --- a/interface/resources/qml/dialogs/preferences/AvatarBrowser.qml +++ /dev/null @@ -1,85 +0,0 @@ -// -// AvatarBrowser.qml -// -// Created by Bradley Austin Davis on 30 Aug 2015 -// Copyright 2015 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import QtWebChannel 1.0 -import QtWebEngine 1.2 - -import "../../windows" -import "../../controls-uit" -import "../../styles-uit" - -Window { - id: root - HifiConstants { id: hifi } - width: 900; height: 700 - resizable: true - modality: Qt.ApplicationModal - - Item { - anchors.fill: parent - - property bool keyboardEnabled: false - property bool keyboardRaised: true - property bool punctuationMode: false - - BaseWebView { - id: webview - url: Account.metaverseServerURL + "/marketplace?category=avatars" - focus: true - - anchors { - top: parent.top - left: parent.left - right: parent.right - bottom: keyboard.top - } - - // Create a global EventBridge object for raiseAndLowerKeyboard. - WebEngineScript { - id: createGlobalEventBridge - sourceCode: eventBridgeJavaScriptToInject - injectionPoint: WebEngineScript.DocumentCreation - worldId: WebEngineScript.MainWorld - } - - // Detect when may want to raise and lower keyboard. - WebEngineScript { - id: raiseAndLowerKeyboard - injectionPoint: WebEngineScript.Deferred - sourceUrl: resourceDirectoryUrl + "html/raiseAndLowerKeyboard.js" - worldId: WebEngineScript.MainWorld - } - - userScripts: [ createGlobalEventBridge, raiseAndLowerKeyboard ] - - Component.onCompleted: { - webChannel.registerObject("eventBridge", eventBridge); - webChannel.registerObject("eventBridgeWrapper", eventBridgeWrapper); - } - } - - Keyboard { - id: keyboard - raised: parent.keyboardEnabled && parent.keyboardRaised - numeric: parent.punctuationMode - anchors { - left: parent.left - right: parent.right - bottom: parent.bottom - } - } - - Component.onCompleted: { - keyboardEnabled = HMD.active; - } - } -} diff --git a/interface/resources/qml/dialogs/preferences/AvatarPreference.qml b/interface/resources/qml/dialogs/preferences/AvatarPreference.qml index b27827d9d7..0efc3776b3 100644 --- a/interface/resources/qml/dialogs/preferences/AvatarPreference.qml +++ b/interface/resources/qml/dialogs/preferences/AvatarPreference.qml @@ -99,25 +99,9 @@ Preference { leftMargin: dataTextField.acceptableInput ? hifi.dimensions.contentSpacing.x : 0 } onClicked: { - if (typeof desktop !== "undefined") { - // Load dialog via OffscreenUi so that JavaScript EventBridge is available. - root.browser = OffscreenUi.load("dialogs/preferences/AvatarBrowser.qml"); - root.browser.windowDestroyed.connect(function(){ - root.browser = null; - }); - } else { - root.browser = tabletAvatarBrowserBuilder.createObject(tabletRoot); - - // Make dialog modal. - tabletRoot.openModal = root.browser; - } + ApplicationInterface.loadAvatarBrowser(); } } - Component { - id: tabletAvatarBrowserBuilder; - TabletAvatarBrowser { } - } - } } diff --git a/interface/resources/qml/hifi/tablet/tabletWindows/preferences/TabletAvatarBrowser.qml b/interface/resources/qml/hifi/tablet/tabletWindows/preferences/TabletAvatarBrowser.qml deleted file mode 100644 index 2ea12f1d3d..0000000000 --- a/interface/resources/qml/hifi/tablet/tabletWindows/preferences/TabletAvatarBrowser.qml +++ /dev/null @@ -1,111 +0,0 @@ -// -// TabletAvatarBrowser.qml -// -// Created by David Rowe on 14 Mar 2017 -// Copyright 2017 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import QtWebChannel 1.0 -import QtWebEngine 1.2 - -import "../../../../windows" -import "../../../../controls-uit" -import "../../../../styles-uit" - -Item { - id: root - objectName: "ModelBrowserDialog" - - property string title: "Attachment Model" - - property bool keyboardEnabled: false - property bool keyboardRaised: false - property bool punctuationMode: false - - anchors.fill: parent - - BaseWebView { - id: webview - url: (Account.metaverseServerURL + "/marketplace?category=avatars") - focus: true - - anchors { - top: parent.top - left: parent.left - right: parent.right - bottom: footer.top - } - - // Create a global EventBridge object for raiseAndLowerKeyboard. - WebEngineScript { - id: createGlobalEventBridge - sourceCode: eventBridgeJavaScriptToInject - injectionPoint: WebEngineScript.DocumentCreation - worldId: WebEngineScript.MainWorld - } - - // Detect when may want to raise and lower keyboard. - WebEngineScript { - id: raiseAndLowerKeyboard - injectionPoint: WebEngineScript.Deferred - sourceUrl: resourceDirectoryUrl + "html/raiseAndLowerKeyboard.js" - worldId: WebEngineScript.MainWorld - } - - userScripts: [ createGlobalEventBridge, raiseAndLowerKeyboard ] - - Component.onCompleted: { - webChannel.registerObject("eventBridge", eventBridge); - webChannel.registerObject("eventBridgeWrapper", eventBridgeWrapper); - } - } - - Rectangle { - id: footer - height: 40 - - anchors { - left: parent.left - right: parent.right - bottom: keyboard.top - } - - color: hifi.colors.baseGray - - Row { - anchors { - verticalCenter: parent.verticalCenter - right: parent.right - rightMargin: hifi.dimensions.contentMargin.x - } - - Button { - text: "Cancel" - color: hifi.buttons.white - onClicked: root.destroy(); - } - } - } - - Keyboard { - id: keyboard - - raised: parent.keyboardEnabled && parent.keyboardRaised - numeric: parent.punctuationMode - - anchors { - left: parent.left - right: parent.right - bottom: parent.bottom - } - } - - Component.onCompleted: { - keyboardEnabled = HMD.active; - } -} diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6cabab6c01..4436c5cde9 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6776,6 +6776,15 @@ void Application::loadAddAvatarBookmarkDialog() const { avatarBookmarks->addBookmark(); } +void Application::loadAvatarBrowser() const { + auto tablet = dynamic_cast(DependencyManager::get()->getTablet("com.highfidelity.interface.tablet.system")); + // construct the url to the marketplace item + QString url = NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/marketplace?category=avatars"; + QString MARKETPLACES_INJECT_SCRIPT_PATH = "file:///" + qApp->applicationDirPath() + "/scripts/system/html/js/marketplacesInject.js"; + tablet->gotoWebScreen(url, MARKETPLACES_INJECT_SCRIPT_PATH); + DependencyManager::get()->openTablet(); +} + void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) { postLambdaEvent([notify, includeAnimated, aspectRatio, this] { // Get a screenshot and save it diff --git a/interface/src/Application.h b/interface/src/Application.h index 479ce919a3..b687158516 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -309,6 +309,7 @@ public slots: void toggleEntityScriptServerLogDialog(); Q_INVOKABLE void showAssetServerWidget(QString filePath = ""); Q_INVOKABLE void loadAddAvatarBookmarkDialog() const; + Q_INVOKABLE void loadAvatarBrowser() const; Q_INVOKABLE SharedSoundPointer getSampleSound() const; void showDialog(const QUrl& widgetUrl, const QUrl& tabletUrl, const QString& name) const; From a48304b1047be440dbabf033270ff15325d550b5 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 12 Jan 2018 17:06:07 -0800 Subject: [PATCH 28/40] fix Asset browser for tablet --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6cabab6c01..2288bff84a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6147,7 +6147,7 @@ void Application::showAssetServerWidget(QString filePath) { if (!hmd->getShouldShowTablet() && !isHMDMode()) { DependencyManager::get()->show(url, "AssetServer", startUpload); } else { - static const QUrl url("hifi/dialogs/TabletAssetServer.qml"); + static const QUrl url("../dialogs/TabletAssetServer.qml"); tablet->pushOntoStack(url); } } From 8e4bd2d66240390d84d32b5b36e9938de3b7106b Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 12 Jan 2018 17:11:02 -0800 Subject: [PATCH 29/40] fix asset browser for tablet --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e081e80360..449b014c13 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6178,7 +6178,7 @@ void Application::showAssetServerWidget(QString filePath) { if (!hmd->getShouldShowTablet() && !isHMDMode()) { DependencyManager::get()->show(url, "AssetServer", startUpload); } else { - static const QUrl url("hifi/dialogs/TabletAssetServer.qml"); + static const QUrl url("../dialogs/TabletAssetServer.qml"); tablet->pushOntoStack(url); } } From 3e7d30366125d8ec004ac57c400680c7ca65b2b9 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 15 Jan 2018 09:18:22 -0800 Subject: [PATCH 30/40] export atp GetMappingRequest to js --- .../src/AssetScriptingInterface.cpp | 24 ++++++++++++++++++- .../src/AssetScriptingInterface.h | 18 +++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/AssetScriptingInterface.cpp b/libraries/script-engine/src/AssetScriptingInterface.cpp index 25e8c0dcf3..1c5a7ff7ba 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.cpp +++ b/libraries/script-engine/src/AssetScriptingInterface.cpp @@ -16,9 +16,11 @@ #include #include #include -#include #include +#include "ScriptEngineLogging.h" + + AssetScriptingInterface::AssetScriptingInterface(QScriptEngine* engine) : _engine(engine) { @@ -53,10 +55,30 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, QScriptValu setMappingRequest->start(); } +void AssetScriptingInterface::getMapping(QString path, QScriptValue callback) { + auto request = DependencyManager::get()->createGetMappingRequest(path); + QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable { + auto result = request->getError(); + if (callback.isFunction()) { + if (result == GetMappingRequest::NotFound) { + QScriptValueList args { "" }; + callback.call(_engine->currentContext()->thisObject(), args); + } else if (result == GetMappingRequest::NoError) { + QScriptValueList args { request->getHash() }; + callback.call(_engine->currentContext()->thisObject(), args); + } else { + qCDebug(scriptengine) << "error -- " << request->getError() << " -- " << request->getErrorString(); + } + request->deleteLater(); + } + }); + request->start(); +} void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callback) { if (!urlString.startsWith(ATP_SCHEME)) { + qCDebug(scriptengine) << "AssetScriptingInterface::downloadData url must be of form atp:"; return; } diff --git a/libraries/script-engine/src/AssetScriptingInterface.h b/libraries/script-engine/src/AssetScriptingInterface.h index 2812be65f9..0964a4f5e2 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.h +++ b/libraries/script-engine/src/AssetScriptingInterface.h @@ -75,7 +75,23 @@ public: * @param {string} error */ Q_INVOKABLE void setMapping(QString path, QString hash, QScriptValue callback); - + + /**jsdoc + * Look up a path to hash mapping within the connected domain's asset server + * @function Assets.getMapping + * @static + * @param path {string} + * @param callback {Assets~getMappingCallback} + */ + + /**jsdoc + * Called when getMapping is complete + * @callback Assets~getMappingCallback + * @param {string} assetID + */ + Q_INVOKABLE void getMapping(QString path, QScriptValue callback); + + Q_INVOKABLE void setBakingEnabled(QString path, bool enabled, QScriptValue callback); #if (PR_BUILD || DEV_BUILD) From 76048f3c308d7ca39712c18093c39a16e6eecdc2 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 15 Jan 2018 10:48:12 -0800 Subject: [PATCH 31/40] error handling --- libraries/script-engine/src/AssetScriptingInterface.cpp | 6 ++++-- libraries/script-engine/src/AssetScriptingInterface.h | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/script-engine/src/AssetScriptingInterface.cpp b/libraries/script-engine/src/AssetScriptingInterface.cpp index 1c5a7ff7ba..e0e04a1e25 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.cpp +++ b/libraries/script-engine/src/AssetScriptingInterface.cpp @@ -61,13 +61,15 @@ void AssetScriptingInterface::getMapping(QString path, QScriptValue callback) { auto result = request->getError(); if (callback.isFunction()) { if (result == GetMappingRequest::NotFound) { - QScriptValueList args { "" }; + QScriptValueList args { "", true }; callback.call(_engine->currentContext()->thisObject(), args); } else if (result == GetMappingRequest::NoError) { - QScriptValueList args { request->getHash() }; + QScriptValueList args { request->getHash(), true }; callback.call(_engine->currentContext()->thisObject(), args); } else { qCDebug(scriptengine) << "error -- " << request->getError() << " -- " << request->getErrorString(); + QScriptValueList args { "", false }; + callback.call(_engine->currentContext()->thisObject(), args); } request->deleteLater(); } diff --git a/libraries/script-engine/src/AssetScriptingInterface.h b/libraries/script-engine/src/AssetScriptingInterface.h index 0964a4f5e2..dded2ef21d 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.h +++ b/libraries/script-engine/src/AssetScriptingInterface.h @@ -85,9 +85,10 @@ public: */ /**jsdoc - * Called when getMapping is complete + * Called when getMapping is complete. * @callback Assets~getMappingCallback - * @param {string} assetID + * @param assetID {string} hash value if found, else an empty string + * @param success {boolean} false for errors other than "not found", else true */ Q_INVOKABLE void getMapping(QString path, QScriptValue callback); From f1253e3c6cdcca4c348c4a5a7e6af4560211bdf3 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 15 Jan 2018 15:01:17 -0800 Subject: [PATCH 32/40] fix crash on last frame = first frame, make last frame inclusive --- libraries/entities/src/ModelEntityItem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 3e6d19f430..46c1c9a4c7 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -267,9 +267,9 @@ void ModelEntityItem::updateFrameCount() { if (!getAnimationHold() && getAnimationIsPlaying()) { float deltaTime = (float)interval / (float)USECS_PER_SECOND; _currentFrame += (deltaTime * getAnimationFPS()); - if (_currentFrame > getAnimationLastFrame()) { - if (getAnimationLoop()) { - _currentFrame = getAnimationFirstFrame() + (int)(glm::floor(_currentFrame - getAnimationFirstFrame())) % (updatedFrameCount - 1); + if (_currentFrame > getAnimationLastFrame() + 1) { + if (getAnimationLoop() && getAnimationFirstFrame() != getAnimationLastFrame()) { + _currentFrame = getAnimationFirstFrame() + (int)(_currentFrame - getAnimationFirstFrame()) % updatedFrameCount; } else { _currentFrame = getAnimationLastFrame(); } From 9d721ba605529b4acfce121eb28b1dca9491955c Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 15 Jan 2018 15:01:17 -0800 Subject: [PATCH 33/40] fix crash on last frame = first frame, make last frame inclusive (cherry picked from commit f1253e3c6cdcca4c348c4a5a7e6af4560211bdf3) --- libraries/entities/src/ModelEntityItem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 3e6d19f430..46c1c9a4c7 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -267,9 +267,9 @@ void ModelEntityItem::updateFrameCount() { if (!getAnimationHold() && getAnimationIsPlaying()) { float deltaTime = (float)interval / (float)USECS_PER_SECOND; _currentFrame += (deltaTime * getAnimationFPS()); - if (_currentFrame > getAnimationLastFrame()) { - if (getAnimationLoop()) { - _currentFrame = getAnimationFirstFrame() + (int)(glm::floor(_currentFrame - getAnimationFirstFrame())) % (updatedFrameCount - 1); + if (_currentFrame > getAnimationLastFrame() + 1) { + if (getAnimationLoop() && getAnimationFirstFrame() != getAnimationLastFrame()) { + _currentFrame = getAnimationFirstFrame() + (int)(_currentFrame - getAnimationFirstFrame()) % updatedFrameCount; } else { _currentFrame = getAnimationLastFrame(); } From a1415e28ff97e3744e27bea1662022056304cf8e Mon Sep 17 00:00:00 2001 From: Nissim Hadar Date: Mon, 15 Jan 2018 15:11:10 -0800 Subject: [PATCH 34/40] If there is neither a skybox URL nor an ambient light uRL, then set the ambient mode to inherit. --- libraries/entities/src/EntityTree.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 907426c922..15fc3256bd 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2283,30 +2283,35 @@ bool EntityTree::readFromMap(QVariantMap& map) { properties.setOwningAvatarID(myNodeID); } - // Fix for older content not containing these fields in the zones + // Fix for older content not containing mode fields in the zones if (needsConversion && (properties.getType() == EntityTypes::EntityType::Zone)) { + // The legacy version had no keylight mode - this is set to on + properties.setKeyLightMode(COMPONENT_MODE_ENABLED); + // The ambient URL has been moved from "keyLight" to "ambientLight" if (entityMap.contains("keyLight")) { QVariantMap keyLightObject = entityMap["keyLight"].toMap(); properties.getAmbientLight().setAmbientURL(keyLightObject["ambientURL"].toString()); } + // Copy the skybox URL if the ambient URL is empty, as this is the legacy behaviour + // Use skybox value only if it is not empty, else set ambientMode to inherit (to use default URL) + properties.setAmbientLightMode(COMPONENT_MODE_ENABLED); + if (properties.getAmbientLight().getAmbientURL() == "") { + if (properties.getSkybox().getURL() != "") { + properties.getAmbientLight().setAmbientURL(properties.getSkybox().getURL()); + } else { + properties.setAmbientLightMode(COMPONENT_MODE_INHERIT); + } + } + // The background should be enabled if the mode is skybox // Note that if the values are default then they are not stored in the JSON file if (entityMap.contains("backgroundMode") && (entityMap["backgroundMode"].toString() == "skybox")) { properties.setSkyboxMode(COMPONENT_MODE_ENABLED); - - // Copy the skybox URL if the ambient URL is empty, as this is the legacy behaviour - if (properties.getAmbientLight().getAmbientURL() == "") { - properties.getAmbientLight().setAmbientURL(properties.getSkybox().getURL()); - } - } else { + } else { properties.setSkyboxMode(COMPONENT_MODE_INHERIT); } - - // The legacy version had no keylight/ambient modes - these are always on - properties.setKeyLightMode(COMPONENT_MODE_ENABLED); - properties.setAmbientLightMode(COMPONENT_MODE_ENABLED); } EntityItemPointer entity = addEntity(entityItemID, properties); From 67218a697b461ec94f071a8fa02f80fe74161e5c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jan 2018 14:01:20 +1300 Subject: [PATCH 35/40] Support FBX files that have nodes with non-XYZ rotation order --- libraries/fbx/src/FBXReader.cpp | 65 +++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 659d6dfa1e..42d25c96ea 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -148,6 +148,59 @@ glm::vec3 parseVec3(const QString& string) { return value; } +enum RotationOrder { + OrderXYZ = 0, + OrderXZY, + OrderYZX, + OrderYXZ, + OrderZXY, + OrderZYX, + OrderSphericXYZ +}; + +bool haveReportedUnhandledRotationOrder = false; // Report error only once per FBX file. + +glm::vec3 convertRotationToXYZ(int rotationOrder, const glm::vec3& rotation) { + // Convert rotation with given rotation order to have order XYZ. + if (rotationOrder == OrderXYZ) { + return rotation; + } + + glm::quat xyzRotation; + + switch (rotationOrder) { + case OrderXZY: + xyzRotation = glm::quat(glm::radians(glm::vec3(0, rotation.y, 0))) + * (glm::quat(glm::radians(glm::vec3(0, 0, rotation.z))) * glm::quat(glm::radians(glm::vec3(rotation.x, 0, 0)))); + break; + case OrderYZX: + xyzRotation = glm::quat(glm::radians(glm::vec3(rotation.x, 0, 0))) + * (glm::quat(glm::radians(glm::vec3(0, 0, rotation.z))) * glm::quat(glm::radians(glm::vec3(0, rotation.y, 0)))); + break; + case OrderYXZ: + xyzRotation = glm::quat(glm::radians(glm::vec3(0, 0, rotation.z))) + * (glm::quat(glm::radians(glm::vec3(rotation.x, 0, 0))) * glm::quat(glm::radians(glm::vec3(0, rotation.y, 0)))); + break; + case OrderZXY: + xyzRotation = glm::quat(glm::radians(glm::vec3(0, rotation.y, 0))) + * (glm::quat(glm::radians(glm::vec3(rotation.x, 0, 0))) * glm::quat(glm::radians(glm::vec3(0, 0, rotation.z)))); + break; + case OrderZYX: + xyzRotation = glm::quat(glm::radians(glm::vec3(rotation.x, 0, 0))) + * (glm::quat(glm::radians(glm::vec3(0, rotation.y, 0))) * glm::quat(glm::radians(glm::vec3(0, 0, rotation.z)))); + break; + default: + // FIXME: Handle OrderSphericXYZ. + if (!haveReportedUnhandledRotationOrder) { + qCDebug(modelformat) << "ERROR: Unhandled rotation order in FBX file:" << rotationOrder; + haveReportedUnhandledRotationOrder = true; + } + return rotation; + } + + return glm::degrees(safeEulerAngles(xyzRotation)); +} + QString processID(const QString& id) { // Blender (at least) prepends a type to the ID, so strip it out return id.mid(id.lastIndexOf(':') + 1); @@ -630,6 +683,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS glm::vec3 ambientColor; QString hifiGlobalNodeID; unsigned int meshIndex = 0; + haveReportedUnhandledRotationOrder = false; foreach (const FBXNode& child, node.children) { if (child.name == "FBXHeaderExtension") { @@ -731,6 +785,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS glm::vec3 translation; // NOTE: the euler angles as supplied by the FBX file are in degrees glm::vec3 rotationOffset; + int rotationOrder = OrderXYZ; // Default rotation order set in "Definitions" node is assumed to be XYZ. glm::vec3 preRotation, rotation, postRotation; glm::vec3 scale = glm::vec3(1.0f, 1.0f, 1.0f); glm::vec3 scalePivot, rotationPivot, scaleOffset; @@ -764,6 +819,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS index = 4; } if (properties) { + static const QVariant ROTATION_ORDER = QByteArray("RotationOrder"); static const QVariant GEOMETRIC_TRANSLATION = QByteArray("GeometricTranslation"); static const QVariant GEOMETRIC_ROTATION = QByteArray("GeometricRotation"); static const QVariant GEOMETRIC_SCALING = QByteArray("GeometricScaling"); @@ -790,6 +846,9 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS if (childProperty == LCL_TRANSLATION) { translation = getVec3(property.properties, index); + } else if (childProperty == ROTATION_ORDER) { + rotationOrder = property.properties.at(index).toInt(); + } else if (childProperty == ROTATION_OFFSET) { rotationOffset = getVec3(property.properties, index); @@ -797,13 +856,13 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS rotationPivot = getVec3(property.properties, index); } else if (childProperty == PRE_ROTATION) { - preRotation = getVec3(property.properties, index); + preRotation = convertRotationToXYZ(rotationOrder, getVec3(property.properties, index)); } else if (childProperty == LCL_ROTATION) { - rotation = getVec3(property.properties, index); + rotation = convertRotationToXYZ(rotationOrder, getVec3(property.properties, index)); } else if (childProperty == POST_ROTATION) { - postRotation = getVec3(property.properties, index); + postRotation = convertRotationToXYZ(rotationOrder, getVec3(property.properties, index)); } else if (childProperty == SCALING_PIVOT) { scalePivot = getVec3(property.properties, index); From daa6409936b2a82e6e46a2ff650cce034bc5c50f Mon Sep 17 00:00:00 2001 From: Nissim Hadar Date: Mon, 15 Jan 2018 17:33:48 -0800 Subject: [PATCH 36/40] Improved comments. --- .../src/RenderableZoneEntityItem.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 3ecce5ec38..4913dd60fc 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -162,28 +162,31 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) { } if (_visible) { - // Finally, push the light visible in the frame + // Finally, push the lights visible in the frame + // + // If component is disabled then push component off state + // else if component is enabled then push current state + // (else mode is inherit, the value from the parent zone will be used + // if (_keyLightMode == COMPONENT_MODE_DISABLED) { _stage->_currentFrame.pushSunLight(_stage->getSunOffLight()); } else if (_keyLightMode == COMPONENT_MODE_ENABLED) { _stage->_currentFrame.pushSunLight(_sunIndex); } - // The background only if the mode is not inherit if (_skyboxMode == COMPONENT_MODE_DISABLED) { _backgroundStage->_currentFrame.pushBackground(INVALID_INDEX); } else if (_skyboxMode == COMPONENT_MODE_ENABLED) { _backgroundStage->_currentFrame.pushBackground(_backgroundIndex); } - // The ambient light only if it has a valid texture to render with if (_ambientLightMode == COMPONENT_MODE_DISABLED) { _stage->_currentFrame.pushAmbientLight(_stage->getAmbientOffLight()); } else if (_ambientLightMode == COMPONENT_MODE_ENABLED) { _stage->_currentFrame.pushAmbientLight(_ambientIndex); } - // Haze only if the mode is not inherit + // Haze only if the mode is not inherit, as the model deals with on/off if (_hazeMode != COMPONENT_MODE_INHERIT) { _hazeStage->_currentFrame.pushHaze(_hazeIndex); } From 02179e3efd3793c0824bf31d9c489fe0a03ee3cd Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 16 Jan 2018 17:14:30 +1300 Subject: [PATCH 37/40] Doc review --- libraries/networking/src/AddressManager.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 2c342a1b93..89bcb434ca 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -183,6 +183,7 @@ public slots: * "127.0.0.1" or "localhost"), a domain name, a named path on a domain (starts with * "/"), a position or position and orientation, or a user (starts with "@"). * @param {boolean} fromSuggestions=false - Set to true if the address is obtained from the "Goto" dialog. + * Helps ensure that user's location history is correctly maintained. */ void handleLookupString(const QString& lookupString, bool fromSuggestions = false); @@ -217,14 +218,16 @@ public slots: * Go to the local Sandbox server that's running on the same PC as Interface. * @function location.goToLocalSandbox * @param {string} path="" - The position and orientation to go to (e.g., "/0,0,0"). - * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. + * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. Helps ensure that user's + * location history is correctly maintained. */ void goToLocalSandbox(QString path = "", LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(SANDBOX_HIFI_ADDRESS + path, trigger); } /**jsdoc - * Go to the default metaverse address. + * Go to the default "welcome" metaverse address. * @function location.goToEntry - * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. + * @param {location.LookupTrigger} trigger=StartupFromSettings - The reason for the function call. Helps ensure that user's + * location history is correctly maintained. */ void goToEntry(LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(DEFAULT_HIFI_ADDRESS, trigger); } @@ -238,7 +241,7 @@ public slots: void goToUser(const QString& username, bool shouldMatchOrientation = true); /**jsdoc - * Refresh the current address, e.g., after connecting to a domain ion order to position the user to the desired location. + * Refresh the current address, e.g., after connecting to a domain in order to position the user to the desired location. * @function location.refreshPreviousLookup * @deprecated This function is deprecated and will be removed. */ @@ -247,7 +250,8 @@ public slots: void refreshPreviousLookup(); /**jsdoc - * Save your current metaverse location in Interface's settings file. + * Update your current metaverse location in Interface's {@link Settings} file as your last-know address. This can be used + * to ensure that you start up at that address if you exit Interface without a later address automatically being saved. * @function location.storeCurrentAddress */ void storeCurrentAddress(); From 08ccda9cfcc33cbd015ec501aac05a95cf2f5f20 Mon Sep 17 00:00:00 2001 From: humbletim Date: Tue, 16 Jan 2018 12:44:44 -0500 Subject: [PATCH 38/40] rename libraries/model(src/model) -> libraries/graphics(src/graphics) --- android/app/CMakeLists.txt | 2 +- assignment-client/CMakeLists.txt | 2 +- interface/CMakeLists.txt | 2 +- interface/src/Application.h | 2 +- libraries/animation/CMakeLists.txt | 2 +- libraries/avatars-renderer/CMakeLists.txt | 4 ++-- libraries/baking/CMakeLists.txt | 2 +- libraries/display-plugins/CMakeLists.txt | 2 +- libraries/entities-renderer/CMakeLists.txt | 4 ++-- .../entities-renderer/src/RenderablePolyVoxEntityItem.cpp | 2 +- .../entities-renderer/src/RenderablePolyVoxEntityItem.h | 4 ++-- .../entities-renderer/src/RenderableZoneEntityItem.cpp | 2 +- libraries/entities-renderer/src/RenderableZoneEntityItem.h | 6 +++--- libraries/entities-renderer/src/polyvox.slf | 2 +- libraries/entities-renderer/src/polyvox_fade.slf | 2 +- libraries/entities/CMakeLists.txt | 2 +- libraries/fbx/CMakeLists.txt | 2 +- libraries/fbx/src/FBX.h | 4 ++-- libraries/fbx/src/FBXReader.h | 4 ++-- libraries/fbx/src/OBJWriter.cpp | 2 +- libraries/fbx/src/OBJWriter.h | 2 +- libraries/{model => graphics}/CMakeLists.txt | 4 ++-- .../{model/src/model => graphics/src/graphics}/Asset.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Asset.h | 2 +- .../{model/src/model => graphics/src/graphics}/Forward.h | 2 +- .../{model/src/model => graphics/src/graphics}/Geometry.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Geometry.h | 2 +- .../src/graphics/GraphicsLogging.cpp} | 4 ++-- .../src/graphics/GraphicsLogging.h} | 4 ++-- .../{model/src/model => graphics/src/graphics}/Haze.cpp | 2 +- libraries/{model/src/model => graphics/src/graphics}/Haze.h | 2 +- .../{model/src/model => graphics/src/graphics}/Light.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Light.h | 2 +- .../{model/src/model => graphics/src/graphics}/Light.slh | 6 +++--- .../src/graphics}/LightIrradiance.shared.slh | 0 .../model => graphics/src/graphics}/LightVolume.shared.slh | 2 +- .../{model/src/model => graphics/src/graphics}/Material.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Material.h | 2 +- .../{model/src/model => graphics/src/graphics}/Material.slh | 0 .../{model/src/model => graphics/src/graphics}/Skybox.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Skybox.h | 2 +- .../src/graphics}/SphericalHarmonics.shared.slh | 2 +- .../{model/src/model => graphics/src/graphics}/Stage.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/Stage.h | 2 +- .../src/model => graphics/src/graphics}/TextureMap.cpp | 2 +- .../{model/src/model => graphics/src/graphics}/TextureMap.h | 2 +- .../{model/src/model => graphics/src/graphics}/skybox.slf | 0 .../{model/src/model => graphics/src/graphics}/skybox.slv | 0 libraries/model-networking/CMakeLists.txt | 2 +- .../model-networking/src/model-networking/ModelCache.h | 4 ++-- .../src/model-networking/SimpleMeshProxy.cpp | 2 +- .../model-networking/src/model-networking/TextureCache.h | 2 +- libraries/physics/CMakeLists.txt | 2 +- libraries/physics/src/CollisionRenderMeshCache.h | 2 +- libraries/procedural/CMakeLists.txt | 4 ++-- libraries/procedural/src/procedural/ProceduralSkybox.cpp | 4 ++-- libraries/procedural/src/procedural/ProceduralSkybox.h | 2 +- libraries/render-utils/CMakeLists.txt | 4 ++-- libraries/render-utils/src/BackgroundStage.h | 2 +- libraries/render-utils/src/DeferredGlobalLight.slh | 2 +- libraries/render-utils/src/DeferredLightingEffect.h | 4 ++-- libraries/render-utils/src/DrawHaze.h | 2 +- libraries/render-utils/src/ForwardGlobalLight.slh | 2 +- libraries/render-utils/src/GeometryCache.cpp | 2 +- libraries/render-utils/src/GeometryCache.h | 4 ++-- libraries/render-utils/src/Haze.slf | 2 +- libraries/render-utils/src/HazeStage.h | 4 ++-- libraries/render-utils/src/LightPayload.h | 2 +- libraries/render-utils/src/LightStage.h | 2 +- libraries/render-utils/src/MeshPartPayload.h | 2 +- libraries/render-utils/src/StencilMaskPass.cpp | 2 +- libraries/render-utils/src/StencilMaskPass.h | 2 +- libraries/render-utils/src/deferred_light_point.slv | 2 +- libraries/render-utils/src/deferred_light_spot.slv | 2 +- libraries/render-utils/src/forward_model.slf | 2 +- libraries/render-utils/src/forward_model_normal_map.slf | 2 +- .../render-utils/src/forward_model_normal_specular_map.slf | 2 +- libraries/render-utils/src/forward_model_specular_map.slf | 2 +- libraries/render-utils/src/forward_model_translucent.slf | 2 +- libraries/render-utils/src/forward_model_unlit.slf | 2 +- .../render-utils/src/lightClusters_drawClusterContent.slf | 2 +- libraries/render-utils/src/local_lights_drawOutline.slf | 2 +- libraries/render-utils/src/local_lights_shading.slf | 2 +- libraries/render-utils/src/model.slf | 2 +- libraries/render-utils/src/model_fade.slf | 2 +- libraries/render-utils/src/model_lightmap.slf | 2 +- libraries/render-utils/src/model_lightmap_fade.slf | 2 +- libraries/render-utils/src/model_lightmap_normal_map.slf | 2 +- .../render-utils/src/model_lightmap_normal_map_fade.slf | 2 +- .../render-utils/src/model_lightmap_normal_specular_map.slf | 2 +- .../src/model_lightmap_normal_specular_map_fade.slf | 2 +- libraries/render-utils/src/model_lightmap_specular_map.slf | 2 +- .../render-utils/src/model_lightmap_specular_map_fade.slf | 2 +- libraries/render-utils/src/model_normal_map.slf | 2 +- libraries/render-utils/src/model_normal_map_fade.slf | 2 +- libraries/render-utils/src/model_normal_specular_map.slf | 2 +- .../render-utils/src/model_normal_specular_map_fade.slf | 2 +- libraries/render-utils/src/model_specular_map.slf | 2 +- libraries/render-utils/src/model_specular_map_fade.slf | 2 +- libraries/render-utils/src/model_translucent.slf | 2 +- libraries/render-utils/src/model_translucent_fade.slf | 2 +- libraries/render-utils/src/model_translucent_unlit.slf | 2 +- libraries/render-utils/src/model_translucent_unlit_fade.slf | 2 +- libraries/render-utils/src/model_unlit.slf | 2 +- libraries/render-utils/src/model_unlit_fade.slf | 2 +- libraries/render-utils/src/overlay3D.slf | 2 +- libraries/render-utils/src/overlay3D_model.slf | 2 +- libraries/render-utils/src/overlay3D_model_translucent.slf | 2 +- .../render-utils/src/overlay3D_model_translucent_unlit.slf | 2 +- libraries/render-utils/src/overlay3D_model_unlit.slf | 2 +- libraries/render-utils/src/overlay3D_translucent.slf | 2 +- libraries/render-utils/src/simple.slf | 2 +- libraries/render-utils/src/simple_fade.slf | 2 +- libraries/render-utils/src/simple_textured.slf | 2 +- libraries/render-utils/src/simple_textured_fade.slf | 2 +- .../src/subsurfaceScattering_drawScattering.slf | 2 +- libraries/render-utils/src/zone_drawAmbient.slf | 2 +- libraries/render-utils/src/zone_drawKeyLight.slf | 2 +- libraries/render/CMakeLists.txt | 4 ++-- libraries/render/src/render/Item.h | 2 +- libraries/script-engine/CMakeLists.txt | 2 +- libraries/script-engine/src/SceneScriptingInterface.h | 2 +- plugins/openvr/CMakeLists.txt | 2 +- plugins/openvr/src/ViveControllerManager.h | 2 +- tests/animation/CMakeLists.txt | 2 +- tests/entities/CMakeLists.txt | 2 +- tests/gpu-test/CMakeLists.txt | 4 ++-- tests/octree/CMakeLists.txt | 2 +- tests/physics/CMakeLists.txt | 2 +- tests/render-perf/CMakeLists.txt | 2 +- tests/render-perf/src/main.cpp | 2 +- tests/render-texture-load/CMakeLists.txt | 2 +- tests/shaders/CMakeLists.txt | 4 ++-- tests/shaders/src/main.cpp | 4 ++-- tools/oven/CMakeLists.txt | 2 +- tools/skeleton-dump/CMakeLists.txt | 2 +- tools/vhacd-util/CMakeLists.txt | 2 +- 137 files changed, 156 insertions(+), 156 deletions(-) rename libraries/{model => graphics}/CMakeLists.txt (50%) rename libraries/{model/src/model => graphics/src/graphics}/Asset.cpp (90%) rename libraries/{model/src/model => graphics/src/graphics}/Asset.h (98%) rename libraries/{model/src/model => graphics/src/graphics}/Forward.h (92%) rename libraries/{model/src/model => graphics/src/graphics}/Geometry.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Geometry.h (99%) rename libraries/{model/src/model/ModelLogging.cpp => graphics/src/graphics/GraphicsLogging.cpp} (75%) rename libraries/{model/src/model/ModelLogging.h => graphics/src/graphics/GraphicsLogging.h} (81%) rename libraries/{model/src/model => graphics/src/graphics}/Haze.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Haze.h (99%) rename libraries/{model/src/model => graphics/src/graphics}/Light.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Light.h (99%) rename libraries/{model/src/model => graphics/src/graphics}/Light.slh (93%) rename libraries/{model/src/model => graphics/src/graphics}/LightIrradiance.shared.slh (100%) rename libraries/{model/src/model => graphics/src/graphics}/LightVolume.shared.slh (98%) rename libraries/{model/src/model => graphics/src/graphics}/Material.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Material.h (99%) rename libraries/{model/src/model => graphics/src/graphics}/Material.slh (100%) rename libraries/{model/src/model => graphics/src/graphics}/Skybox.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Skybox.h (97%) rename libraries/{model/src/model => graphics/src/graphics}/SphericalHarmonics.shared.slh (97%) rename libraries/{model/src/model => graphics/src/graphics}/Stage.cpp (99%) rename libraries/{model/src/model => graphics/src/graphics}/Stage.h (99%) rename libraries/{model/src/model => graphics/src/graphics}/TextureMap.cpp (96%) rename libraries/{model/src/model => graphics/src/graphics}/TextureMap.h (97%) rename libraries/{model/src/model => graphics/src/graphics}/skybox.slf (100%) rename libraries/{model/src/model => graphics/src/graphics}/skybox.slv (100%) diff --git a/android/app/CMakeLists.txt b/android/app/CMakeLists.txt index 4411b7b1bb..5682611151 100644 --- a/android/app/CMakeLists.txt +++ b/android/app/CMakeLists.txt @@ -11,7 +11,7 @@ link_hifi_libraries( physics audio audio-client ui midi controllers pointers - model model-networking fbx animation + graphics model-networking fbx animation entities entities-renderer avatars avatars-renderer ui-plugins input-plugins diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index e657587a7a..acdc1cbc53 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -11,7 +11,7 @@ setup_memory_debugger() # link in the shared libraries link_hifi_libraries( - audio avatars octree gpu model fbx entities + audio avatars octree gpu graphics fbx entities networking animation recording shared script-engine embedded-webserver controllers physics plugins midi image ) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 6b78826d75..21225756b4 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -201,7 +201,7 @@ endif() # link required hifi libraries link_hifi_libraries( - shared octree ktx gpu gl procedural model render + shared octree ktx gpu gl procedural graphics render pointers recording fbx networking model-networking entities avatars trackers audio audio-client animation script-engine physics diff --git a/interface/src/Application.h b/interface/src/Application.h index effb35caee..6b70e88b89 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -71,7 +71,7 @@ #include "UndoStackScriptingInterface.h" #include -#include +#include #include #include "FrameTimingsScriptingInterface.h" diff --git a/libraries/animation/CMakeLists.txt b/libraries/animation/CMakeLists.txt index b9fef19fbb..1ec6194afd 100644 --- a/libraries/animation/CMakeLists.txt +++ b/libraries/animation/CMakeLists.txt @@ -1,6 +1,6 @@ set(TARGET_NAME animation) setup_hifi_library(Network Script) -link_hifi_libraries(shared model fbx) +link_hifi_libraries(shared graphics fbx) include_hifi_library_headers(networking) include_hifi_library_headers(gpu) diff --git a/libraries/avatars-renderer/CMakeLists.txt b/libraries/avatars-renderer/CMakeLists.txt index 148835965e..53edc692f2 100644 --- a/libraries/avatars-renderer/CMakeLists.txt +++ b/libraries/avatars-renderer/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME avatars-renderer) -AUTOSCRIBE_SHADER_LIB(gpu model render render-utils) +AUTOSCRIBE_SHADER_LIB(gpu graphics render render-utils) setup_hifi_library(Widgets Network Script) -link_hifi_libraries(shared gpu model animation model-networking script-engine render render-utils image trackers entities-renderer) +link_hifi_libraries(shared gpu graphics animation model-networking script-engine render render-utils image trackers entities-renderer) include_hifi_library_headers(avatars) include_hifi_library_headers(networking) include_hifi_library_headers(fbx) diff --git a/libraries/baking/CMakeLists.txt b/libraries/baking/CMakeLists.txt index 66cf791776..ec7caf574b 100644 --- a/libraries/baking/CMakeLists.txt +++ b/libraries/baking/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME baking) setup_hifi_library(Concurrent) -link_hifi_libraries(shared model networking ktx image fbx) +link_hifi_libraries(shared graphics networking ktx image fbx) include_hifi_library_headers(gpu) add_dependency_external_projects(draco) diff --git a/libraries/display-plugins/CMakeLists.txt b/libraries/display-plugins/CMakeLists.txt index 1fd855e6aa..1d9d42d579 100644 --- a/libraries/display-plugins/CMakeLists.txt +++ b/libraries/display-plugins/CMakeLists.txt @@ -5,7 +5,7 @@ link_hifi_libraries(shared plugins ui-plugins gl ui render-utils ${PLATFORM_GL_B include_hifi_library_headers(gpu) include_hifi_library_headers(model-networking) include_hifi_library_headers(networking) -include_hifi_library_headers(model) +include_hifi_library_headers(graphics) include_hifi_library_headers(fbx) include_hifi_library_headers(image) include_hifi_library_headers(ktx) diff --git a/libraries/entities-renderer/CMakeLists.txt b/libraries/entities-renderer/CMakeLists.txt index 19987197b8..ea75367e1e 100644 --- a/libraries/entities-renderer/CMakeLists.txt +++ b/libraries/entities-renderer/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME entities-renderer) -AUTOSCRIBE_SHADER_LIB(gpu model procedural render render-utils) +AUTOSCRIBE_SHADER_LIB(gpu graphics procedural render render-utils) setup_hifi_library(Widgets Network Script) -link_hifi_libraries(shared gpu procedural model model-networking script-engine render render-utils image ui pointers) +link_hifi_libraries(shared gpu procedural graphics model-networking script-engine render render-utils image ui pointers) include_hifi_library_headers(networking) include_hifi_library_headers(gl) include_hifi_library_headers(ktx) diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp index ad0202457e..365ba5189a 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp @@ -65,7 +65,7 @@ #pragma warning(pop) #endif -#include "model/Geometry.h" +#include "graphics/Geometry.h" #include "StencilMaskPass.h" diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h index 6ac518f79b..8dbe1dd0f1 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 3ecce5ec38..4161b65ead 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.h b/libraries/entities-renderer/src/RenderableZoneEntityItem.h index 3174f00f4f..e1f696ca89 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.h +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.h @@ -13,9 +13,9 @@ #define hifi_RenderableZoneEntityItem_h #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/libraries/entities-renderer/src/polyvox.slf b/libraries/entities-renderer/src/polyvox.slf index 56f6f31d71..50034db48c 100644 --- a/libraries/entities-renderer/src/polyvox.slf +++ b/libraries/entities-renderer/src/polyvox.slf @@ -11,7 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include DeferredBufferWrite.slh@> in vec3 _normal; diff --git a/libraries/entities-renderer/src/polyvox_fade.slf b/libraries/entities-renderer/src/polyvox_fade.slf index 7af43be53f..4c179a15b6 100644 --- a/libraries/entities-renderer/src/polyvox_fade.slf +++ b/libraries/entities-renderer/src/polyvox_fade.slf @@ -11,7 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include DeferredBufferWrite.slh@> <@include Fade.slh@> diff --git a/libraries/entities/CMakeLists.txt b/libraries/entities/CMakeLists.txt index c23740654e..d6d9058e44 100644 --- a/libraries/entities/CMakeLists.txt +++ b/libraries/entities/CMakeLists.txt @@ -1,4 +1,4 @@ set(TARGET_NAME entities) setup_hifi_library(Network Script) include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") -link_hifi_libraries(shared networking octree avatars model) +link_hifi_libraries(shared networking octree avatars graphics) diff --git a/libraries/fbx/CMakeLists.txt b/libraries/fbx/CMakeLists.txt index 683ddb52f7..e422af3629 100644 --- a/libraries/fbx/CMakeLists.txt +++ b/libraries/fbx/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME fbx) setup_hifi_library() -link_hifi_libraries(shared model networking image) +link_hifi_libraries(shared graphics networking image) include_hifi_library_headers(gpu image) target_draco() diff --git a/libraries/fbx/src/FBX.h b/libraries/fbx/src/FBX.h index 50d40c35ac..21f8fe51aa 100644 --- a/libraries/fbx/src/FBX.h +++ b/libraries/fbx/src/FBX.h @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include static const QByteArray FBX_BINARY_PROLOG = "Kaydara FBX Binary "; static const int FBX_HEADER_BYTES_BEFORE_VERSION = 23; diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h index 34d63b098a..e446861627 100644 --- a/libraries/fbx/src/FBXReader.h +++ b/libraries/fbx/src/FBXReader.h @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include class QIODevice; class FBXNode; diff --git a/libraries/fbx/src/OBJWriter.cpp b/libraries/fbx/src/OBJWriter.cpp index e0d3d36b06..42ef2be646 100644 --- a/libraries/fbx/src/OBJWriter.cpp +++ b/libraries/fbx/src/OBJWriter.cpp @@ -11,7 +11,7 @@ #include #include -#include "model/Geometry.h" +#include "graphics/Geometry.h" #include "OBJWriter.h" #include "ModelFormatLogging.h" diff --git a/libraries/fbx/src/OBJWriter.h b/libraries/fbx/src/OBJWriter.h index b6e20e1ae6..7f8b0ddbed 100644 --- a/libraries/fbx/src/OBJWriter.h +++ b/libraries/fbx/src/OBJWriter.h @@ -15,7 +15,7 @@ #include #include -#include +#include using MeshPointer = std::shared_ptr; diff --git a/libraries/model/CMakeLists.txt b/libraries/graphics/CMakeLists.txt similarity index 50% rename from libraries/model/CMakeLists.txt rename to libraries/graphics/CMakeLists.txt index da85b6aa3d..2b15604fdf 100755 --- a/libraries/model/CMakeLists.txt +++ b/libraries/graphics/CMakeLists.txt @@ -1,4 +1,4 @@ -set(TARGET_NAME model) -AUTOSCRIBE_SHADER_LIB(gpu model) +set(TARGET_NAME graphics) +AUTOSCRIBE_SHADER_LIB(gpu graphics) setup_hifi_library() link_hifi_libraries(shared ktx gpu image) \ No newline at end of file diff --git a/libraries/model/src/model/Asset.cpp b/libraries/graphics/src/graphics/Asset.cpp similarity index 90% rename from libraries/model/src/model/Asset.cpp rename to libraries/graphics/src/graphics/Asset.cpp index d839dad809..84d7560257 100644 --- a/libraries/model/src/model/Asset.cpp +++ b/libraries/graphics/src/graphics/Asset.cpp @@ -1,6 +1,6 @@ // // Asset.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 08/21/2015. // Copyright 2015 High Fidelity, Inc. diff --git a/libraries/model/src/model/Asset.h b/libraries/graphics/src/graphics/Asset.h similarity index 98% rename from libraries/model/src/model/Asset.h rename to libraries/graphics/src/graphics/Asset.h index 51fc177538..c2e4ff3d3a 100644 --- a/libraries/model/src/model/Asset.h +++ b/libraries/graphics/src/graphics/Asset.h @@ -1,6 +1,6 @@ // // Asset.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 08/21/2015. // Copyright 2015 High Fidelity, Inc. diff --git a/libraries/model/src/model/Forward.h b/libraries/graphics/src/graphics/Forward.h similarity index 92% rename from libraries/model/src/model/Forward.h rename to libraries/graphics/src/graphics/Forward.h index 90f55fa64f..7f728b44fc 100644 --- a/libraries/model/src/model/Forward.h +++ b/libraries/graphics/src/graphics/Forward.h @@ -1,6 +1,6 @@ // // Forward.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Bradley Austin Davis on 2017/06/21 // Copyright 2013-2017 High Fidelity, Inc. diff --git a/libraries/model/src/model/Geometry.cpp b/libraries/graphics/src/graphics/Geometry.cpp similarity index 99% rename from libraries/model/src/model/Geometry.cpp rename to libraries/graphics/src/graphics/Geometry.cpp index 210b4ae8f3..930449c5e6 100755 --- a/libraries/model/src/model/Geometry.cpp +++ b/libraries/graphics/src/graphics/Geometry.cpp @@ -1,6 +1,6 @@ // // Geometry.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 12/5/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Geometry.h b/libraries/graphics/src/graphics/Geometry.h similarity index 99% rename from libraries/model/src/model/Geometry.h rename to libraries/graphics/src/graphics/Geometry.h index 260de313ab..510cf54742 100755 --- a/libraries/model/src/model/Geometry.h +++ b/libraries/graphics/src/graphics/Geometry.h @@ -1,6 +1,6 @@ // // Geometry.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 12/5/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/ModelLogging.cpp b/libraries/graphics/src/graphics/GraphicsLogging.cpp similarity index 75% rename from libraries/model/src/model/ModelLogging.cpp rename to libraries/graphics/src/graphics/GraphicsLogging.cpp index 3b3fbed82c..9c46e89331 100644 --- a/libraries/model/src/model/ModelLogging.cpp +++ b/libraries/graphics/src/graphics/GraphicsLogging.cpp @@ -6,6 +6,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "ModelLogging.h" +#include "GraphicsLogging.h" -Q_LOGGING_CATEGORY(modelLog, "hifi.model") \ No newline at end of file +Q_LOGGING_CATEGORY(graphicsLog, "hifi.graphics") diff --git a/libraries/model/src/model/ModelLogging.h b/libraries/graphics/src/graphics/GraphicsLogging.h similarity index 81% rename from libraries/model/src/model/ModelLogging.h rename to libraries/graphics/src/graphics/GraphicsLogging.h index 33ed6fb059..29e3a7ffcd 100644 --- a/libraries/model/src/model/ModelLogging.h +++ b/libraries/graphics/src/graphics/GraphicsLogging.h @@ -1,5 +1,5 @@ // -// ModelLogging.h +// GraphicsLogging.h // hifi // // Created by Sam Gateau on 9/20/15. @@ -11,4 +11,4 @@ #include -Q_DECLARE_LOGGING_CATEGORY(modelLog) +Q_DECLARE_LOGGING_CATEGORY(graphicsLog) diff --git a/libraries/model/src/model/Haze.cpp b/libraries/graphics/src/graphics/Haze.cpp similarity index 99% rename from libraries/model/src/model/Haze.cpp rename to libraries/graphics/src/graphics/Haze.cpp index b56932e131..dd07afc6d6 100644 --- a/libraries/model/src/model/Haze.cpp +++ b/libraries/graphics/src/graphics/Haze.cpp @@ -1,6 +1,6 @@ // // Haze.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Nissim Hadar on 9/13/2017. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Haze.h b/libraries/graphics/src/graphics/Haze.h similarity index 99% rename from libraries/model/src/model/Haze.h rename to libraries/graphics/src/graphics/Haze.h index 2a575eb151..260f5f0097 100644 --- a/libraries/model/src/model/Haze.h +++ b/libraries/graphics/src/graphics/Haze.h @@ -1,6 +1,6 @@ // // MakeHaze.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Nissim Hadar on 9/13/2017. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Light.cpp b/libraries/graphics/src/graphics/Light.cpp similarity index 99% rename from libraries/model/src/model/Light.cpp rename to libraries/graphics/src/graphics/Light.cpp index 19da084f84..8b6aae7759 100755 --- a/libraries/model/src/model/Light.cpp +++ b/libraries/graphics/src/graphics/Light.cpp @@ -1,6 +1,6 @@ // // Light.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 1/26/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Light.h b/libraries/graphics/src/graphics/Light.h similarity index 99% rename from libraries/model/src/model/Light.h rename to libraries/graphics/src/graphics/Light.h index 4c82eb5d77..58d5c0cf2a 100755 --- a/libraries/model/src/model/Light.h +++ b/libraries/graphics/src/graphics/Light.h @@ -1,6 +1,6 @@ // // Light.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 12/10/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Light.slh b/libraries/graphics/src/graphics/Light.slh similarity index 93% rename from libraries/model/src/model/Light.slh rename to libraries/graphics/src/graphics/Light.slh index 093a87adc8..6b24f89c3c 100644 --- a/libraries/model/src/model/Light.slh +++ b/libraries/graphics/src/graphics/Light.slh @@ -11,8 +11,8 @@ <@if not MODEL_LIGHT_SLH@> <@def MODEL_LIGHT_SLH@> -<@include model/LightVolume.shared.slh@> -<@include model/LightIrradiance.shared.slh@> +<@include graphics/LightVolume.shared.slh@> +<@include graphics/LightIrradiance.shared.slh@> // NOw lets define Light struct Light { @@ -30,7 +30,7 @@ float getLightIntensity(Light l) { return lightIrradiance_getIntensity(l.irradia vec3 getLightIrradiance(Light l) { return lightIrradiance_getIrradiance(l.irradiance); } // AMbient lighting needs extra info provided from a different Buffer -<@include model/SphericalHarmonics.shared.slh@> +<@include graphics/SphericalHarmonics.shared.slh@> // Light Ambient struct LightAmbient { vec4 _ambient; diff --git a/libraries/model/src/model/LightIrradiance.shared.slh b/libraries/graphics/src/graphics/LightIrradiance.shared.slh similarity index 100% rename from libraries/model/src/model/LightIrradiance.shared.slh rename to libraries/graphics/src/graphics/LightIrradiance.shared.slh diff --git a/libraries/model/src/model/LightVolume.shared.slh b/libraries/graphics/src/graphics/LightVolume.shared.slh similarity index 98% rename from libraries/model/src/model/LightVolume.shared.slh rename to libraries/graphics/src/graphics/LightVolume.shared.slh index a78667ed6c..3f0cb135f5 100644 --- a/libraries/model/src/model/LightVolume.shared.slh +++ b/libraries/graphics/src/graphics/LightVolume.shared.slh @@ -3,7 +3,7 @@ #define LightVolume_Shared_slh // Light.shared.slh -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 14/9/2016. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Material.cpp b/libraries/graphics/src/graphics/Material.cpp similarity index 99% rename from libraries/model/src/model/Material.cpp rename to libraries/graphics/src/graphics/Material.cpp index 4e01c4b866..0cfb9916ac 100755 --- a/libraries/model/src/model/Material.cpp +++ b/libraries/graphics/src/graphics/Material.cpp @@ -1,6 +1,6 @@ // // Material.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 12/10/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Material.h b/libraries/graphics/src/graphics/Material.h similarity index 99% rename from libraries/model/src/model/Material.h rename to libraries/graphics/src/graphics/Material.h index 8851ef4ce9..6a2b1c2bee 100755 --- a/libraries/model/src/model/Material.h +++ b/libraries/graphics/src/graphics/Material.h @@ -1,6 +1,6 @@ // // Material.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 12/10/2014. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Material.slh b/libraries/graphics/src/graphics/Material.slh similarity index 100% rename from libraries/model/src/model/Material.slh rename to libraries/graphics/src/graphics/Material.slh diff --git a/libraries/model/src/model/Skybox.cpp b/libraries/graphics/src/graphics/Skybox.cpp similarity index 99% rename from libraries/model/src/model/Skybox.cpp rename to libraries/graphics/src/graphics/Skybox.cpp index fd3061afa5..feb9fb86b7 100755 --- a/libraries/model/src/model/Skybox.cpp +++ b/libraries/graphics/src/graphics/Skybox.cpp @@ -1,6 +1,6 @@ // // Skybox.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 5/4/2015. // Copyright 2015 High Fidelity, Inc. diff --git a/libraries/model/src/model/Skybox.h b/libraries/graphics/src/graphics/Skybox.h similarity index 97% rename from libraries/model/src/model/Skybox.h rename to libraries/graphics/src/graphics/Skybox.h index 90896fd8c6..99155bdd98 100755 --- a/libraries/model/src/model/Skybox.h +++ b/libraries/graphics/src/graphics/Skybox.h @@ -1,6 +1,6 @@ // // Skybox.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 5/4/2015. // Copyright 2015 High Fidelity, Inc. diff --git a/libraries/model/src/model/SphericalHarmonics.shared.slh b/libraries/graphics/src/graphics/SphericalHarmonics.shared.slh similarity index 97% rename from libraries/model/src/model/SphericalHarmonics.shared.slh rename to libraries/graphics/src/graphics/SphericalHarmonics.shared.slh index 664c9e52db..312824c5a3 100644 --- a/libraries/model/src/model/SphericalHarmonics.shared.slh +++ b/libraries/graphics/src/graphics/SphericalHarmonics.shared.slh @@ -3,7 +3,7 @@ #define SphericalHarmonics_Shared_slh // SphericalHarmonics.shared.slh -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 14/9/2016. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Stage.cpp b/libraries/graphics/src/graphics/Stage.cpp similarity index 99% rename from libraries/model/src/model/Stage.cpp rename to libraries/graphics/src/graphics/Stage.cpp index 5854162cfa..3a300858fe 100644 --- a/libraries/model/src/model/Stage.cpp +++ b/libraries/graphics/src/graphics/Stage.cpp @@ -1,6 +1,6 @@ // // Stage.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 2/24/2015. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/Stage.h b/libraries/graphics/src/graphics/Stage.h similarity index 99% rename from libraries/model/src/model/Stage.h rename to libraries/graphics/src/graphics/Stage.h index 5f48824568..65c7b016d6 100644 --- a/libraries/model/src/model/Stage.h +++ b/libraries/graphics/src/graphics/Stage.h @@ -1,6 +1,6 @@ // // Stage.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 2/24/2015. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/TextureMap.cpp b/libraries/graphics/src/graphics/TextureMap.cpp similarity index 96% rename from libraries/model/src/model/TextureMap.cpp rename to libraries/graphics/src/graphics/TextureMap.cpp index b308dd72f8..7a4eb6391e 100755 --- a/libraries/model/src/model/TextureMap.cpp +++ b/libraries/graphics/src/graphics/TextureMap.cpp @@ -1,6 +1,6 @@ // // TextureMap.cpp -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 5/6/2015. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/TextureMap.h b/libraries/graphics/src/graphics/TextureMap.h similarity index 97% rename from libraries/model/src/model/TextureMap.h rename to libraries/graphics/src/graphics/TextureMap.h index 1785d44730..268c3daef8 100755 --- a/libraries/model/src/model/TextureMap.h +++ b/libraries/graphics/src/graphics/TextureMap.h @@ -1,6 +1,6 @@ // // TextureMap.h -// libraries/model/src/model +// libraries/graphics/src/graphics // // Created by Sam Gateau on 5/6/2015. // Copyright 2014 High Fidelity, Inc. diff --git a/libraries/model/src/model/skybox.slf b/libraries/graphics/src/graphics/skybox.slf similarity index 100% rename from libraries/model/src/model/skybox.slf rename to libraries/graphics/src/graphics/skybox.slf diff --git a/libraries/model/src/model/skybox.slv b/libraries/graphics/src/graphics/skybox.slv similarity index 100% rename from libraries/model/src/model/skybox.slv rename to libraries/graphics/src/graphics/skybox.slv diff --git a/libraries/model-networking/CMakeLists.txt b/libraries/model-networking/CMakeLists.txt index db5563d7ea..696f4feb9a 100644 --- a/libraries/model-networking/CMakeLists.txt +++ b/libraries/model-networking/CMakeLists.txt @@ -1,4 +1,4 @@ set(TARGET_NAME model-networking) setup_hifi_library() -link_hifi_libraries(shared networking model fbx ktx image) +link_hifi_libraries(shared networking graphics fbx ktx image) include_hifi_library_headers(gpu) diff --git a/libraries/model-networking/src/model-networking/ModelCache.h b/libraries/model-networking/src/model-networking/ModelCache.h index a122e03eb9..5c49ec683a 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.h +++ b/libraries/model-networking/src/model-networking/ModelCache.h @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include #include "FBXReader.h" #include "TextureCache.h" diff --git a/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp b/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp index b44ea1ff56..741478789e 100644 --- a/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp +++ b/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp @@ -11,7 +11,7 @@ #include "SimpleMeshProxy.h" -#include +#include MeshPointer SimpleMeshProxy::getMeshPointer() const { return _mesh; diff --git a/libraries/model-networking/src/model-networking/TextureCache.h b/libraries/model-networking/src/model-networking/TextureCache.h index 5a96fcf5e6..742d003d02 100644 --- a/libraries/model-networking/src/model-networking/TextureCache.h +++ b/libraries/model-networking/src/model-networking/TextureCache.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/libraries/physics/CMakeLists.txt b/libraries/physics/CMakeLists.txt index e219d3dbcd..ad082c1a6e 100644 --- a/libraries/physics/CMakeLists.txt +++ b/libraries/physics/CMakeLists.txt @@ -1,6 +1,6 @@ set(TARGET_NAME physics) setup_hifi_library() -link_hifi_libraries(shared fbx entities model) +link_hifi_libraries(shared fbx entities graphics) include_hifi_library_headers(networking) include_hifi_library_headers(gpu) include_hifi_library_headers(avatars) diff --git a/libraries/physics/src/CollisionRenderMeshCache.h b/libraries/physics/src/CollisionRenderMeshCache.h index 10b2440db2..64f161e229 100644 --- a/libraries/physics/src/CollisionRenderMeshCache.h +++ b/libraries/physics/src/CollisionRenderMeshCache.h @@ -16,7 +16,7 @@ #include #include -#include +#include class CollisionRenderMeshCache { diff --git a/libraries/procedural/CMakeLists.txt b/libraries/procedural/CMakeLists.txt index daf6fefccc..9ec7cb6431 100644 --- a/libraries/procedural/CMakeLists.txt +++ b/libraries/procedural/CMakeLists.txt @@ -1,5 +1,5 @@ set(TARGET_NAME procedural) -AUTOSCRIBE_SHADER_LIB(gpu model) +AUTOSCRIBE_SHADER_LIB(gpu graphics) setup_hifi_library() -link_hifi_libraries(shared gpu networking model model-networking ktx image) +link_hifi_libraries(shared gpu networking graphics model-networking ktx image) diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.cpp b/libraries/procedural/src/procedural/ProceduralSkybox.cpp index 9544759037..60cb4d8fc4 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.cpp +++ b/libraries/procedural/src/procedural/ProceduralSkybox.cpp @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include ProceduralSkybox::ProceduralSkybox() : model::Skybox() { _procedural._vertexSource = skybox_vert; diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.h b/libraries/procedural/src/procedural/ProceduralSkybox.h index 5a1133a766..14481a57c7 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.h +++ b/libraries/procedural/src/procedural/ProceduralSkybox.h @@ -13,7 +13,7 @@ #ifndef hifi_ProceduralSkybox_h #define hifi_ProceduralSkybox_h -#include +#include #include "Procedural.h" diff --git a/libraries/render-utils/CMakeLists.txt b/libraries/render-utils/CMakeLists.txt index 94232c81b2..6be3057c93 100644 --- a/libraries/render-utils/CMakeLists.txt +++ b/libraries/render-utils/CMakeLists.txt @@ -1,9 +1,9 @@ set(TARGET_NAME render-utils) -AUTOSCRIBE_SHADER_LIB(gpu model render) +AUTOSCRIBE_SHADER_LIB(gpu graphics render) # pull in the resources.qrc file qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts.qrc") setup_hifi_library(Widgets OpenGL Network Qml Quick Script) -link_hifi_libraries(shared ktx gpu model model-networking render animation fbx image procedural) +link_hifi_libraries(shared ktx gpu graphics model-networking render animation fbx image procedural) include_hifi_library_headers(networking) include_hifi_library_headers(octree) include_hifi_library_headers(audio) diff --git a/libraries/render-utils/src/BackgroundStage.h b/libraries/render-utils/src/BackgroundStage.h index 4e0e09db5b..b890a8cb28 100644 --- a/libraries/render-utils/src/BackgroundStage.h +++ b/libraries/render-utils/src/BackgroundStage.h @@ -11,7 +11,7 @@ #ifndef hifi_render_utils_BackgroundStage_h #define hifi_render_utils_BackgroundStage_h -#include +#include #include #include #include diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index ad4a9a3006..2901b4796e 100644 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -11,7 +11,7 @@ <@if not DEFERRED_GLOBAL_LIGHT_SLH@> <@def DEFERRED_GLOBAL_LIGHT_SLH@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <@include LightingModel.slh@> <$declareLightBuffer()$> diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 212d17db12..8d0fc619e5 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -17,8 +17,8 @@ #include #include -#include "model/Light.h" -#include "model/Geometry.h" +#include "graphics/Light.h" +#include "graphics/Geometry.h" #include diff --git a/libraries/render-utils/src/DrawHaze.h b/libraries/render-utils/src/DrawHaze.h index f158daa0c6..3ad42b23aa 100644 --- a/libraries/render-utils/src/DrawHaze.h +++ b/libraries/render-utils/src/DrawHaze.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "SurfaceGeometryPass.h" diff --git a/libraries/render-utils/src/ForwardGlobalLight.slh b/libraries/render-utils/src/ForwardGlobalLight.slh index 3f77f85b51..e86f0c7fe3 100644 --- a/libraries/render-utils/src/ForwardGlobalLight.slh +++ b/libraries/render-utils/src/ForwardGlobalLight.slh @@ -11,7 +11,7 @@ <@if not DEFERRED_GLOBAL_LIGHT_SLH@> <@def DEFERRED_GLOBAL_LIGHT_SLH@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <@include LightingModel.slh@> <$declareLightBuffer()$> diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp index 2616d08600..1fd6ca2980 100644 --- a/libraries/render-utils/src/GeometryCache.cpp +++ b/libraries/render-utils/src/GeometryCache.cpp @@ -31,7 +31,7 @@ #include "gpu/StandardShaderLib.h" -#include "model/TextureMap.h" +#include "graphics/TextureMap.h" #include "render/Args.h" #include "standardTransformPNTC_vert.h" diff --git a/libraries/render-utils/src/GeometryCache.h b/libraries/render-utils/src/GeometryCache.h index 0585cc9e55..31aa4b10ea 100644 --- a/libraries/render-utils/src/GeometryCache.h +++ b/libraries/render-utils/src/GeometryCache.h @@ -28,8 +28,8 @@ #include -#include -#include +#include +#include class SimpleProgramKey; diff --git a/libraries/render-utils/src/Haze.slf b/libraries/render-utils/src/Haze.slf index 0270aa58f0..2d7daf1f98 100644 --- a/libraries/render-utils/src/Haze.slf +++ b/libraries/render-utils/src/Haze.slf @@ -12,7 +12,7 @@ <@include DeferredTransform.slh@> <$declareDeferredFrameTransform()$> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <@include LightingModel.slh@> <$declareLightBuffer()$> diff --git a/libraries/render-utils/src/HazeStage.h b/libraries/render-utils/src/HazeStage.h index c355f06644..9e729f1ef9 100644 --- a/libraries/render-utils/src/HazeStage.h +++ b/libraries/render-utils/src/HazeStage.h @@ -11,7 +11,7 @@ #ifndef hifi_render_utils_HazeStage_h #define hifi_render_utils_HazeStage_h -#include +#include #include #include #include @@ -19,7 +19,7 @@ #include #include -#include +#include // Haze stage to set up haze-related rendering tasks class HazeStage : public render::Stage { diff --git a/libraries/render-utils/src/LightPayload.h b/libraries/render-utils/src/LightPayload.h index b55373c9a8..a3032ccd90 100644 --- a/libraries/render-utils/src/LightPayload.h +++ b/libraries/render-utils/src/LightPayload.h @@ -12,7 +12,7 @@ #define hifi_LightPayload_h -#include +#include #include #include "LightStage.h" #include "TextureCache.h" diff --git a/libraries/render-utils/src/LightStage.h b/libraries/render-utils/src/LightStage.h index 3dcae550f7..8db5c19950 100644 --- a/libraries/render-utils/src/LightStage.h +++ b/libraries/render-utils/src/LightStage.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include diff --git a/libraries/render-utils/src/MeshPartPayload.h b/libraries/render-utils/src/MeshPartPayload.h index 8d36395610..6e165508f2 100644 --- a/libraries/render-utils/src/MeshPartPayload.h +++ b/libraries/render-utils/src/MeshPartPayload.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include "Model.h" diff --git a/libraries/render-utils/src/StencilMaskPass.cpp b/libraries/render-utils/src/StencilMaskPass.cpp index f71111b64e..ab1ac7c1aa 100644 --- a/libraries/render-utils/src/StencilMaskPass.cpp +++ b/libraries/render-utils/src/StencilMaskPass.cpp @@ -129,7 +129,7 @@ void PrepareStencil::testNoAA(gpu::State& state) { } // Pass if this area WAS marked as BACKGROUND -// (see: model/src/Skybox.cpp, procedural/src/ProceduralSkybox.cpp) +// (see: graphics/src/Skybox.cpp, procedural/src/ProceduralSkybox.cpp) void PrepareStencil::testBackground(gpu::State& state) { state.setStencilTest(true, 0x00, gpu::State::StencilTest(STENCIL_BACKGROUND, 0xFF, gpu::EQUAL, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_KEEP)); diff --git a/libraries/render-utils/src/StencilMaskPass.h b/libraries/render-utils/src/StencilMaskPass.h index fc258b607a..ef1371d04e 100644 --- a/libraries/render-utils/src/StencilMaskPass.h +++ b/libraries/render-utils/src/StencilMaskPass.h @@ -14,7 +14,7 @@ #include #include -#include +#include class PrepareStencilConfig : public render::Job::Config { Q_OBJECT diff --git a/libraries/render-utils/src/deferred_light_point.slv b/libraries/render-utils/src/deferred_light_point.slv index 88da7dd04c..2b75ee3915 100644 --- a/libraries/render-utils/src/deferred_light_point.slv +++ b/libraries/render-utils/src/deferred_light_point.slv @@ -18,7 +18,7 @@ <$declareStandardTransform()$> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer(256)$> diff --git a/libraries/render-utils/src/deferred_light_spot.slv b/libraries/render-utils/src/deferred_light_spot.slv index f6dc7faaf1..7e3e45b3b6 100644 --- a/libraries/render-utils/src/deferred_light_spot.slv +++ b/libraries/render-utils/src/deferred_light_spot.slv @@ -18,7 +18,7 @@ <$declareStandardTransform()$> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer(256)$> uniform lightIndexBuffer { diff --git a/libraries/render-utils/src/forward_model.slf b/libraries/render-utils/src/forward_model.slf index 7b708a1d24..41ff4afc81 100644 --- a/libraries/render-utils/src/forward_model.slf +++ b/libraries/render-utils/src/forward_model.slf @@ -16,7 +16,7 @@ <@include ForwardGlobalLight.slh@> <$declareEvalSkyboxGlobalColor()$> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> diff --git a/libraries/render-utils/src/forward_model_normal_map.slf b/libraries/render-utils/src/forward_model_normal_map.slf index a199483b9f..e5fcab4945 100644 --- a/libraries/render-utils/src/forward_model_normal_map.slf +++ b/libraries/render-utils/src/forward_model_normal_map.slf @@ -14,7 +14,7 @@ <@include ForwardBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, _SCRIBE_NULL, EMISSIVE, OCCLUSION, SCATTERING)$> diff --git a/libraries/render-utils/src/forward_model_normal_specular_map.slf b/libraries/render-utils/src/forward_model_normal_specular_map.slf index ca6bbec3da..01a4251e8d 100644 --- a/libraries/render-utils/src/forward_model_normal_specular_map.slf +++ b/libraries/render-utils/src/forward_model_normal_specular_map.slf @@ -14,7 +14,7 @@ <@include ForwardBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/forward_model_specular_map.slf b/libraries/render-utils/src/forward_model_specular_map.slf index d2fdd18794..77d34d4309 100644 --- a/libraries/render-utils/src/forward_model_specular_map.slf +++ b/libraries/render-utils/src/forward_model_specular_map.slf @@ -14,7 +14,7 @@ <@include ForwardBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/forward_model_translucent.slf b/libraries/render-utils/src/forward_model_translucent.slf index 906393db1f..7f752d893a 100644 --- a/libraries/render-utils/src/forward_model_translucent.slf +++ b/libraries/render-utils/src/forward_model_translucent.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include ForwardGlobalLight.slh@> diff --git a/libraries/render-utils/src/forward_model_unlit.slf b/libraries/render-utils/src/forward_model_unlit.slf index fb760467c9..72ee61e28c 100644 --- a/libraries/render-utils/src/forward_model_unlit.slf +++ b/libraries/render-utils/src/forward_model_unlit.slf @@ -14,7 +14,7 @@ <@include ForwardBufferWrite.slh@> <@include LightingModel.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO)$> diff --git a/libraries/render-utils/src/lightClusters_drawClusterContent.slf b/libraries/render-utils/src/lightClusters_drawClusterContent.slf index 447f8bd634..739709418d 100644 --- a/libraries/render-utils/src/lightClusters_drawClusterContent.slf +++ b/libraries/render-utils/src/lightClusters_drawClusterContent.slf @@ -15,7 +15,7 @@ <@include DeferredBufferRead.slh@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer(256)$> <@include LightClusterGrid.slh@> diff --git a/libraries/render-utils/src/local_lights_drawOutline.slf b/libraries/render-utils/src/local_lights_drawOutline.slf index 3aa210a241..56ce1e61a5 100644 --- a/libraries/render-utils/src/local_lights_drawOutline.slf +++ b/libraries/render-utils/src/local_lights_drawOutline.slf @@ -18,7 +18,7 @@ <$declareDeferredCurvature()$> // Everything about light -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer(128)$> <@include LightingModel.slh@> diff --git a/libraries/render-utils/src/local_lights_shading.slf b/libraries/render-utils/src/local_lights_shading.slf index a935a8cb89..c3208de726 100644 --- a/libraries/render-utils/src/local_lights_shading.slf +++ b/libraries/render-utils/src/local_lights_shading.slf @@ -18,7 +18,7 @@ <$declareDeferredCurvature()$> // Everything about light -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer(256)$> <@include LightingModel.slh@> diff --git a/libraries/render-utils/src/model.slf b/libraries/render-utils/src/model.slf index daeead65ec..4747b69278 100644 --- a/libraries/render-utils/src/model.slf +++ b/libraries/render-utils/src/model.slf @@ -13,7 +13,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_fade.slf b/libraries/render-utils/src/model_fade.slf index d232667660..40c156a3a4 100644 --- a/libraries/render-utils/src/model_fade.slf +++ b/libraries/render-utils/src/model_fade.slf @@ -13,7 +13,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_lightmap.slf b/libraries/render-utils/src/model_lightmap.slf index 3a8cfde290..b22a1029f9 100644 --- a/libraries/render-utils/src/model_lightmap.slf +++ b/libraries/render-utils/src/model_lightmap.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS)$> diff --git a/libraries/render-utils/src/model_lightmap_fade.slf b/libraries/render-utils/src/model_lightmap_fade.slf index 92d00a2046..55cb24d35d 100644 --- a/libraries/render-utils/src/model_lightmap_fade.slf +++ b/libraries/render-utils/src/model_lightmap_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS)$> diff --git a/libraries/render-utils/src/model_lightmap_normal_map.slf b/libraries/render-utils/src/model_lightmap_normal_map.slf index 81de1e5d5b..1510ea9ba3 100644 --- a/libraries/render-utils/src/model_lightmap_normal_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL)$> diff --git a/libraries/render-utils/src/model_lightmap_normal_map_fade.slf b/libraries/render-utils/src/model_lightmap_normal_map_fade.slf index 825e84d666..6b63943a9a 100644 --- a/libraries/render-utils/src/model_lightmap_normal_map_fade.slf +++ b/libraries/render-utils/src/model_lightmap_normal_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL)$> diff --git a/libraries/render-utils/src/model_lightmap_normal_specular_map.slf b/libraries/render-utils/src/model_lightmap_normal_specular_map.slf index 944da27b01..3a66aaad3d 100644 --- a/libraries/render-utils/src/model_lightmap_normal_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_specular_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC)$> diff --git a/libraries/render-utils/src/model_lightmap_normal_specular_map_fade.slf b/libraries/render-utils/src/model_lightmap_normal_specular_map_fade.slf index 791d5bf552..b785a8a6ab 100644 --- a/libraries/render-utils/src/model_lightmap_normal_specular_map_fade.slf +++ b/libraries/render-utils/src/model_lightmap_normal_specular_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC)$> diff --git a/libraries/render-utils/src/model_lightmap_specular_map.slf b/libraries/render-utils/src/model_lightmap_specular_map.slf index 4dbc10a834..1c97d435bd 100644 --- a/libraries/render-utils/src/model_lightmap_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_specular_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC)$> diff --git a/libraries/render-utils/src/model_lightmap_specular_map_fade.slf b/libraries/render-utils/src/model_lightmap_specular_map_fade.slf index e82018eefb..1adedb9328 100644 --- a/libraries/render-utils/src/model_lightmap_specular_map_fade.slf +++ b/libraries/render-utils/src/model_lightmap_specular_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC)$> diff --git a/libraries/render-utils/src/model_normal_map.slf b/libraries/render-utils/src/model_normal_map.slf index 063950609a..bed85b4b15 100644 --- a/libraries/render-utils/src/model_normal_map.slf +++ b/libraries/render-utils/src/model_normal_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, _SCRIBE_NULL, EMISSIVE, OCCLUSION, SCATTERING)$> diff --git a/libraries/render-utils/src/model_normal_map_fade.slf b/libraries/render-utils/src/model_normal_map_fade.slf index d8b864260c..5a166b1c2c 100644 --- a/libraries/render-utils/src/model_normal_map_fade.slf +++ b/libraries/render-utils/src/model_normal_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, _SCRIBE_NULL, EMISSIVE, OCCLUSION, SCATTERING)$> diff --git a/libraries/render-utils/src/model_normal_specular_map.slf b/libraries/render-utils/src/model_normal_specular_map.slf index 9e079b33a0..3eb3d43fdc 100644 --- a/libraries/render-utils/src/model_normal_specular_map.slf +++ b/libraries/render-utils/src/model_normal_specular_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_normal_specular_map_fade.slf b/libraries/render-utils/src/model_normal_specular_map_fade.slf index 5492b24763..0985d5d493 100644 --- a/libraries/render-utils/src/model_normal_specular_map_fade.slf +++ b/libraries/render-utils/src/model_normal_specular_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_specular_map.slf b/libraries/render-utils/src/model_specular_map.slf index 47b5e3389d..e65dbaeda6 100644 --- a/libraries/render-utils/src/model_specular_map.slf +++ b/libraries/render-utils/src/model_specular_map.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_specular_map_fade.slf b/libraries/render-utils/src/model_specular_map_fade.slf index 6eb56c0929..17173d8bc3 100644 --- a/libraries/render-utils/src/model_specular_map_fade.slf +++ b/libraries/render-utils/src/model_specular_map_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_translucent.slf b/libraries/render-utils/src/model_translucent.slf index 7e64c5ab8b..0924389dba 100644 --- a/libraries/render-utils/src/model_translucent.slf +++ b/libraries/render-utils/src/model_translucent.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include DeferredGlobalLight.slh@> diff --git a/libraries/render-utils/src/model_translucent_fade.slf b/libraries/render-utils/src/model_translucent_fade.slf index 0d5a452fed..8ac442476f 100644 --- a/libraries/render-utils/src/model_translucent_fade.slf +++ b/libraries/render-utils/src/model_translucent_fade.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include DeferredGlobalLight.slh@> diff --git a/libraries/render-utils/src/model_translucent_unlit.slf b/libraries/render-utils/src/model_translucent_unlit.slf index b397cea5aa..4c3a0f0195 100644 --- a/libraries/render-utils/src/model_translucent_unlit.slf +++ b/libraries/render-utils/src/model_translucent_unlit.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_translucent_unlit_fade.slf b/libraries/render-utils/src/model_translucent_unlit_fade.slf index 6a77efe4ca..210060d54d 100644 --- a/libraries/render-utils/src/model_translucent_unlit_fade.slf +++ b/libraries/render-utils/src/model_translucent_unlit_fade.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$> diff --git a/libraries/render-utils/src/model_unlit.slf b/libraries/render-utils/src/model_unlit.slf index 750b51fe8c..ccfc7d4935 100644 --- a/libraries/render-utils/src/model_unlit.slf +++ b/libraries/render-utils/src/model_unlit.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> <@include LightingModel.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO)$> diff --git a/libraries/render-utils/src/model_unlit_fade.slf b/libraries/render-utils/src/model_unlit_fade.slf index 0fe9f2ebac..65c97f9e21 100644 --- a/libraries/render-utils/src/model_unlit_fade.slf +++ b/libraries/render-utils/src/model_unlit_fade.slf @@ -14,7 +14,7 @@ <@include DeferredBufferWrite.slh@> <@include LightingModel.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include Fade.slh@> <$declareFadeFragment()$> diff --git a/libraries/render-utils/src/overlay3D.slf b/libraries/render-utils/src/overlay3D.slf index b58dd5afac..dcded917b4 100644 --- a/libraries/render-utils/src/overlay3D.slf +++ b/libraries/render-utils/src/overlay3D.slf @@ -12,7 +12,7 @@ // -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer()$> <$declareLightAmbientBuffer()$> diff --git a/libraries/render-utils/src/overlay3D_model.slf b/libraries/render-utils/src/overlay3D_model.slf index ea61c2bb75..d4de0ee69f 100644 --- a/libraries/render-utils/src/overlay3D_model.slf +++ b/libraries/render-utils/src/overlay3D_model.slf @@ -14,7 +14,7 @@ <@include DeferredGlobalLight.slh@> <$declareEvalSkyboxGlobalColor()$> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> diff --git a/libraries/render-utils/src/overlay3D_model_translucent.slf b/libraries/render-utils/src/overlay3D_model_translucent.slf index b6ae8eb75e..8dd3a81443 100644 --- a/libraries/render-utils/src/overlay3D_model_translucent.slf +++ b/libraries/render-utils/src/overlay3D_model_translucent.slf @@ -13,7 +13,7 @@ <@include DeferredGlobalLight.slh@> <$declareEvalGlobalLightingAlphaBlended()$> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> diff --git a/libraries/render-utils/src/overlay3D_model_translucent_unlit.slf b/libraries/render-utils/src/overlay3D_model_translucent_unlit.slf index 3dd8138272..3b79818cd9 100644 --- a/libraries/render-utils/src/overlay3D_model_translucent_unlit.slf +++ b/libraries/render-utils/src/overlay3D_model_translucent_unlit.slf @@ -12,7 +12,7 @@ // <@include LightingModel.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO)$> diff --git a/libraries/render-utils/src/overlay3D_model_unlit.slf b/libraries/render-utils/src/overlay3D_model_unlit.slf index 80c2bb971e..eab975e810 100644 --- a/libraries/render-utils/src/overlay3D_model_unlit.slf +++ b/libraries/render-utils/src/overlay3D_model_unlit.slf @@ -12,7 +12,7 @@ // <@include LightingModel.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include MaterialTextures.slh@> <$declareMaterialTextures(ALBEDO)$> diff --git a/libraries/render-utils/src/overlay3D_translucent.slf b/libraries/render-utils/src/overlay3D_translucent.slf index 72bd0d740e..64035ac984 100644 --- a/libraries/render-utils/src/overlay3D_translucent.slf +++ b/libraries/render-utils/src/overlay3D_translucent.slf @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer()$> <$declareLightAmbientBuffer()$> diff --git a/libraries/render-utils/src/simple.slf b/libraries/render-utils/src/simple.slf index fd45c6c134..7b32541c63 100644 --- a/libraries/render-utils/src/simple.slf +++ b/libraries/render-utils/src/simple.slf @@ -13,7 +13,7 @@ // <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> // the interpolated normal in vec3 _normal; diff --git a/libraries/render-utils/src/simple_fade.slf b/libraries/render-utils/src/simple_fade.slf index 245d32e81e..ce9251b9a5 100644 --- a/libraries/render-utils/src/simple_fade.slf +++ b/libraries/render-utils/src/simple_fade.slf @@ -13,7 +13,7 @@ // <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include Fade.slh@> <$declareFadeFragmentInstanced()$> diff --git a/libraries/render-utils/src/simple_textured.slf b/libraries/render-utils/src/simple_textured.slf index 550f6546fd..34fcbc77dc 100644 --- a/libraries/render-utils/src/simple_textured.slf +++ b/libraries/render-utils/src/simple_textured.slf @@ -14,7 +14,7 @@ <@include gpu/Color.slh@> <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> // the albedo texture uniform sampler2D originalTexture; diff --git a/libraries/render-utils/src/simple_textured_fade.slf b/libraries/render-utils/src/simple_textured_fade.slf index 025fe5fca6..2061cabdfc 100644 --- a/libraries/render-utils/src/simple_textured_fade.slf +++ b/libraries/render-utils/src/simple_textured_fade.slf @@ -14,7 +14,7 @@ <@include gpu/Color.slh@> <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include graphics/Material.slh@> <@include Fade.slh@> diff --git a/libraries/render-utils/src/subsurfaceScattering_drawScattering.slf b/libraries/render-utils/src/subsurfaceScattering_drawScattering.slf index 981993615c..ad6918d727 100644 --- a/libraries/render-utils/src/subsurfaceScattering_drawScattering.slf +++ b/libraries/render-utils/src/subsurfaceScattering_drawScattering.slf @@ -12,7 +12,7 @@ <@include DeferredBufferRead.slh@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <$declareLightBuffer()$> <$declareDeferredCurvature()$> diff --git a/libraries/render-utils/src/zone_drawAmbient.slf b/libraries/render-utils/src/zone_drawAmbient.slf index f104e5be44..3407fe8467 100644 --- a/libraries/render-utils/src/zone_drawAmbient.slf +++ b/libraries/render-utils/src/zone_drawAmbient.slf @@ -10,7 +10,7 @@ // <@include zone_draw.slh@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <@include LightingModel.slh@> <$declareLightAmbientBuffer()$> diff --git a/libraries/render-utils/src/zone_drawKeyLight.slf b/libraries/render-utils/src/zone_drawKeyLight.slf index e96239b6dc..ea11c775b4 100644 --- a/libraries/render-utils/src/zone_drawKeyLight.slf +++ b/libraries/render-utils/src/zone_drawKeyLight.slf @@ -10,7 +10,7 @@ // <@include zone_draw.slh@> -<@include model/Light.slh@> +<@include graphics/Light.slh@> <@include LightingModel.slh@> <$declareLightBuffer()$> diff --git a/libraries/render/CMakeLists.txt b/libraries/render/CMakeLists.txt index 8fd05bd320..1d88c3e5f5 100644 --- a/libraries/render/CMakeLists.txt +++ b/libraries/render/CMakeLists.txt @@ -1,8 +1,8 @@ set(TARGET_NAME render) -AUTOSCRIBE_SHADER_LIB(gpu model) +AUTOSCRIBE_SHADER_LIB(gpu graphics) setup_hifi_library() # render needs octree only for getAccuracyAngle(float, int) -link_hifi_libraries(shared ktx gpu model octree) +link_hifi_libraries(shared ktx gpu graphics octree) target_nsight() diff --git a/libraries/render/src/render/Item.h b/libraries/render/src/render/Item.h index 77f5910b9e..e977c95fa0 100644 --- a/libraries/render/src/render/Item.h +++ b/libraries/render/src/render/Item.h @@ -25,7 +25,7 @@ #include "Args.h" -#include +#include #include "ShapePipeline.h" namespace render { diff --git a/libraries/script-engine/CMakeLists.txt b/libraries/script-engine/CMakeLists.txt index 87296b187f..478e4c4765 100644 --- a/libraries/script-engine/CMakeLists.txt +++ b/libraries/script-engine/CMakeLists.txt @@ -16,6 +16,6 @@ if (NOT ANDROID) endif () -link_hifi_libraries(shared networking octree gpu procedural model model-networking ktx recording avatars fbx entities controllers animation audio physics image midi) +link_hifi_libraries(shared networking octree gpu procedural graphics model-networking ktx recording avatars fbx entities controllers animation audio physics image midi) # ui includes gl, but link_hifi_libraries does not use transitive includes, so gl must be explicit include_hifi_library_headers(gl) diff --git a/libraries/script-engine/src/SceneScriptingInterface.h b/libraries/script-engine/src/SceneScriptingInterface.h index 7bc22eb3e6..160c37284c 100644 --- a/libraries/script-engine/src/SceneScriptingInterface.h +++ b/libraries/script-engine/src/SceneScriptingInterface.h @@ -15,7 +15,7 @@ #include // QObject #include // Dependency -#include "model/Stage.h" +#include "graphics/Stage.h" // TODO: if QT moc ever supports nested classes, subclass these to the interface instead of namespacing namespace SceneScripting { diff --git a/plugins/openvr/CMakeLists.txt b/plugins/openvr/CMakeLists.txt index 7878ae2d7e..9ae9b25b65 100644 --- a/plugins/openvr/CMakeLists.txt +++ b/plugins/openvr/CMakeLists.txt @@ -13,7 +13,7 @@ if (WIN32) setup_hifi_plugin(OpenGL Script Qml Widgets Multimedia) link_hifi_libraries(shared gl networking controllers ui plugins display-plugins ui-plugins input-plugins script-engine - audio-client render-utils model gpu gpu-gl render model-networking fbx ktx image procedural) + audio-client render-utils graphics gpu gpu-gl render model-networking fbx ktx image procedural) include_hifi_library_headers(octree) diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 772facc21f..b5db1db5a8 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/animation/CMakeLists.txt b/tests/animation/CMakeLists.txt index 2a07f6f429..40f76ee362 100644 --- a/tests/animation/CMakeLists.txt +++ b/tests/animation/CMakeLists.txt @@ -1,7 +1,7 @@ # Declare dependencies macro (setup_testcase_dependencies) # link in the shared libraries - link_hifi_libraries(shared animation gpu fbx model networking) + link_hifi_libraries(shared animation gpu fbx graphics networking) package_libraries_for_deployment() endmacro () diff --git a/tests/entities/CMakeLists.txt b/tests/entities/CMakeLists.txt index 0c33eb8555..6d0bf9f149 100644 --- a/tests/entities/CMakeLists.txt +++ b/tests/entities/CMakeLists.txt @@ -7,7 +7,7 @@ setup_memory_debugger() set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") # link in the shared libraries -link_hifi_libraries(entities avatars shared octree gpu model fbx networking animation audio gl) +link_hifi_libraries(entities avatars shared octree gpu graphics fbx networking animation audio gl) if (WIN32) add_dependency_external_projects(wasapi) diff --git a/tests/gpu-test/CMakeLists.txt b/tests/gpu-test/CMakeLists.txt index 8e49d523b8..9772320812 100644 --- a/tests/gpu-test/CMakeLists.txt +++ b/tests/gpu-test/CMakeLists.txt @@ -1,10 +1,10 @@ set(TARGET_NAME gpu-test) -AUTOSCRIBE_SHADER_LIB(gpu model render-utils) +AUTOSCRIBE_SHADER_LIB(gpu graphics render-utils) # This is not a testcase -- just set it up as a regular hifi project setup_hifi_project(Quick Gui OpenGL Script Widgets) setup_memory_debugger() set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") -link_hifi_libraries(networking gl gpu gpu-gl procedural shared fbx model model-networking animation script-engine render render-utils octree image ktx) +link_hifi_libraries(networking gl gpu gpu-gl procedural shared fbx graphics model-networking animation script-engine render render-utils octree image ktx) if (WIN32) add_dependency_external_projects(wasapi) diff --git a/tests/octree/CMakeLists.txt b/tests/octree/CMakeLists.txt index 224b97c75c..a685e06172 100644 --- a/tests/octree/CMakeLists.txt +++ b/tests/octree/CMakeLists.txt @@ -2,7 +2,7 @@ # Declare dependencies macro (setup_testcase_dependencies) # link in the shared libraries - link_hifi_libraries(shared octree gpu model fbx networking entities avatars audio animation script-engine physics) + link_hifi_libraries(shared octree gpu graphics fbx networking entities avatars audio animation script-engine physics) package_libraries_for_deployment() endmacro () diff --git a/tests/physics/CMakeLists.txt b/tests/physics/CMakeLists.txt index 755886ebbf..1f1b52bf28 100644 --- a/tests/physics/CMakeLists.txt +++ b/tests/physics/CMakeLists.txt @@ -2,7 +2,7 @@ # Declare dependencies macro (SETUP_TESTCASE_DEPENDENCIES) target_bullet() - link_hifi_libraries(shared physics gpu model) + link_hifi_libraries(shared physics gpu graphics) package_libraries_for_deployment() endmacro () diff --git a/tests/render-perf/CMakeLists.txt b/tests/render-perf/CMakeLists.txt index 09b2dc6a50..9739533fd2 100644 --- a/tests/render-perf/CMakeLists.txt +++ b/tests/render-perf/CMakeLists.txt @@ -12,7 +12,7 @@ setup_hifi_project(Quick Gui OpenGL) set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") # link in the shared libraries -link_hifi_libraries(shared networking model fbx ktx image octree gl gpu gpu-gl render model-networking networking render-utils entities entities-renderer animation audio avatars script-engine physics procedural midi ui) +link_hifi_libraries(shared networking graphics fbx ktx image octree gl gpu gpu-gl render model-networking networking render-utils entities entities-renderer animation audio avatars script-engine physics procedural midi ui) if (WIN32) target_link_libraries(${TARGET_NAME} Winmm.lib) diff --git a/tests/render-perf/src/main.cpp b/tests/render-perf/src/main.cpp index c70a74cd7f..921ceb079e 100644 --- a/tests/render-perf/src/main.cpp +++ b/tests/render-perf/src/main.cpp @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/render-texture-load/CMakeLists.txt b/tests/render-texture-load/CMakeLists.txt index 432a1f00d6..302ddd0f97 100644 --- a/tests/render-texture-load/CMakeLists.txt +++ b/tests/render-texture-load/CMakeLists.txt @@ -12,7 +12,7 @@ setup_hifi_project(Quick Gui OpenGL) set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") # link in the shared libraries -link_hifi_libraries(shared octree gl gpu gpu-gl render model model-networking networking render-utils fbx entities entities-renderer animation audio avatars script-engine physics ktx image) +link_hifi_libraries(shared octree gl gpu gpu-gl render graphics model-networking networking render-utils fbx entities entities-renderer animation audio avatars script-engine physics ktx image) package_libraries_for_deployment() diff --git a/tests/shaders/CMakeLists.txt b/tests/shaders/CMakeLists.txt index ba4ca88127..a6796b8601 100644 --- a/tests/shaders/CMakeLists.txt +++ b/tests/shaders/CMakeLists.txt @@ -8,14 +8,14 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") setup_memory_debugger() # link in the shared libraries -link_hifi_libraries(shared octree gl gpu gpu-gl model render fbx networking entities +link_hifi_libraries(shared octree gl gpu gpu-gl graphics render fbx networking entities script-engine physics render-utils entities-renderer) include_directories("${PROJECT_BINARY_DIR}/../../libraries/gpu/") include_directories("${PROJECT_BINARY_DIR}/../../libraries/render-utils/") include_directories("${PROJECT_BINARY_DIR}/../../libraries/entities-renderer/") -include_directories("${PROJECT_BINARY_DIR}/../../libraries/model/") +include_directories("${PROJECT_BINARY_DIR}/../../libraries/graphics/") if (WIN32) add_dependency_external_projects(wasapi) diff --git a/tests/shaders/src/main.cpp b/tests/shaders/src/main.cpp index 7c6886ad93..cd307ba362 100644 --- a/tests/shaders/src/main.cpp +++ b/tests/shaders/src/main.cpp @@ -64,8 +64,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tools/oven/CMakeLists.txt b/tools/oven/CMakeLists.txt index 00344179bd..549414cbab 100644 --- a/tools/oven/CMakeLists.txt +++ b/tools/oven/CMakeLists.txt @@ -2,7 +2,7 @@ set(TARGET_NAME oven) setup_hifi_project(Widgets Gui Concurrent) -link_hifi_libraries(networking shared image gpu ktx fbx baking model) +link_hifi_libraries(networking shared image gpu ktx fbx baking graphics) setup_memory_debugger() diff --git a/tools/skeleton-dump/CMakeLists.txt b/tools/skeleton-dump/CMakeLists.txt index bb2fe24f51..1c30e322d6 100644 --- a/tools/skeleton-dump/CMakeLists.txt +++ b/tools/skeleton-dump/CMakeLists.txt @@ -1,5 +1,5 @@ set(TARGET_NAME skeleton-dump) setup_hifi_project(Core Widgets) setup_memory_debugger() -link_hifi_libraries(shared fbx model gpu gl animation) +link_hifi_libraries(shared fbx graphics gpu gl animation) diff --git a/tools/vhacd-util/CMakeLists.txt b/tools/vhacd-util/CMakeLists.txt index c28aa9efa4..599561bd2d 100644 --- a/tools/vhacd-util/CMakeLists.txt +++ b/tools/vhacd-util/CMakeLists.txt @@ -1,6 +1,6 @@ set(TARGET_NAME vhacd-util) setup_hifi_project(Core Widgets) -link_hifi_libraries(shared fbx model gpu gl) +link_hifi_libraries(shared fbx graphics gpu gl) add_dependency_external_projects(vhacd) From b91d536dd0ee17c0572e4cb39b8bd0b337fa9e5e Mon Sep 17 00:00:00 2001 From: humbletim Date: Tue, 16 Jan 2018 12:46:16 -0500 Subject: [PATCH 39/40] rename model:: -> graphics:: --- interface/src/Application.cpp | 2 +- interface/src/Application.h | 4 +- .../src/RenderableLightEntityItem.cpp | 4 +- .../src/RenderableModelEntityItem.cpp | 24 +++++----- .../src/RenderablePolyVoxEntityItem.cpp | 20 ++++----- .../src/RenderablePolyVoxEntityItem.h | 6 +-- .../src/RenderableZoneEntityItem.cpp | 14 +++--- .../src/RenderableZoneEntityItem.h | 18 ++++---- libraries/fbx/src/FBX.h | 4 +- libraries/fbx/src/FBXReader.cpp | 2 +- libraries/fbx/src/FBXReader_Material.cpp | 4 +- libraries/fbx/src/FBXReader_Mesh.cpp | 28 ++++++------ libraries/fbx/src/GLTFReader.cpp | 2 +- libraries/fbx/src/OBJReader.cpp | 6 +-- libraries/fbx/src/OBJWriter.cpp | 6 +-- libraries/fbx/src/OBJWriter.h | 2 +- libraries/graphics/src/graphics/Asset.cpp | 2 +- libraries/graphics/src/graphics/Asset.h | 2 +- libraries/graphics/src/graphics/Forward.h | 2 +- libraries/graphics/src/graphics/Geometry.cpp | 24 +++++----- libraries/graphics/src/graphics/Geometry.h | 4 +- libraries/graphics/src/graphics/Haze.cpp | 2 +- libraries/graphics/src/graphics/Haze.h | 2 +- libraries/graphics/src/graphics/Light.cpp | 2 +- libraries/graphics/src/graphics/Light.h | 2 +- libraries/graphics/src/graphics/Material.cpp | 2 +- libraries/graphics/src/graphics/Material.h | 2 +- libraries/graphics/src/graphics/Skybox.cpp | 2 +- libraries/graphics/src/graphics/Skybox.h | 2 +- libraries/graphics/src/graphics/Stage.cpp | 2 +- libraries/graphics/src/graphics/Stage.h | 2 +- .../graphics/src/graphics/TextureMap.cpp | 2 +- libraries/graphics/src/graphics/TextureMap.h | 2 +- .../src/model-networking/ModelCache.cpp | 10 ++--- .../src/model-networking/ModelCache.h | 10 ++--- .../physics/src/CollisionRenderMeshCache.cpp | 24 +++++----- .../physics/src/CollisionRenderMeshCache.h | 4 +- .../src/procedural/ProceduralSkybox.cpp | 2 +- .../src/procedural/ProceduralSkybox.h | 2 +- .../render-utils/src/BackgroundStage.cpp | 10 ++--- libraries/render-utils/src/BackgroundStage.h | 4 +- .../src/DeferredLightingEffect.cpp | 42 +++++++++--------- .../render-utils/src/DeferredLightingEffect.h | 20 ++++----- libraries/render-utils/src/DrawHaze.cpp | 18 ++++---- libraries/render-utils/src/DrawHaze.h | 44 +++++++++---------- libraries/render-utils/src/HazeStage.cpp | 14 +++--- libraries/render-utils/src/HazeStage.h | 28 ++++++------ libraries/render-utils/src/LightPayload.cpp | 4 +- libraries/render-utils/src/LightPayload.h | 8 ++-- libraries/render-utils/src/LightStage.cpp | 32 +++++++------- libraries/render-utils/src/LightStage.h | 20 ++++----- .../render-utils/src/MeshPartPayload.cpp | 28 ++++++------ libraries/render-utils/src/MeshPartPayload.h | 18 ++++---- libraries/render-utils/src/Model.cpp | 14 +++--- libraries/render-utils/src/Model.h | 2 +- .../render-utils/src/RenderDeferredTask.cpp | 2 +- .../render-utils/src/RenderPipelines.cpp | 2 +- .../render-utils/src/RenderShadowTask.cpp | 2 +- .../render-utils/src/StencilMaskPass.cpp | 6 +-- libraries/render-utils/src/StencilMaskPass.h | 4 +- libraries/render-utils/src/ZoneRenderer.cpp | 6 +-- .../src/ModelScriptingInterface.cpp | 30 ++++++------- .../src/SceneScriptingInterface.cpp | 12 ++--- .../src/SceneScriptingInterface.h | 20 ++++----- libraries/shared/src/RegisteredMetaTypes.h | 4 +- plugins/openvr/src/ViveControllerManager.h | 2 +- tests/gpu-test/src/TestFbx.h | 2 +- tests/gpu-test/src/TestWindow.cpp | 2 +- tests/gpu-test/src/TestWindow.h | 2 +- .../src/CollisionRenderMeshCacheTests.cpp | 16 +++---- tests/render-perf/src/main.cpp | 6 +-- 71 files changed, 340 insertions(+), 340 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 449b014c13..1cee7ea9f3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5465,7 +5465,7 @@ void Application::clearDomainOctreeDetails() { auto skyStage = DependencyManager::get()->getSkyStage(); - skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT); + skyStage->setBackgroundMode(graphics::SunSkyStage::SKY_DEFAULT); DependencyManager::get()->clearUnusedResources(); DependencyManager::get()->clearUnusedResources(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 6b70e88b89..ddb8ce11e5 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -270,7 +270,7 @@ public: void takeSecondaryCameraSnapshot(); void shareSnapshot(const QString& filename, const QUrl& href = QUrl("")); - model::SkyboxPointer getDefaultSkybox() const { return _defaultSkybox; } + graphics::SkyboxPointer getDefaultSkybox() const { return _defaultSkybox; } gpu::TexturePointer getDefaultSkyboxTexture() const { return _defaultSkyboxTexture; } gpu::TexturePointer getDefaultSkyboxAmbientTexture() const { return _defaultSkyboxAmbientTexture; } @@ -667,7 +667,7 @@ private: ConnectionMonitor _connectionMonitor; - model::SkyboxPointer _defaultSkybox { new ProceduralSkybox() } ; + graphics::SkyboxPointer _defaultSkybox { new ProceduralSkybox() } ; gpu::TexturePointer _defaultSkyboxTexture; gpu::TexturePointer _defaultSkyboxAmbientTexture; diff --git a/libraries/entities-renderer/src/RenderableLightEntityItem.cpp b/libraries/entities-renderer/src/RenderableLightEntityItem.cpp index fc33ebc498..4ea293a3da 100644 --- a/libraries/entities-renderer/src/RenderableLightEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableLightEntityItem.cpp @@ -52,9 +52,9 @@ void LightEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPoint float exponent = entity->getExponent(); float cutoff = glm::radians(entity->getCutoff()); if (!entity->getIsSpotlight()) { - light->setType(model::Light::POINT); + light->setType(graphics::Light::POINT); } else { - light->setType(model::Light::SPOT); + light->setType(graphics::Light::SPOT); light->setSpotAngle(cutoff); light->setSpotExponent(exponent); diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 86237e75a4..3f42a353d1 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -558,10 +558,10 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { if (type == SHAPE_TYPE_STATIC_MESH) { // copy into triangleIndices triangleIndices.reserve((int32_t)((gpu::Size)(triangleIndices.size()) + indices.getNumElements())); - gpu::BufferView::Iterator partItr = parts.cbegin(); - while (partItr != parts.cend()) { + gpu::BufferView::Iterator partItr = parts.cbegin(); + while (partItr != parts.cend()) { auto numIndices = partItr->_numIndices; - if (partItr->_topology == model::Mesh::TRIANGLES) { + if (partItr->_topology == graphics::Mesh::TRIANGLES) { // TODO: assert rather than workaround after we start sanitizing FBXMesh higher up //assert(numIndices % TRIANGLE_STRIDE == 0); numIndices -= numIndices % TRIANGLE_STRIDE; // WORKAROUND lack of sanity checking in FBXReader @@ -572,7 +572,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { triangleIndices.push_back(*indexItr + meshIndexOffset); ++indexItr; } - } else if (partItr->_topology == model::Mesh::TRIANGLE_STRIP) { + } else if (partItr->_topology == graphics::Mesh::TRIANGLE_STRIP) { // TODO: resurrect assert after we start sanitizing FBXMesh higher up //assert(numIndices > 2); @@ -593,7 +593,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { // the rest use previous and next index uint32_t triangleCount = 1; while (indexItr != indexEnd) { - if ((*indexItr) != model::Mesh::PRIMITIVE_RESTART_INDEX) { + if ((*indexItr) != graphics::Mesh::PRIMITIVE_RESTART_INDEX) { if (triangleCount % 2 == 0) { // even triangles use first two indices in order triangleIndices.push_back(*(indexItr - 2) + meshIndexOffset); @@ -613,12 +613,12 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { } } else if (type == SHAPE_TYPE_SIMPLE_COMPOUND) { // for each mesh copy unique part indices, separated by special bogus (flag) index values - gpu::BufferView::Iterator partItr = parts.cbegin(); - while (partItr != parts.cend()) { + gpu::BufferView::Iterator partItr = parts.cbegin(); + while (partItr != parts.cend()) { // collect unique list of indices for this part std::set uniqueIndices; auto numIndices = partItr->_numIndices; - if (partItr->_topology == model::Mesh::TRIANGLES) { + if (partItr->_topology == graphics::Mesh::TRIANGLES) { // TODO: assert rather than workaround after we start sanitizing FBXMesh higher up //assert(numIndices% TRIANGLE_STRIDE == 0); numIndices -= numIndices % TRIANGLE_STRIDE; // WORKAROUND lack of sanity checking in FBXReader @@ -629,7 +629,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { uniqueIndices.insert(*indexItr); ++indexItr; } - } else if (partItr->_topology == model::Mesh::TRIANGLE_STRIP) { + } else if (partItr->_topology == graphics::Mesh::TRIANGLE_STRIP) { // TODO: resurrect assert after we start sanitizing FBXMesh higher up //assert(numIndices > TRIANGLE_STRIDE - 1); @@ -644,7 +644,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { // the rest use previous and next index uint32_t triangleCount = 1; while (indexItr != indexEnd) { - if ((*indexItr) != model::Mesh::PRIMITIVE_RESTART_INDEX) { + if ((*indexItr) != graphics::Mesh::PRIMITIVE_RESTART_INDEX) { if (triangleCount % 2 == 0) { // EVEN triangles use first two indices in order uniqueIndices.insert(*(indexItr - 2)); @@ -1295,7 +1295,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce ShapeType type = entity->getShapeType(); if (DependencyManager::get()->shouldRenderDebugHulls() && type != SHAPE_TYPE_STATIC_MESH && type != SHAPE_TYPE_NONE) { // NOTE: it is OK if _collisionMeshKey is nullptr - model::MeshPointer mesh = collisionMeshCache.getMesh(_collisionMeshKey); + graphics::MeshPointer mesh = collisionMeshCache.getMesh(_collisionMeshKey); // NOTE: the model will render the collisionGeometry if it has one _model->setCollisionMesh(mesh); } else { @@ -1304,7 +1304,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce collisionMeshCache.releaseMesh(_collisionMeshKey); } // clear model's collision geometry - model::MeshPointer mesh = nullptr; + graphics::MeshPointer mesh = nullptr; _model->setCollisionMesh(mesh); } } diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp index 365ba5189a..b4412e441f 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp @@ -1060,7 +1060,7 @@ void RenderablePolyVoxEntityItem::recomputeMesh() { auto entity = std::static_pointer_cast(getThisPointer()); QtConcurrent::run([entity, voxelSurfaceStyle] { - model::MeshPointer mesh(new model::Mesh()); + graphics::MeshPointer mesh(new graphics::Mesh()); // A mesh object to hold the result of surface extraction PolyVox::SurfaceMesh polyVoxMesh; @@ -1122,18 +1122,18 @@ void RenderablePolyVoxEntityItem::recomputeMesh() { sizeof(PolyVox::PositionMaterialNormal), gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ))); - std::vector parts; - parts.emplace_back(model::Mesh::Part((model::Index)0, // startIndex - (model::Index)vecIndices.size(), // numIndices - (model::Index)0, // baseVertex - model::Mesh::TRIANGLES)); // topology - mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), + std::vector parts; + parts.emplace_back(graphics::Mesh::Part((graphics::Index)0, // startIndex + (graphics::Index)vecIndices.size(), // numIndices + (graphics::Index)0, // baseVertex + graphics::Mesh::TRIANGLES)); // topology + mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); entity->setMesh(mesh); }); } -void RenderablePolyVoxEntityItem::setMesh(model::MeshPointer mesh) { +void RenderablePolyVoxEntityItem::setMesh(graphics::MeshPointer mesh) { // this catches the payload from recomputeMesh bool neighborsNeedUpdate; withWriteLock([&] { @@ -1164,7 +1164,7 @@ void RenderablePolyVoxEntityItem::computeShapeInfoWorker() { PolyVoxSurfaceStyle voxelSurfaceStyle; glm::vec3 voxelVolumeSize; - model::MeshPointer mesh; + graphics::MeshPointer mesh; withReadLock([&] { voxelSurfaceStyle = _voxelSurfaceStyle; @@ -1582,7 +1582,7 @@ void PolyVoxEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& s void PolyVoxEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) { _lastVoxelToWorldMatrix = entity->voxelToWorldMatrix(); - model::MeshPointer newMesh; + graphics::MeshPointer newMesh; entity->withReadLock([&] { newMesh = entity->_mesh; }); diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h index 8dbe1dd0f1..03c7351a59 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.h @@ -104,7 +104,7 @@ public: void forEachVoxelValue(const ivec3& voxelSize, std::function thunk); QByteArray volDataToArray(quint16 voxelXSize, quint16 voxelYSize, quint16 voxelZSize) const; - void setMesh(model::MeshPointer mesh); + void setMesh(graphics::MeshPointer mesh); void setCollisionPoints(ShapeInfo::PointCollection points, AABox box); PolyVox::SimpleVolume* getVolData() { return _volData.get(); } @@ -134,7 +134,7 @@ private: // may not match _voxelVolumeSize. bool _meshDirty { true }; // does collision-shape need to be recomputed? bool _meshReady{ false }; - model::MeshPointer _mesh; + graphics::MeshPointer _mesh; ShapeInfo _shapeInfo; @@ -178,7 +178,7 @@ private: bool _hasTransitioned{ false }; #endif - model::MeshPointer _mesh; + graphics::MeshPointer _mesh; std::array _xyzTextures; glm::vec3 _lastVoxelVolumeSize; glm::mat4 _lastVoxelToWorldMatrix; diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 4161b65ead..17cc4d2d4f 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -319,7 +319,7 @@ void ZoneEntityRenderer::updateKeySunFromEntity(const TypedEntityPointer& entity setKeyLightMode((ComponentMode)entity->getKeyLightMode()); const auto& sunLight = editSunLight(); - sunLight->setType(model::Light::SUN); + sunLight->setType(graphics::Light::SUN); sunLight->setPosition(_lastPosition); sunLight->setOrientation(_lastRotation); @@ -333,7 +333,7 @@ void ZoneEntityRenderer::updateAmbientLightFromEntity(const TypedEntityPointer& setAmbientLightMode((ComponentMode)entity->getAmbientLightMode()); const auto& ambientLight = editAmbientLight(); - ambientLight->setType(model::Light::AMBIENT); + ambientLight->setType(graphics::Light::AMBIENT); ambientLight->setPosition(_lastPosition); ambientLight->setOrientation(_lastRotation); @@ -357,23 +357,23 @@ void ZoneEntityRenderer::updateHazeFromEntity(const TypedEntityPointer& entity) haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED); haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect()); - haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange())); + haze->setHazeRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange())); xColor hazeColor = _hazeProperties.getHazeColor(); haze->setHazeColor(glm::vec3(hazeColor.red / 255.0, hazeColor.green / 255.0, hazeColor.blue / 255.0)); xColor hazeGlareColor = _hazeProperties.getHazeGlareColor(); haze->setHazeGlareColor(glm::vec3(hazeGlareColor.red / 255.0, hazeGlareColor.green / 255.0, hazeGlareColor.blue / 255.0)); haze->setHazeEnableGlare(_hazeProperties.getHazeEnableGlare()); - haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle())); + haze->setHazeGlareBlend(graphics::Haze::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle())); float hazeAltitude = _hazeProperties.getHazeCeiling() - _hazeProperties.getHazeBaseRef(); - haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude)); + haze->setHazeAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude)); haze->setHazeBaseReference(_hazeProperties.getHazeBaseRef()); haze->setHazeBackgroundBlend(_hazeProperties.getHazeBackgroundBlend()); haze->setHazeAttenuateKeyLight(_hazeProperties.getHazeAttenuateKeyLight()); - haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange())); - haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude())); + haze->setHazeKeyLightRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange())); + haze->setHazeKeyLightAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude())); haze->setZoneTransform(entity->getTransform().getMatrix()); } diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.h b/libraries/entities-renderer/src/RenderableZoneEntityItem.h index e1f696ca89..69f0663c06 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.h +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.h @@ -63,11 +63,11 @@ private: void setSkyboxColor(const glm::vec3& color); void setProceduralUserData(const QString& userData); - model::LightPointer editSunLight() { _needSunUpdate = true; return _sunLight; } - model::LightPointer editAmbientLight() { _needAmbientUpdate = true; return _ambientLight; } - model::SunSkyStagePointer editBackground() { _needBackgroundUpdate = true; return _background; } - model::SkyboxPointer editSkybox() { return editBackground()->getSkybox(); } - model::HazePointer editHaze() { _needHazeUpdate = true; return _haze; } + graphics::LightPointer editSunLight() { _needSunUpdate = true; return _sunLight; } + graphics::LightPointer editAmbientLight() { _needAmbientUpdate = true; return _ambientLight; } + graphics::SunSkyStagePointer editBackground() { _needBackgroundUpdate = true; return _background; } + graphics::SkyboxPointer editSkybox() { return editBackground()->getSkybox(); } + graphics::HazePointer editHaze() { _needHazeUpdate = true; return _haze; } bool _needsInitialSimulation{ true }; glm::vec3 _lastPosition; @@ -83,10 +83,10 @@ private: #endif LightStagePointer _stage; - const model::LightPointer _sunLight{ std::make_shared() }; - const model::LightPointer _ambientLight{ std::make_shared() }; - const model::SunSkyStagePointer _background{ std::make_shared() }; - const model::HazePointer _haze{ std::make_shared() }; + const graphics::LightPointer _sunLight{ std::make_shared() }; + const graphics::LightPointer _ambientLight{ std::make_shared() }; + const graphics::SunSkyStagePointer _background{ std::make_shared() }; + const graphics::HazePointer _haze{ std::make_shared() }; ComponentMode _keyLightMode { COMPONENT_MODE_INHERIT }; ComponentMode _ambientLightMode { COMPONENT_MODE_INHERIT }; diff --git a/libraries/fbx/src/FBX.h b/libraries/fbx/src/FBX.h index 21f8fe51aa..e40b218344 100644 --- a/libraries/fbx/src/FBX.h +++ b/libraries/fbx/src/FBX.h @@ -183,7 +183,7 @@ public: QString materialID; QString name; QString shadingModel; - model::MaterialPointer _material; + graphics::MaterialPointer _material; FBXTexture normalTexture; FBXTexture albedoTexture; @@ -238,7 +238,7 @@ public: unsigned int meshIndex; // the order the meshes appeared in the object file - model::MeshPointer _mesh; + graphics::MeshPointer _mesh; bool wasCompressed { false }; }; diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 42d25c96ea..4bc5eb1b6d 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -72,7 +72,7 @@ Extents FBXGeometry::getUnscaledMeshExtents() const { return scaledExtents; } -// TODO: Move to model::Mesh when Sam's ready +// TODO: Move to graphics::Mesh when Sam's ready bool FBXGeometry::convexHullContains(const glm::vec3& point) const { if (!getUnscaledMeshExtents().containsPoint(point)) { return false; diff --git a/libraries/fbx/src/FBXReader_Material.cpp b/libraries/fbx/src/FBXReader_Material.cpp index ef6496cd10..4aa3044934 100644 --- a/libraries/fbx/src/FBXReader_Material.cpp +++ b/libraries/fbx/src/FBXReader_Material.cpp @@ -279,7 +279,7 @@ void FBXReader::consolidateFBXMaterials(const QVariantHash& mapping) { } // Finally create the true material representation - material._material = std::make_shared(); + material._material = std::make_shared(); // Emissive color is the mix of emissiveColor with emissiveFactor auto emissive = material.emissiveColor * (isMaterialLambert ? 1.0f : material.emissiveFactor); // In lambert there is not emissiveFactor @@ -293,7 +293,7 @@ void FBXReader::consolidateFBXMaterials(const QVariantHash& mapping) { material._material->setRoughness(material.roughness); material._material->setMetallic(material.metallic); } else { - material._material->setRoughness(model::Material::shininessToRoughness(material.shininess)); + material._material->setRoughness(graphics::Material::shininessToRoughness(material.shininess)); float metallic = std::max(material.specularColor.x, std::max(material.specularColor.y, material.specularColor.z)); material._material->setMetallic(metallic); diff --git a/libraries/fbx/src/FBXReader_Mesh.cpp b/libraries/fbx/src/FBXReader_Mesh.cpp index 309c421052..bc7daa98f4 100644 --- a/libraries/fbx/src/FBXReader_Mesh.cpp +++ b/libraries/fbx/src/FBXReader_Mesh.cpp @@ -584,7 +584,7 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) { } FBXMesh& fbxMesh = extractedMesh; - model::MeshPointer mesh(new model::Mesh()); + graphics::MeshPointer mesh(new graphics::Mesh()); // Grab the vertices in a buffer auto vb = std::make_shared(); @@ -721,45 +721,45 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) { if (normalsSize) { mesh->addAttribute(gpu::Stream::NORMAL, - model::BufferView(attribBuffer, normalsOffset, normalsAndTangentsSize, + graphics::BufferView(attribBuffer, normalsOffset, normalsAndTangentsSize, normalsAndTangentsStride, FBX_NORMAL_ELEMENT)); mesh->addAttribute(gpu::Stream::TANGENT, - model::BufferView(attribBuffer, tangentsOffset, normalsAndTangentsSize, + graphics::BufferView(attribBuffer, tangentsOffset, normalsAndTangentsSize, normalsAndTangentsStride, FBX_NORMAL_ELEMENT)); } if (colorsSize) { mesh->addAttribute(gpu::Stream::COLOR, - model::BufferView(attribBuffer, colorsOffset, colorsSize, FBX_COLOR_ELEMENT)); + graphics::BufferView(attribBuffer, colorsOffset, colorsSize, FBX_COLOR_ELEMENT)); } if (texCoordsSize) { mesh->addAttribute(gpu::Stream::TEXCOORD, - model::BufferView( attribBuffer, texCoordsOffset, texCoordsSize, + graphics::BufferView( attribBuffer, texCoordsOffset, texCoordsSize, gpu::Element(gpu::VEC2, gpu::HALF, gpu::UV))); } if (texCoords1Size) { mesh->addAttribute( gpu::Stream::TEXCOORD1, - model::BufferView(attribBuffer, texCoords1Offset, texCoords1Size, + graphics::BufferView(attribBuffer, texCoords1Offset, texCoords1Size, gpu::Element(gpu::VEC2, gpu::HALF, gpu::UV))); } else if (texCoordsSize) { mesh->addAttribute(gpu::Stream::TEXCOORD1, - model::BufferView(attribBuffer, texCoordsOffset, texCoordsSize, + graphics::BufferView(attribBuffer, texCoordsOffset, texCoordsSize, gpu::Element(gpu::VEC2, gpu::HALF, gpu::UV))); } if (clusterIndicesSize) { if (fbxMesh.clusters.size() < UINT8_MAX) { mesh->addAttribute(gpu::Stream::SKIN_CLUSTER_INDEX, - model::BufferView(attribBuffer, clusterIndicesOffset, clusterIndicesSize, + graphics::BufferView(attribBuffer, clusterIndicesOffset, clusterIndicesSize, gpu::Element(gpu::VEC4, gpu::UINT8, gpu::XYZW))); } else { mesh->addAttribute(gpu::Stream::SKIN_CLUSTER_INDEX, - model::BufferView(attribBuffer, clusterIndicesOffset, clusterIndicesSize, + graphics::BufferView(attribBuffer, clusterIndicesOffset, clusterIndicesSize, gpu::Element(gpu::VEC4, gpu::UINT16, gpu::XYZW))); } } if (clusterWeightsSize) { mesh->addAttribute(gpu::Stream::SKIN_CLUSTER_WEIGHT, - model::BufferView(attribBuffer, clusterWeightsOffset, clusterWeightsSize, + graphics::BufferView(attribBuffer, clusterWeightsOffset, clusterWeightsSize, gpu::Element(gpu::VEC4, gpu::NUINT16, gpu::XYZW))); } @@ -780,12 +780,12 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) { int indexNum = 0; int offset = 0; - std::vector< model::Mesh::Part > parts; + std::vector< graphics::Mesh::Part > parts; if (extractedMesh.parts.size() > 1) { indexNum = 0; } foreach(const FBXMeshPart& part, extractedMesh.parts) { - model::Mesh::Part modelPart(indexNum, 0, 0, model::Mesh::TRIANGLES); + graphics::Mesh::Part modelPart(indexNum, 0, 0, graphics::Mesh::TRIANGLES); if (part.quadTrianglesIndices.size()) { indexBuffer->setSubData(offset, @@ -813,7 +813,7 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) { if (parts.size()) { auto pb = std::make_shared(); - pb->setData(parts.size() * sizeof(model::Mesh::Part), (const gpu::Byte*) parts.data()); + pb->setData(parts.size() * sizeof(graphics::Mesh::Part), (const gpu::Byte*) parts.data()); gpu::BufferView pbv(pb, gpu::Element(gpu::VEC4, gpu::UINT32, gpu::XYZW)); mesh->setPartBuffer(pbv); } else { @@ -821,7 +821,7 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) { return; } - // model::Box box = + // graphics::Box box = mesh->evalPartBound(0); extractedMesh._mesh = mesh; diff --git a/libraries/fbx/src/GLTFReader.cpp b/libraries/fbx/src/GLTFReader.cpp index c8501688ac..0c04b3d733 100644 --- a/libraries/fbx/src/GLTFReader.cpp +++ b/libraries/fbx/src/GLTFReader.cpp @@ -748,7 +748,7 @@ bool GLTFReader::buildGeometry(FBXGeometry& geometry, const QUrl& url) { QString& matid = materialIDs[i]; geometry.materials[matid] = FBXMaterial(); FBXMaterial& fbxMaterial = geometry.materials[matid]; - fbxMaterial._material = std::make_shared(); + fbxMaterial._material = std::make_shared(); setFBXMaterial(fbxMaterial, _file.materials[i]); } diff --git a/libraries/fbx/src/OBJReader.cpp b/libraries/fbx/src/OBJReader.cpp index 7fb916efde..ba93a49cb9 100644 --- a/libraries/fbx/src/OBJReader.cpp +++ b/libraries/fbx/src/OBJReader.cpp @@ -750,8 +750,8 @@ FBXGeometry* OBJReader::readOBJ(QByteArray& model, const QVariantHash& mapping, objMaterial.opacity); FBXMaterial& fbxMaterial = geometry.materials[materialID]; fbxMaterial.materialID = materialID; - fbxMaterial._material = std::make_shared(); - model::MaterialPointer modelMaterial = fbxMaterial._material; + fbxMaterial._material = std::make_shared(); + graphics::MaterialPointer modelMaterial = fbxMaterial._material; if (!objMaterial.diffuseTextureFilename.isEmpty()) { fbxMaterial.albedoTexture.filename = objMaterial.diffuseTextureFilename; @@ -763,7 +763,7 @@ FBXGeometry* OBJReader::readOBJ(QByteArray& model, const QVariantHash& mapping, modelMaterial->setEmissive(fbxMaterial.emissiveColor); modelMaterial->setAlbedo(fbxMaterial.diffuseColor); modelMaterial->setMetallic(glm::length(fbxMaterial.specularColor)); - modelMaterial->setRoughness(model::Material::shininessToRoughness(fbxMaterial.shininess)); + modelMaterial->setRoughness(graphics::Material::shininessToRoughness(fbxMaterial.shininess)); if (fbxMaterial.opacity <= 0.0f) { modelMaterial->setOpacity(1.0f); diff --git a/libraries/fbx/src/OBJWriter.cpp b/libraries/fbx/src/OBJWriter.cpp index 42ef2be646..4441ae6649 100644 --- a/libraries/fbx/src/OBJWriter.cpp +++ b/libraries/fbx/src/OBJWriter.cpp @@ -105,13 +105,13 @@ bool writeOBJToTextStream(QTextStream& out, QList meshes) { const gpu::BufferView& partBuffer = mesh->getPartBuffer(); const gpu::BufferView& indexBuffer = mesh->getIndexBuffer(); - model::Index partCount = (model::Index)mesh->getNumParts(); + graphics::Index partCount = (graphics::Index)mesh->getNumParts(); for (int partIndex = 0; partIndex < partCount; partIndex++) { - const model::Mesh::Part& part = partBuffer.get(partIndex); + const graphics::Mesh::Part& part = partBuffer.get(partIndex); out << "g part-" << nth++ << "\n"; - // model::Mesh::TRIANGLES + // graphics::Mesh::TRIANGLES // TODO -- handle other formats gpu::BufferView::Iterator indexItr = indexBuffer.cbegin(); indexItr += part._startIndex; diff --git a/libraries/fbx/src/OBJWriter.h b/libraries/fbx/src/OBJWriter.h index 7f8b0ddbed..536e8cf837 100644 --- a/libraries/fbx/src/OBJWriter.h +++ b/libraries/fbx/src/OBJWriter.h @@ -17,7 +17,7 @@ #include #include -using MeshPointer = std::shared_ptr; +using MeshPointer = std::shared_ptr; bool writeOBJToTextStream(QTextStream& out, QList meshes); bool writeOBJToFile(QString path, QList meshes); diff --git a/libraries/graphics/src/graphics/Asset.cpp b/libraries/graphics/src/graphics/Asset.cpp index 84d7560257..ef5f010b4e 100644 --- a/libraries/graphics/src/graphics/Asset.cpp +++ b/libraries/graphics/src/graphics/Asset.cpp @@ -10,7 +10,7 @@ // #include "Asset.h" -using namespace model; +using namespace graphics; Asset::Asset() { } diff --git a/libraries/graphics/src/graphics/Asset.h b/libraries/graphics/src/graphics/Asset.h index c2e4ff3d3a..86d98c1a69 100644 --- a/libraries/graphics/src/graphics/Asset.h +++ b/libraries/graphics/src/graphics/Asset.h @@ -17,7 +17,7 @@ #include "Material.h" #include "Geometry.h" -namespace model { +namespace graphics { template class Table { diff --git a/libraries/graphics/src/graphics/Forward.h b/libraries/graphics/src/graphics/Forward.h index 7f728b44fc..95d2d73099 100644 --- a/libraries/graphics/src/graphics/Forward.h +++ b/libraries/graphics/src/graphics/Forward.h @@ -11,7 +11,7 @@ #ifndef hifi_model_Forward_h #define hifi_model_Forward_h -namespace model { +namespace graphics { class Mesh; using MeshPointer = std::shared_ptr; } diff --git a/libraries/graphics/src/graphics/Geometry.cpp b/libraries/graphics/src/graphics/Geometry.cpp index 930449c5e6..ba5afcbc62 100755 --- a/libraries/graphics/src/graphics/Geometry.cpp +++ b/libraries/graphics/src/graphics/Geometry.cpp @@ -13,7 +13,7 @@ #include -using namespace model; +using namespace graphics; Mesh::Mesh() : _vertexBuffer(gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ)), @@ -137,7 +137,7 @@ Box Mesh::evalPartsBound(int partStart, int partEnd) const { } -model::MeshPointer Mesh::map(std::function vertexFunc, +graphics::MeshPointer Mesh::map(std::function vertexFunc, std::function colorFunc, std::function normalFunc, std::function indexFunc) const { @@ -223,7 +223,7 @@ model::MeshPointer Mesh::map(std::function vertexFunc, indexDataCursor += sizeof(index); } - model::MeshPointer result(new model::Mesh()); + graphics::MeshPointer result(new graphics::Mesh()); gpu::Element vertexElement = gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ); gpu::Buffer* resultVertexBuffer = new gpu::Buffer(vertexSize, resultVertexData.get()); @@ -252,12 +252,12 @@ model::MeshPointer Mesh::map(std::function vertexFunc, // TODO -- shouldn't assume just one part - std::vector parts; - parts.emplace_back(model::Mesh::Part((model::Index)0, // startIndex - (model::Index)result->getNumIndices(), // numIndices - (model::Index)0, // baseVertex - model::Mesh::TRIANGLES)); // topology - result->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), + std::vector parts; + parts.emplace_back(graphics::Mesh::Part((graphics::Index)0, // startIndex + (graphics::Index)result->getNumIndices(), // numIndices + (graphics::Index)0, // baseVertex + graphics::Mesh::TRIANGLES)); // topology + result->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); return result; @@ -350,9 +350,9 @@ MeshPointer Mesh::createIndexedTriangles_P3F(uint32_t numVertices, uint32_t numI } - std::vector parts; - parts.push_back(model::Mesh::Part(0, numIndices, 0, model::Mesh::TRIANGLES)); - mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); + std::vector parts; + parts.push_back(graphics::Mesh::Part(0, numIndices, 0, graphics::Mesh::TRIANGLES)); + mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); return mesh; } diff --git a/libraries/graphics/src/graphics/Geometry.h b/libraries/graphics/src/graphics/Geometry.h index 510cf54742..cd64a7c185 100755 --- a/libraries/graphics/src/graphics/Geometry.h +++ b/libraries/graphics/src/graphics/Geometry.h @@ -18,7 +18,7 @@ #include #include -namespace model { +namespace graphics { typedef gpu::BufferView::Index Index; typedef gpu::BufferView BufferView; typedef AABox Box; @@ -40,7 +40,7 @@ public: typedef gpu::Stream::Format VertexFormat; typedef std::map< Slot, BufferView > BufferViewMap; - typedef model::Vec3 Vec3; + typedef graphics::Vec3 Vec3; Mesh(); Mesh(const Mesh& mesh); diff --git a/libraries/graphics/src/graphics/Haze.cpp b/libraries/graphics/src/graphics/Haze.cpp index dd07afc6d6..c788bc57db 100644 --- a/libraries/graphics/src/graphics/Haze.cpp +++ b/libraries/graphics/src/graphics/Haze.cpp @@ -12,7 +12,7 @@ #include #include "Haze.h" -using namespace model; +using namespace graphics; const float Haze::INITIAL_HAZE_RANGE{ 1000.0f }; const float Haze::INITIAL_HAZE_HEIGHT{ 200.0f }; diff --git a/libraries/graphics/src/graphics/Haze.h b/libraries/graphics/src/graphics/Haze.h index 260f5f0097..608449a97e 100644 --- a/libraries/graphics/src/graphics/Haze.h +++ b/libraries/graphics/src/graphics/Haze.h @@ -17,7 +17,7 @@ #include "Transform.h" #include "NumericalConstants.h" -namespace model { +namespace graphics { // Haze range is defined here as the range the visibility is reduced by 95% // Haze altitude is defined here as the altitude (above 0) that the haze is reduced by 95% diff --git a/libraries/graphics/src/graphics/Light.cpp b/libraries/graphics/src/graphics/Light.cpp index 8b6aae7759..cb5209d4cf 100755 --- a/libraries/graphics/src/graphics/Light.cpp +++ b/libraries/graphics/src/graphics/Light.cpp @@ -10,7 +10,7 @@ // #include "Light.h" -using namespace model; +using namespace graphics; Light::Light() { updateLightRadius(); diff --git a/libraries/graphics/src/graphics/Light.h b/libraries/graphics/src/graphics/Light.h index 58d5c0cf2a..360e3f224e 100755 --- a/libraries/graphics/src/graphics/Light.h +++ b/libraries/graphics/src/graphics/Light.h @@ -19,7 +19,7 @@ #include "gpu/Resource.h" #include "gpu/Texture.h" -namespace model { +namespace graphics { typedef gpu::BufferView UniformBufferView; typedef gpu::TextureView TextureView; typedef glm::vec3 Vec3; diff --git a/libraries/graphics/src/graphics/Material.cpp b/libraries/graphics/src/graphics/Material.cpp index 0cfb9916ac..ea5bd331c9 100755 --- a/libraries/graphics/src/graphics/Material.cpp +++ b/libraries/graphics/src/graphics/Material.cpp @@ -12,7 +12,7 @@ #include "TextureMap.h" -using namespace model; +using namespace graphics; using namespace gpu; Material::Material() : diff --git a/libraries/graphics/src/graphics/Material.h b/libraries/graphics/src/graphics/Material.h index 6a2b1c2bee..cfbfaa61ea 100755 --- a/libraries/graphics/src/graphics/Material.h +++ b/libraries/graphics/src/graphics/Material.h @@ -20,7 +20,7 @@ #include -namespace model { +namespace graphics { class TextureMap; typedef std::shared_ptr< TextureMap > TextureMapPointer; diff --git a/libraries/graphics/src/graphics/Skybox.cpp b/libraries/graphics/src/graphics/Skybox.cpp index feb9fb86b7..6fb7226089 100755 --- a/libraries/graphics/src/graphics/Skybox.cpp +++ b/libraries/graphics/src/graphics/Skybox.cpp @@ -18,7 +18,7 @@ #include "skybox_vert.h" #include "skybox_frag.h" -using namespace model; +using namespace graphics; Skybox::Skybox() { Schema schema; diff --git a/libraries/graphics/src/graphics/Skybox.h b/libraries/graphics/src/graphics/Skybox.h index 99155bdd98..d06989a457 100755 --- a/libraries/graphics/src/graphics/Skybox.h +++ b/libraries/graphics/src/graphics/Skybox.h @@ -19,7 +19,7 @@ class ViewFrustum; namespace gpu { class Batch; } -namespace model { +namespace graphics { typedef glm::vec3 Color; diff --git a/libraries/graphics/src/graphics/Stage.cpp b/libraries/graphics/src/graphics/Stage.cpp index 3a300858fe..312ece6889 100644 --- a/libraries/graphics/src/graphics/Stage.cpp +++ b/libraries/graphics/src/graphics/Stage.cpp @@ -15,7 +15,7 @@ #include #include -using namespace model; +using namespace graphics; void EarthSunModel::updateAll() const { diff --git a/libraries/graphics/src/graphics/Stage.h b/libraries/graphics/src/graphics/Stage.h index 65c7b016d6..55f6145ee0 100644 --- a/libraries/graphics/src/graphics/Stage.h +++ b/libraries/graphics/src/graphics/Stage.h @@ -16,7 +16,7 @@ #include "Light.h" #include "Skybox.h" -namespace model { +namespace graphics { typedef glm::dvec3 Vec3d; typedef glm::dvec4 Vec4d; diff --git a/libraries/graphics/src/graphics/TextureMap.cpp b/libraries/graphics/src/graphics/TextureMap.cpp index 7a4eb6391e..e2f24d68ff 100755 --- a/libraries/graphics/src/graphics/TextureMap.cpp +++ b/libraries/graphics/src/graphics/TextureMap.cpp @@ -10,7 +10,7 @@ // #include "TextureMap.h" -using namespace model; +using namespace graphics; using namespace gpu; void TextureMap::setTextureSource(TextureSourcePointer& textureSource) { diff --git a/libraries/graphics/src/graphics/TextureMap.h b/libraries/graphics/src/graphics/TextureMap.h index 268c3daef8..1678d9df98 100755 --- a/libraries/graphics/src/graphics/TextureMap.h +++ b/libraries/graphics/src/graphics/TextureMap.h @@ -15,7 +15,7 @@ #include "Transform.h" -namespace model { +namespace graphics { class TextureMap { public: diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index 6a14e6d6b7..07f7283bfa 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -516,13 +516,13 @@ QUrl NetworkMaterial::getTextureUrl(const QUrl& baseUrl, const FBXTexture& textu } } -model::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture, +graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture, image::TextureUsage::Type type, MapChannel channel) { const auto url = getTextureUrl(baseUrl, fbxTexture); const auto texture = DependencyManager::get()->getTexture(url, type, fbxTexture.content, fbxTexture.maxNumPixels); _textures[channel] = Texture { fbxTexture.name, texture }; - auto map = std::make_shared(); + auto map = std::make_shared(); if (texture) { map->setTextureSource(texture->_textureSource); } @@ -531,18 +531,18 @@ model::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, c return map; } -model::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& url, image::TextureUsage::Type type, MapChannel channel) { +graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& url, image::TextureUsage::Type type, MapChannel channel) { const auto texture = DependencyManager::get()->getTexture(url, type); _textures[channel].texture = texture; - auto map = std::make_shared(); + auto map = std::make_shared(); map->setTextureSource(texture->_textureSource); return map; } NetworkMaterial::NetworkMaterial(const FBXMaterial& material, const QUrl& textureBaseUrl) : - model::Material(*material._material) + graphics::Material(*material._material) { _textures = Textures(MapChannel::NUM_MAP_CHANNELS); if (!material.albedoTexture.filename.isEmpty()) { diff --git a/libraries/model-networking/src/model-networking/ModelCache.h b/libraries/model-networking/src/model-networking/ModelCache.h index 5c49ec683a..f650b3f2eb 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.h +++ b/libraries/model-networking/src/model-networking/ModelCache.h @@ -38,7 +38,7 @@ public: Geometry(const Geometry& geometry); // Immutable over lifetime - using GeometryMeshes = std::vector>; + using GeometryMeshes = std::vector>; using GeometryMeshParts = std::vector>; // Mutable, but must retain structure of vector @@ -157,9 +157,9 @@ private: virtual ~ModelCache() = default; }; -class NetworkMaterial : public model::Material { +class NetworkMaterial : public graphics::Material { public: - using MapChannel = model::Material::MapChannel; + using MapChannel = graphics::Material::MapChannel; NetworkMaterial(const FBXMaterial& material, const QUrl& textureBaseUrl); @@ -185,9 +185,9 @@ protected: private: // Helpers for the ctors QUrl getTextureUrl(const QUrl& baseUrl, const FBXTexture& fbxTexture); - model::TextureMapPointer fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture, + graphics::TextureMapPointer fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture, image::TextureUsage::Type type, MapChannel channel); - model::TextureMapPointer fetchTextureMap(const QUrl& url, image::TextureUsage::Type type, MapChannel channel); + graphics::TextureMapPointer fetchTextureMap(const QUrl& url, image::TextureUsage::Type type, MapChannel channel); Transform _albedoTransform; Transform _lightmapTransform; diff --git a/libraries/physics/src/CollisionRenderMeshCache.cpp b/libraries/physics/src/CollisionRenderMeshCache.cpp index 40a8a4aff9..6f66b9af10 100644 --- a/libraries/physics/src/CollisionRenderMeshCache.cpp +++ b/libraries/physics/src/CollisionRenderMeshCache.cpp @@ -21,7 +21,7 @@ const int32_t MAX_HULL_INDICES = 6 * MAX_HULL_POINTS; const int32_t MAX_HULL_NORMALS = MAX_HULL_INDICES; float tempVertices[MAX_HULL_NORMALS]; -model::Index tempIndexBuffer[MAX_HULL_INDICES]; +graphics::Index tempIndexBuffer[MAX_HULL_INDICES]; bool copyShapeToMesh(const btTransform& transform, const btConvexShape* shape, gpu::BufferView& vertices, gpu::BufferView& indices, gpu::BufferView& parts, @@ -40,21 +40,21 @@ bool copyShapeToMesh(const btTransform& transform, const btConvexShape* shape, assert(numHullVertices <= MAX_HULL_POINTS); { // new part - model::Mesh::Part part; - part._startIndex = (model::Index)indices.getNumElements(); - part._numIndices = (model::Index)numHullIndices; + graphics::Mesh::Part part; + part._startIndex = (graphics::Index)indices.getNumElements(); + part._numIndices = (graphics::Index)numHullIndices; // FIXME: the render code cannot handle the case where part._baseVertex != 0 //part._baseVertex = vertices.getNumElements(); // DOES NOT WORK part._baseVertex = 0; - gpu::BufferView::Size numBytes = sizeof(model::Mesh::Part); + gpu::BufferView::Size numBytes = sizeof(graphics::Mesh::Part); const gpu::Byte* data = reinterpret_cast(&part); parts._buffer->append(numBytes, data); parts._size = parts._buffer->getSize(); } const int32_t SIZE_OF_VEC3 = 3 * sizeof(float); - model::Index indexOffset = (model::Index)vertices.getNumElements(); + graphics::Index indexOffset = (graphics::Index)vertices.getNumElements(); { // new indices const uint32_t* hullIndices = hull.getIndexPointer(); @@ -64,7 +64,7 @@ bool copyShapeToMesh(const btTransform& transform, const btConvexShape* shape, tempIndexBuffer[i] = hullIndices[i] + indexOffset; } const gpu::Byte* data = reinterpret_cast(tempIndexBuffer); - gpu::BufferView::Size numBytes = (gpu::BufferView::Size)(sizeof(model::Index) * numHullIndices); + gpu::BufferView::Size numBytes = (gpu::BufferView::Size)(sizeof(graphics::Index) * numHullIndices); indices._buffer->append(numBytes, data); indices._size = indices._buffer->getSize(); } @@ -105,8 +105,8 @@ bool copyShapeToMesh(const btTransform& transform, const btConvexShape* shape, return true; } -model::MeshPointer createMeshFromShape(const void* pointer) { - model::MeshPointer mesh; +graphics::MeshPointer createMeshFromShape(const void* pointer) { + graphics::MeshPointer mesh; if (!pointer) { return mesh; } @@ -147,7 +147,7 @@ model::MeshPointer createMeshFromShape(const void* pointer) { } } if (numSuccesses > 0) { - mesh = std::make_shared(); + mesh = std::make_shared(); mesh->setVertexBuffer(vertices); mesh->setIndexBuffer(indices); mesh->setPartBuffer(parts); @@ -167,8 +167,8 @@ CollisionRenderMeshCache::~CollisionRenderMeshCache() { _pendingGarbage.clear(); } -model::MeshPointer CollisionRenderMeshCache::getMesh(CollisionRenderMeshCache::Key key) { - model::MeshPointer mesh; +graphics::MeshPointer CollisionRenderMeshCache::getMesh(CollisionRenderMeshCache::Key key) { + graphics::MeshPointer mesh; if (key) { CollisionMeshMap::const_iterator itr = _meshMap.find(key); if (itr == _meshMap.end()) { diff --git a/libraries/physics/src/CollisionRenderMeshCache.h b/libraries/physics/src/CollisionRenderMeshCache.h index 64f161e229..c5b643c0cc 100644 --- a/libraries/physics/src/CollisionRenderMeshCache.h +++ b/libraries/physics/src/CollisionRenderMeshCache.h @@ -27,7 +27,7 @@ public: ~CollisionRenderMeshCache(); /// \return pointer to geometry - model::MeshPointer getMesh(Key key); + graphics::MeshPointer getMesh(Key key); /// \return true if geometry was found and released bool releaseMesh(Key key); @@ -40,7 +40,7 @@ public: bool hasMesh(Key key) const { return _meshMap.find(key) == _meshMap.end(); } private: - using CollisionMeshMap = std::unordered_map; + using CollisionMeshMap = std::unordered_map; CollisionMeshMap _meshMap; std::vector _pendingGarbage; }; diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.cpp b/libraries/procedural/src/procedural/ProceduralSkybox.cpp index 60cb4d8fc4..f0c60e2101 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.cpp +++ b/libraries/procedural/src/procedural/ProceduralSkybox.cpp @@ -18,7 +18,7 @@ #include #include -ProceduralSkybox::ProceduralSkybox() : model::Skybox() { +ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() { _procedural._vertexSource = skybox_vert; _procedural._fragmentSource = skybox_frag; // Adjust the pipeline state for background using the stencil test diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.h b/libraries/procedural/src/procedural/ProceduralSkybox.h index 14481a57c7..5db1078a5f 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.h +++ b/libraries/procedural/src/procedural/ProceduralSkybox.h @@ -17,7 +17,7 @@ #include "Procedural.h" -class ProceduralSkybox: public model::Skybox { +class ProceduralSkybox: public graphics::Skybox { public: ProceduralSkybox(); diff --git a/libraries/render-utils/src/BackgroundStage.cpp b/libraries/render-utils/src/BackgroundStage.cpp index 2d2c0ed150..493c28d840 100644 --- a/libraries/render-utils/src/BackgroundStage.cpp +++ b/libraries/render-utils/src/BackgroundStage.cpp @@ -64,8 +64,8 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, auto backgroundStage = renderContext->_scene->getStage(); assert(backgroundStage); - model::SunSkyStagePointer background; - model::SkyboxPointer skybox; + graphics::SunSkyStagePointer background; + graphics::SkyboxPointer skybox; if (backgroundStage->_currentFrame._backgrounds.size()) { auto backgroundId = backgroundStage->_currentFrame._backgrounds.front(); auto background = backgroundStage->getBackground(backgroundId); @@ -76,7 +76,7 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, /* auto backgroundMode = skyStage->getBackgroundMode(); switch (backgroundMode) { - case model::SunSkyStage::SKY_DEFAULT: { + case graphics::SunSkyStage::SKY_DEFAULT: { auto scene = DependencyManager::get()->getStage(); auto sceneKeyLight = scene->getKeyLight(); @@ -88,7 +88,7 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, // fall through: render a skybox (if available), or the defaults (if requested) } - case model::SunSkyStage::SKY_BOX: {*/ + case graphics::SunSkyStage::SKY_BOX: {*/ if (skybox && !skybox->empty()) { PerformanceTimer perfTimer("skybox"); auto args = renderContext->args; @@ -118,7 +118,7 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, // fall through: render defaults (if requested) // } /* - case model::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: { + case graphics::SunSkyStage::SKY_DEFAULT_AMBIENT_TEXTURE: { if (Menu::getInstance()->isOptionChecked(MenuOption::DefaultSkybox)) { auto scene = DependencyManager::get()->getStage(); auto sceneKeyLight = scene->getKeyLight(); diff --git a/libraries/render-utils/src/BackgroundStage.h b/libraries/render-utils/src/BackgroundStage.h index b890a8cb28..db876b1993 100644 --- a/libraries/render-utils/src/BackgroundStage.h +++ b/libraries/render-utils/src/BackgroundStage.h @@ -30,8 +30,8 @@ public: static const Index INVALID_INDEX; static bool isIndexInvalid(Index index) { return index == INVALID_INDEX; } - using BackgroundPointer = model::SunSkyStagePointer; - using Backgrounds = render::indexed_container::IndexedPointerVector; + using BackgroundPointer = graphics::SunSkyStagePointer; + using Backgrounds = render::indexed_container::IndexedPointerVector; using BackgroundMap = std::unordered_map; using BackgroundIndices = std::vector; diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index 81a33f17e3..b4fc2fd32d 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -103,13 +103,13 @@ void DeferredLightingEffect::init() { void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) { PerformanceTimer perfTimer("DLE->setupBatch()"); - model::LightPointer keySunLight; + graphics::LightPointer keySunLight; auto lightStage = args->_scene->getStage(); if (lightStage) { keySunLight = lightStage->getCurrentKeyLight(); } - model::LightPointer keyAmbiLight; + graphics::LightPointer keyAmbiLight; if (lightStage) { keyAmbiLight = lightStage->getCurrentAmbientLight(); } @@ -229,9 +229,9 @@ static void loadLightProgram(const char* vertSource, const char* fragSource, boo #include -model::MeshPointer DeferredLightingEffect::getPointLightMesh() { +graphics::MeshPointer DeferredLightingEffect::getPointLightMesh() { if (!_pointLightMesh) { - _pointLightMesh = std::make_shared(); + _pointLightMesh = std::make_shared(); // let's use a icosahedron auto solid = geometry::icosahedron(); @@ -256,19 +256,19 @@ model::MeshPointer DeferredLightingEffect::getPointLightMesh() { delete[] indexData; - std::vector parts; - parts.push_back(model::Mesh::Part(0, nbIndices, 0, model::Mesh::TRIANGLES)); - parts.push_back(model::Mesh::Part(0, nbIndices, 0, model::Mesh::LINE_STRIP)); // outline version + std::vector parts; + parts.push_back(graphics::Mesh::Part(0, nbIndices, 0, graphics::Mesh::TRIANGLES)); + parts.push_back(graphics::Mesh::Part(0, nbIndices, 0, graphics::Mesh::LINE_STRIP)); // outline version - _pointLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); + _pointLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); } return _pointLightMesh; } -model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { +graphics::MeshPointer DeferredLightingEffect::getSpotLightMesh() { if (!_spotLightMesh) { - _spotLightMesh = std::make_shared(); + _spotLightMesh = std::make_shared(); int slices = 16; int rings = 3; @@ -353,12 +353,12 @@ model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { delete[] indexData; - std::vector parts; - parts.push_back(model::Mesh::Part(0, indices, 0, model::Mesh::TRIANGLES)); - parts.push_back(model::Mesh::Part(0, indices, 0, model::Mesh::LINE_STRIP)); // outline version + std::vector parts; + parts.push_back(graphics::Mesh::Part(0, indices, 0, graphics::Mesh::TRIANGLES)); + parts.push_back(graphics::Mesh::Part(0, indices, 0, graphics::Mesh::LINE_STRIP)); // outline version - _spotLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); + _spotLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); } return _spotLightMesh; } @@ -439,7 +439,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, const DeferredFrameTransformPointer& frameTransform, const DeferredFramebufferPointer& deferredFramebuffer, const LightingModelPointer& lightingModel, - const model::HazePointer& haze, + const graphics::HazePointer& haze, const SurfaceGeometryFramebufferPointer& surfaceGeometryFramebuffer, const AmbientOcclusionFramebufferPointer& ambientOcclusionFramebuffer, const SubsurfaceScatteringResourcePointer& subsurfaceScatteringResource) { @@ -513,7 +513,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, auto keyLight = lightAndShadow.first; - model::LightPointer keyAmbientLight; + graphics::LightPointer keyAmbientLight; if (lightStage && lightStage->_currentFrame._ambientLights.size()) { keyAmbientLight = lightStage->getLight(lightStage->_currentFrame._ambientLights.front()); } @@ -744,12 +744,12 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { if (lightStage) { // Allocate a default global light directional and ambient - auto lp = std::make_shared(); - lp->setType(model::Light::SUN); + auto lp = std::make_shared(); + lp->setType(graphics::Light::SUN); lp->setDirection(glm::vec3(-1.0f)); lp->setColor(glm::vec3(1.0f)); lp->setIntensity(1.0f); - lp->setType(model::Light::SUN); + lp->setType(graphics::Light::SUN); lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset::OLD_TOWN_SQUARE); lp->setAmbientIntensity(0.5f); @@ -771,7 +771,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { auto backgroundStage = renderContext->_scene->getStage(); if (backgroundStage) { - auto background = std::make_shared(); + auto background = std::make_shared(); background->setSkybox(_defaultSkybox); // capture deault background @@ -786,7 +786,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { auto hazeStage = renderContext->_scene->getStage(); if (hazeStage) { - auto haze = std::make_shared(); + auto haze = std::make_shared(); _defaultHaze = haze; _defaultHazeID = hazeStage->addHaze(_defaultHaze); diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 8d0fc619e5..6d2c0a6819 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -61,10 +61,10 @@ private: bool _shadowMapEnabled{ false }; bool _ambientOcclusionEnabled{ false }; - model::MeshPointer _pointLightMesh; - model::MeshPointer getPointLightMesh(); - model::MeshPointer _spotLightMesh; - model::MeshPointer getSpotLightMesh(); + graphics::MeshPointer _pointLightMesh; + graphics::MeshPointer getPointLightMesh(); + graphics::MeshPointer _spotLightMesh; + graphics::MeshPointer getSpotLightMesh(); gpu::PipelinePointer _directionalSkyboxLight; gpu::PipelinePointer _directionalAmbientSphereLight; @@ -121,7 +121,7 @@ public: const DeferredFrameTransformPointer& frameTransform, const DeferredFramebufferPointer& deferredFramebuffer, const LightingModelPointer& lightingModel, - const model::HazePointer& haze, + const graphics::HazePointer& haze, const SurfaceGeometryFramebufferPointer& surfaceGeometryFramebuffer, const AmbientOcclusionFramebufferPointer& ambientOcclusionFramebuffer, const SubsurfaceScatteringResourcePointer& subsurfaceScatteringResource); @@ -158,7 +158,7 @@ class RenderDeferred { public: using Inputs = render::VaryingSet8 < DeferredFrameTransformPointer, DeferredFramebufferPointer, LightingModelPointer, SurfaceGeometryFramebufferPointer, - AmbientOcclusionFramebufferPointer, SubsurfaceScatteringResourcePointer, LightClustersPointer, model::HazePointer>; + AmbientOcclusionFramebufferPointer, SubsurfaceScatteringResourcePointer, LightClustersPointer, graphics::HazePointer>; using Config = RenderDeferredConfig; using JobModel = render::Job::ModelI; @@ -184,13 +184,13 @@ public: void run(const render::RenderContextPointer& renderContext); protected: - model::LightPointer _defaultLight; + graphics::LightPointer _defaultLight; LightStage::Index _defaultLightID{ LightStage::INVALID_INDEX }; - model::SunSkyStagePointer _defaultBackground; + graphics::SunSkyStagePointer _defaultBackground; BackgroundStage::Index _defaultBackgroundID{ BackgroundStage::INVALID_INDEX }; - model::HazePointer _defaultHaze{ nullptr }; + graphics::HazePointer _defaultHaze{ nullptr }; HazeStage::Index _defaultHazeID{ HazeStage::INVALID_INDEX }; - model::SkyboxPointer _defaultSkybox { new ProceduralSkybox() }; + graphics::SkyboxPointer _defaultSkybox { new ProceduralSkybox() }; gpu::TexturePointer _defaultSkyboxTexture; gpu::TexturePointer _defaultSkyboxAmbientTexture; }; diff --git a/libraries/render-utils/src/DrawHaze.cpp b/libraries/render-utils/src/DrawHaze.cpp index da07f5bd9b..64a106a09c 100644 --- a/libraries/render-utils/src/DrawHaze.cpp +++ b/libraries/render-utils/src/DrawHaze.cpp @@ -78,12 +78,12 @@ void HazeConfig::setHazeBackgroundBlend(const float value) { } MakeHaze::MakeHaze() { - _haze = std::make_shared(); + _haze = std::make_shared(); } void MakeHaze::configure(const Config& config) { _haze->setHazeColor(config.hazeColor); - _haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle)); + _haze->setHazeGlareBlend(graphics::Haze::convertGlareAngleToPower(config.hazeGlareAngle)); _haze->setHazeGlareColor(config.hazeGlareColor); _haze->setHazeBaseReference(config.hazeBaseReference); @@ -94,16 +94,16 @@ void MakeHaze::configure(const Config& config) { _haze->setModulateColorActive(config.isModulateColorActive); _haze->setHazeEnableGlare(config.isHazeEnableGlare); - _haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange)); - _haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight)); + _haze->setHazeRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange)); + _haze->setHazeAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight)); - _haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange)); - _haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude)); + _haze->setHazeKeyLightRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange)); + _haze->setHazeKeyLightAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude)); _haze->setHazeBackgroundBlend(config.hazeBackgroundBlend); } -void MakeHaze::run(const render::RenderContextPointer& renderContext, model::HazePointer& haze) { +void MakeHaze::run(const render::RenderContextPointer& renderContext, graphics::HazePointer& haze) { haze = _haze; } @@ -168,7 +168,7 @@ void DrawHaze::run(const render::RenderContextPointer& renderContext, const Inpu auto hazeStage = args->_scene->getStage(); if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) { - model::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front()); + graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front()); if (hazePointer) { batch.setUniformBuffer(HazeEffect_ParamsSlot, hazePointer->getHazeParametersBuffer()); } else { @@ -181,7 +181,7 @@ void DrawHaze::run(const render::RenderContextPointer& renderContext, const Inpu auto lightStage = args->_scene->getStage(); if (lightStage) { - model::LightPointer keyLight; + graphics::LightPointer keyLight; keyLight = lightStage->getCurrentKeyLight(); if (keyLight) { batch.setUniformBuffer(HazeEffect_LightingMapSlot, keyLight->getLightSchemaBuffer()); diff --git a/libraries/render-utils/src/DrawHaze.h b/libraries/render-utils/src/DrawHaze.h index 3ad42b23aa..e7d4e15d77 100644 --- a/libraries/render-utils/src/DrawHaze.h +++ b/libraries/render-utils/src/DrawHaze.h @@ -51,11 +51,11 @@ class MakeHazeConfig : public render::Job::Config { public: MakeHazeConfig() : render::Job::Config() {} - glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR }; - float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE }; + glm::vec3 hazeColor{ graphics::Haze::INITIAL_HAZE_COLOR }; + float hazeGlareAngle{ graphics::Haze::INITIAL_HAZE_GLARE_ANGLE }; - glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR }; - float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE }; + glm::vec3 hazeGlareColor{ graphics::Haze::INITIAL_HAZE_GLARE_COLOR }; + float hazeBaseReference{ graphics::Haze::INITIAL_HAZE_BASE_REFERENCE }; bool isHazeActive{ false }; bool isAltitudeBased{ false }; @@ -63,13 +63,13 @@ public: bool isModulateColorActive{ false }; bool isHazeEnableGlare{ false }; - float hazeRange{ model::Haze::INITIAL_HAZE_RANGE }; - float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT }; + float hazeRange{ graphics::Haze::INITIAL_HAZE_RANGE }; + float hazeHeight{ graphics::Haze::INITIAL_HAZE_HEIGHT }; - float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE }; - float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; + float hazeKeyLightRange{ graphics::Haze::INITIAL_KEY_LIGHT_RANGE }; + float hazeKeyLightAltitude{ graphics::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; - float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; + float hazeBackgroundBlend{ graphics::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; public slots: void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); } @@ -99,15 +99,15 @@ signals: class MakeHaze { public: using Config = MakeHazeConfig; - using JobModel = render::Job::ModelO; + using JobModel = render::Job::ModelO; MakeHaze(); void configure(const Config& config); - void run(const render::RenderContextPointer& renderContext, model::HazePointer& haze); + void run(const render::RenderContextPointer& renderContext, graphics::HazePointer& haze); private: - model::HazePointer _haze; + graphics::HazePointer _haze; }; class HazeConfig : public render::Job::Config { @@ -115,11 +115,11 @@ public: HazeConfig() : render::Job::Config(true) {} // attributes - glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR }; - float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE }; + glm::vec3 hazeColor{ graphics::Haze::INITIAL_HAZE_COLOR }; + float hazeGlareAngle{ graphics::Haze::INITIAL_HAZE_GLARE_ANGLE }; - glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR }; - float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE }; + glm::vec3 hazeGlareColor{ graphics::Haze::INITIAL_HAZE_GLARE_COLOR }; + float hazeBaseReference{ graphics::Haze::INITIAL_HAZE_BASE_REFERENCE }; bool isHazeActive{ false }; // Setting this to true will set haze to on bool isAltitudeBased{ false }; @@ -127,13 +127,13 @@ public: bool isModulateColorActive{ false }; bool isHazeEnableGlare{ false }; - float hazeRange{ model::Haze::INITIAL_HAZE_RANGE }; - float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT }; + float hazeRange{ graphics::Haze::INITIAL_HAZE_RANGE }; + float hazeHeight{ graphics::Haze::INITIAL_HAZE_HEIGHT }; - float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE }; - float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; + float hazeKeyLightRange{ graphics::Haze::INITIAL_KEY_LIGHT_RANGE }; + float hazeKeyLightAltitude{ graphics::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; - float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; + float hazeBackgroundBlend{ graphics::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; // methods void setHazeColor(const glm::vec3 value); @@ -159,7 +159,7 @@ public: class DrawHaze { public: - using Inputs = render::VaryingSet5; + using Inputs = render::VaryingSet5; using Config = HazeConfig; using JobModel = render::Job::ModelI; diff --git a/libraries/render-utils/src/HazeStage.cpp b/libraries/render-utils/src/HazeStage.cpp index 016282d16f..e56b715b8c 100644 --- a/libraries/render-utils/src/HazeStage.cpp +++ b/libraries/render-utils/src/HazeStage.cpp @@ -17,12 +17,12 @@ std::string HazeStage::_stageName { "HAZE_STAGE"}; const HazeStage::Index HazeStage::INVALID_INDEX { render::indexed_container::INVALID_INDEX }; FetchHazeStage::FetchHazeStage() { - _haze = std::make_shared(); + _haze = std::make_shared(); } void FetchHazeStage::configure(const Config& config) { _haze->setHazeColor(config.hazeColor); - _haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle)); + _haze->setHazeGlareBlend(graphics::Haze::convertGlareAngleToPower(config.hazeGlareAngle)); _haze->setHazeGlareColor(config.hazeGlareColor); _haze->setHazeBaseReference(config.hazeBaseReference); @@ -33,11 +33,11 @@ void FetchHazeStage::configure(const Config& config) { _haze->setModulateColorActive(config.isModulateColorActive); _haze->setHazeEnableGlare(config.isHazeEnableGlare); - _haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange)); - _haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight)); + _haze->setHazeRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange)); + _haze->setHazeAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight)); - _haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange)); - _haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude)); + _haze->setHazeKeyLightRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange)); + _haze->setHazeKeyLightAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude)); _haze->setHazeBackgroundBlend(config.hazeBackgroundBlend); } @@ -86,7 +86,7 @@ void HazeStageSetup::run(const render::RenderContextPointer& renderContext) { } } -void FetchHazeStage::run(const render::RenderContextPointer& renderContext, model::HazePointer& haze) { +void FetchHazeStage::run(const render::RenderContextPointer& renderContext, graphics::HazePointer& haze) { auto hazeStage = renderContext->_scene->getStage(); assert(hazeStage); diff --git a/libraries/render-utils/src/HazeStage.h b/libraries/render-utils/src/HazeStage.h index 9e729f1ef9..8f137cb280 100644 --- a/libraries/render-utils/src/HazeStage.h +++ b/libraries/render-utils/src/HazeStage.h @@ -31,8 +31,8 @@ public: static const Index INVALID_INDEX; static bool isIndexInvalid(Index index) { return index == INVALID_INDEX; } - using HazePointer = model::HazePointer; - using Hazes = render::indexed_container::IndexedPointerVector; + using HazePointer = graphics::HazePointer; + using Hazes = render::indexed_container::IndexedPointerVector; using HazeMap = std::unordered_map; using HazeIndices = std::vector; @@ -106,11 +106,11 @@ class FetchHazeConfig : public render::Job::Config { public: FetchHazeConfig() : render::Job::Config() {} - glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR }; - float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE }; + glm::vec3 hazeColor{ graphics::Haze::INITIAL_HAZE_COLOR }; + float hazeGlareAngle{ graphics::Haze::INITIAL_HAZE_GLARE_ANGLE }; - glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR }; - float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE }; + glm::vec3 hazeGlareColor{ graphics::Haze::INITIAL_HAZE_GLARE_COLOR }; + float hazeBaseReference{ graphics::Haze::INITIAL_HAZE_BASE_REFERENCE }; bool isHazeActive{ false }; bool isAltitudeBased{ false }; @@ -118,13 +118,13 @@ public: bool isModulateColorActive{ false }; bool isHazeEnableGlare{ false }; - float hazeRange{ model::Haze::INITIAL_HAZE_RANGE }; - float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT }; + float hazeRange{ graphics::Haze::INITIAL_HAZE_RANGE }; + float hazeHeight{ graphics::Haze::INITIAL_HAZE_HEIGHT }; - float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE }; - float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; + float hazeKeyLightRange{ graphics::Haze::INITIAL_KEY_LIGHT_RANGE }; + float hazeKeyLightAltitude{ graphics::Haze::INITIAL_KEY_LIGHT_ALTITUDE }; - float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; + float hazeBackgroundBlend{ graphics::Haze::INITIAL_HAZE_BACKGROUND_BLEND }; public slots: void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); } @@ -154,15 +154,15 @@ signals: class FetchHazeStage { public: using Config = FetchHazeConfig; - using JobModel = render::Job::ModelO; + using JobModel = render::Job::ModelO; FetchHazeStage(); void configure(const Config& config); - void run(const render::RenderContextPointer& renderContext, model::HazePointer& haze); + void run(const render::RenderContextPointer& renderContext, graphics::HazePointer& haze); private: - model::HazePointer _haze; + graphics::HazePointer _haze; gpu::PipelinePointer _hazePipeline; }; #endif diff --git a/libraries/render-utils/src/LightPayload.cpp b/libraries/render-utils/src/LightPayload.cpp index afa17bee19..09334faa13 100644 --- a/libraries/render-utils/src/LightPayload.cpp +++ b/libraries/render-utils/src/LightPayload.cpp @@ -40,7 +40,7 @@ namespace render { } LightPayload::LightPayload() : - _light(std::make_shared()) + _light(std::make_shared()) { } @@ -109,7 +109,7 @@ namespace render { } KeyLightPayload::KeyLightPayload() : -_light(std::make_shared()) +_light(std::make_shared()) { } diff --git a/libraries/render-utils/src/LightPayload.h b/libraries/render-utils/src/LightPayload.h index a3032ccd90..44b79ce10c 100644 --- a/libraries/render-utils/src/LightPayload.h +++ b/libraries/render-utils/src/LightPayload.h @@ -26,14 +26,14 @@ public: ~LightPayload(); void render(RenderArgs* args); - model::LightPointer editLight() { _needUpdate = true; return _light; } + graphics::LightPointer editLight() { _needUpdate = true; return _light; } render::Item::Bound& editBound() { _needUpdate = true; return _bound; } void setVisible(bool visible) { _isVisible = visible; } bool isVisible() const { return _isVisible; } protected: - model::LightPointer _light; + graphics::LightPointer _light; render::Item::Bound _bound; LightStagePointer _stage; LightStage::Index _index { LightStage::INVALID_INDEX }; @@ -56,7 +56,7 @@ public: ~KeyLightPayload(); void render(RenderArgs* args); - model::LightPointer editLight() { _needUpdate = true; return _light; } + graphics::LightPointer editLight() { _needUpdate = true; return _light; } render::Item::Bound& editBound() { _needUpdate = true; return _bound; } void setVisible(bool visible) { _isVisible = visible; } @@ -69,7 +69,7 @@ public: bool _pendingAmbientTexture { false }; protected: - model::LightPointer _light; + graphics::LightPointer _light; render::Item::Bound _bound; LightStagePointer _stage; LightStage::Index _index { LightStage::INVALID_INDEX }; diff --git a/libraries/render-utils/src/LightStage.cpp b/libraries/render-utils/src/LightStage.cpp index 42b161ba74..f146cd6e0a 100644 --- a/libraries/render-utils/src/LightStage.cpp +++ b/libraries/render-utils/src/LightStage.cpp @@ -29,32 +29,32 @@ const LightStage::Index LightStage::INVALID_INDEX { render::indexed_container::I LightStage::LightStage() { // Add off lights - const LightPointer ambientOffLight { std::make_shared() }; + const LightPointer ambientOffLight { std::make_shared() }; ambientOffLight->setAmbientIntensity(0.0f); - ambientOffLight->setColor(model::Vec3(0.0)); + ambientOffLight->setColor(graphics::Vec3(0.0)); ambientOffLight->setIntensity(0.0f); - ambientOffLight->setType(model::Light::Type::AMBIENT); + ambientOffLight->setType(graphics::Light::Type::AMBIENT); _ambientOffLightId = addLight(ambientOffLight); - const LightPointer pointOffLight { std::make_shared() }; + const LightPointer pointOffLight { std::make_shared() }; pointOffLight->setAmbientIntensity(0.0f); - pointOffLight->setColor(model::Vec3(0.0)); + pointOffLight->setColor(graphics::Vec3(0.0)); pointOffLight->setIntensity(0.0f); - pointOffLight->setType(model::Light::Type::POINT); + pointOffLight->setType(graphics::Light::Type::POINT); _pointOffLightId = addLight(pointOffLight); - const LightPointer spotOffLight { std::make_shared() }; + const LightPointer spotOffLight { std::make_shared() }; spotOffLight->setAmbientIntensity(0.0f); - spotOffLight->setColor(model::Vec3(0.0)); + spotOffLight->setColor(graphics::Vec3(0.0)); spotOffLight->setIntensity(0.0f); - spotOffLight->setType(model::Light::Type::SPOT); + spotOffLight->setType(graphics::Light::Type::SPOT); _spotOffLightId = addLight(spotOffLight); - const LightPointer sunOffLight { std::make_shared() }; + const LightPointer sunOffLight { std::make_shared() }; sunOffLight->setAmbientIntensity(0.0f); - sunOffLight->setColor(model::Vec3(0.0)); + sunOffLight->setColor(graphics::Vec3(0.0)); sunOffLight->setIntensity(0.0f); - sunOffLight->setType(model::Light::Type::SUN); + sunOffLight->setType(graphics::Light::Type::SUN); _sunOffLightId = addLight(sunOffLight); // Set default light to the off ambient light (until changed) @@ -123,7 +123,7 @@ float LightStage::Shadow::Cascade::computeFarDistance(const ViewFrustum& viewFru return far; } -LightStage::Shadow::Shadow(model::LightPointer light, float maxDistance, unsigned int cascadeCount) : +LightStage::Shadow::Shadow(graphics::LightPointer light, float maxDistance, unsigned int cascadeCount) : _light{ light } { cascadeCount = std::min(cascadeCount, (unsigned int)SHADOW_CASCADE_MAX_COUNT); Schema schema; @@ -404,14 +404,14 @@ LightStage::Index LightStage::getShadowId(Index lightId) const { } void LightStage::updateLightArrayBuffer(Index lightId) { - auto lightSize = sizeof(model::Light::LightSchema); + auto lightSize = sizeof(graphics::Light::LightSchema); if (!_lightArrayBuffer) { _lightArrayBuffer = std::make_shared(lightSize); } assert(checkLightId(lightId)); - if (lightId > (Index)_lightArrayBuffer->getNumTypedElements()) { + if (lightId > (Index)_lightArrayBuffer->getNumTypedElements()) { _lightArrayBuffer->resize(lightSize * (lightId + 10)); } @@ -419,7 +419,7 @@ void LightStage::updateLightArrayBuffer(Index lightId) { auto light = _lights._elements[lightId]; if (light) { const auto& lightSchema = light->getLightSchemaBuffer().get(); - _lightArrayBuffer->setSubData(lightId, lightSchema); + _lightArrayBuffer->setSubData(lightId, lightSchema); } else { // this should not happen ? } diff --git a/libraries/render-utils/src/LightStage.h b/libraries/render-utils/src/LightStage.h index 8db5c19950..d1a8680706 100644 --- a/libraries/render-utils/src/LightStage.h +++ b/libraries/render-utils/src/LightStage.h @@ -35,8 +35,8 @@ public: static const Index INVALID_INDEX; static bool isIndexInvalid(Index index) { return index == INVALID_INDEX; } - using LightPointer = model::LightPointer; - using Lights = render::indexed_container::IndexedPointerVector; + using LightPointer = graphics::LightPointer; + using Lights = render::indexed_container::IndexedPointerVector; using LightMap = std::unordered_map; using LightIndices = std::vector; @@ -75,7 +75,7 @@ public: float left, float right, float bottom, float top, float viewMaxShadowDistance) const; }; - Shadow(model::LightPointer light, float maxDistance, unsigned int cascadeCount = 1); + Shadow(graphics::LightPointer light, float maxDistance, unsigned int cascadeCount = 1); void setKeylightFrustum(const ViewFrustum& viewFrustum, float nearDepth = 1.0f, float farDepth = 1000.0f); @@ -91,7 +91,7 @@ public: float getMaxDistance() const { return _maxDistance; } void setMaxDistance(float value); - const model::LightPointer& getLight() const { return _light; } + const graphics::LightPointer& getLight() const { return _light; } protected: @@ -101,7 +101,7 @@ public: static const glm::mat4 _biasMatrix; - model::LightPointer _light; + graphics::LightPointer _light; float _maxDistance; Cascades _cascades; @@ -165,12 +165,12 @@ public: Frame() {} void clear() { _pointLights.clear(); _spotLights.clear(); _sunLights.clear(); _ambientLights.clear(); } - void pushLight(LightStage::Index index, model::Light::Type type) { + void pushLight(LightStage::Index index, graphics::Light::Type type) { switch (type) { - case model::Light::POINT: { pushPointLight(index); break; } - case model::Light::SPOT: { pushSpotLight(index); break; } - case model::Light::SUN: { pushSunLight(index); break; } - case model::Light::AMBIENT: { pushAmbientLight(index); break; } + case graphics::Light::POINT: { pushPointLight(index); break; } + case graphics::Light::SPOT: { pushSpotLight(index); break; } + case graphics::Light::SUN: { pushSunLight(index); break; } + case graphics::Light::AMBIENT: { pushAmbientLight(index); break; } default: { break; } } } diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp index d6ab2ff416..c506887fc4 100644 --- a/libraries/render-utils/src/MeshPartPayload.cpp +++ b/libraries/render-utils/src/MeshPartPayload.cpp @@ -45,17 +45,17 @@ template <> void payloadRender(const MeshPartPayload::Pointer& payload, RenderAr } } -MeshPartPayload::MeshPartPayload(const std::shared_ptr& mesh, int partIndex, model::MaterialPointer material) { +MeshPartPayload::MeshPartPayload(const std::shared_ptr& mesh, int partIndex, graphics::MaterialPointer material) { updateMeshPart(mesh, partIndex); updateMaterial(material); } -void MeshPartPayload::updateMeshPart(const std::shared_ptr& drawMesh, int partIndex) { +void MeshPartPayload::updateMeshPart(const std::shared_ptr& drawMesh, int partIndex) { _drawMesh = drawMesh; if (_drawMesh) { auto vertexFormat = _drawMesh->getVertexFormat(); _hasColorAttrib = vertexFormat->hasAttribute(gpu::Stream::COLOR); - _drawPart = _drawMesh->getPartBuffer().get(partIndex); + _drawPart = _drawMesh->getPartBuffer().get(partIndex); _localBound = _drawMesh->evalPartBound(partIndex); } } @@ -67,7 +67,7 @@ void MeshPartPayload::updateTransform(const Transform& transform, const Transfor _worldBound.transform(_drawTransform); } -void MeshPartPayload::updateMaterial(model::MaterialPointer drawMaterial) { +void MeshPartPayload::updateMaterial(graphics::MaterialPointer drawMaterial) { _drawMaterial = drawMaterial; } @@ -90,7 +90,7 @@ Item::Bound MeshPartPayload::getBound() const { } ShapeKey MeshPartPayload::getShapeKey() const { - model::MaterialKey drawMaterialKey; + graphics::MaterialKey drawMaterialKey; if (_drawMaterial) { drawMaterialKey = _drawMaterial->getKey(); } @@ -156,7 +156,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Albedo if (materialKey.isAlbedoMap()) { - auto itr = textureMaps.find(model::MaterialKey::ALBEDO_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::ALBEDO_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::ALBEDO, itr->second->getTextureView()); } else { @@ -166,7 +166,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Roughness map if (materialKey.isRoughnessMap()) { - auto itr = textureMaps.find(model::MaterialKey::ROUGHNESS_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::ROUGHNESS_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::ROUGHNESS, itr->second->getTextureView()); @@ -178,7 +178,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Normal map if (materialKey.isNormalMap()) { - auto itr = textureMaps.find(model::MaterialKey::NORMAL_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::NORMAL_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::NORMAL, itr->second->getTextureView()); @@ -190,7 +190,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Metallic map if (materialKey.isMetallicMap()) { - auto itr = textureMaps.find(model::MaterialKey::METALLIC_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::METALLIC_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::METALLIC, itr->second->getTextureView()); @@ -202,7 +202,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Occlusion map if (materialKey.isOcclusionMap()) { - auto itr = textureMaps.find(model::MaterialKey::OCCLUSION_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::OCCLUSION_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::OCCLUSION, itr->second->getTextureView()); @@ -214,7 +214,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Scattering map if (materialKey.isScatteringMap()) { - auto itr = textureMaps.find(model::MaterialKey::SCATTERING_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::SCATTERING_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::SCATTERING, itr->second->getTextureView()); @@ -226,7 +226,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat // Emissive / Lightmap if (materialKey.isLightmapMap()) { - auto itr = textureMaps.find(model::MaterialKey::LIGHTMAP_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::LIGHTMAP_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, itr->second->getTextureView()); @@ -234,7 +234,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, textureCache->getGrayTexture()); } } else if (materialKey.isEmissiveMap()) { - auto itr = textureMaps.find(model::MaterialKey::EMISSIVE_MAP); + auto itr = textureMaps.find(graphics::MaterialKey::EMISSIVE_MAP); if (itr != textureMaps.end() && itr->second->isDefined()) { batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, itr->second->getTextureView()); @@ -439,7 +439,7 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, bool isWireframe return; } - model::MaterialKey drawMaterialKey; + graphics::MaterialKey drawMaterialKey; if (_drawMaterial) { drawMaterialKey = _drawMaterial->getKey(); } diff --git a/libraries/render-utils/src/MeshPartPayload.h b/libraries/render-utils/src/MeshPartPayload.h index 6e165508f2..8160b9f009 100644 --- a/libraries/render-utils/src/MeshPartPayload.h +++ b/libraries/render-utils/src/MeshPartPayload.h @@ -28,17 +28,17 @@ class Model; class MeshPartPayload { public: MeshPartPayload() {} - MeshPartPayload(const std::shared_ptr& mesh, int partIndex, model::MaterialPointer material); + MeshPartPayload(const std::shared_ptr& mesh, int partIndex, graphics::MaterialPointer material); typedef render::Payload Payload; typedef Payload::DataPointer Pointer; - virtual void updateMeshPart(const std::shared_ptr& drawMesh, int partIndex); + virtual void updateMeshPart(const std::shared_ptr& drawMesh, int partIndex); virtual void notifyLocationChanged() {} void updateTransform(const Transform& transform, const Transform& offsetTransform); - virtual void updateMaterial(model::MaterialPointer drawMaterial); + virtual void updateMaterial(graphics::MaterialPointer drawMaterial); // Render Item interface virtual render::ItemKey getKey() const; @@ -58,13 +58,13 @@ public: int _partIndex = 0; bool _hasColorAttrib { false }; - model::Box _localBound; - model::Box _adjustedLocalBound; - mutable model::Box _worldBound; - std::shared_ptr _drawMesh; + graphics::Box _localBound; + graphics::Box _adjustedLocalBound; + mutable graphics::Box _worldBound; + std::shared_ptr _drawMesh; - std::shared_ptr _drawMaterial; - model::Mesh::Part _drawPart; + std::shared_ptr _drawMaterial; + graphics::Mesh::Part _drawPart; size_t getVerticesCount() const { return _drawMesh ? _drawMesh->getNumVertices() : 0; } size_t getMaterialTextureSize() { return _drawMaterial ? _drawMaterial->getTextureSize() : 0; } diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 9c1c579341..d7c038ea7d 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -46,7 +46,7 @@ float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; #define HTTP_INVALID_COM "http://invalid.com" const int NUM_COLLISION_HULL_COLORS = 24; -std::vector _collisionMaterials; +std::vector _collisionMaterials; void initCollisionMaterials() { // generates bright colors in red, green, blue, yellow, magenta, and cyan spectrums @@ -72,8 +72,8 @@ void initCollisionMaterials() { // so they don't tend to group together for large models for (int i = 0; i < sectionWidth; ++i) { for (int j = 0; j < numComponents; ++j) { - model::MaterialPointer material; - material = std::make_shared(); + graphics::MaterialPointer material; + material = std::make_shared(); int index = j * sectionWidth + i; float red = component[index]; float green = component[(index + greenPhase) % NUM_COLLISION_HULL_COLORS]; @@ -559,7 +559,7 @@ MeshProxyList Model::getMeshes() const { offset.postTranslate(_offset); glm::mat4 offsetMat = offset.getMatrix(); - for (std::shared_ptr mesh : meshes) { + for (std::shared_ptr mesh : meshes) { if (!mesh) { continue; } @@ -1481,7 +1481,7 @@ void Model::createCollisionRenderItemSet() { // Create the render payloads int numParts = (int)mesh->getNumParts(); for (int partIndex = 0; partIndex < numParts; partIndex++) { - model::MaterialPointer& material = _collisionMaterials[partIndex % NUM_COLLISION_HULL_COLORS]; + graphics::MaterialPointer& material = _collisionMaterials[partIndex % NUM_COLLISION_HULL_COLORS]; auto payload = std::make_shared(mesh, partIndex, material); payload->updateTransform(identity, offset); _collisionRenderItems << payload; @@ -1495,7 +1495,7 @@ bool Model::isRenderable() const { class CollisionRenderGeometry : public Geometry { public: - CollisionRenderGeometry(model::MeshPointer mesh) { + CollisionRenderGeometry(graphics::MeshPointer mesh) { _fbxGeometry = std::make_shared(); std::shared_ptr meshes = std::make_shared(); meshes->push_back(mesh); @@ -1504,7 +1504,7 @@ public: } }; -void Model::setCollisionMesh(model::MeshPointer mesh) { +void Model::setCollisionMesh(graphics::MeshPointer mesh) { if (mesh) { _collisionGeometry = std::make_shared(mesh); } else { diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h index 623f869666..6c1f9cb75c 100644 --- a/libraries/render-utils/src/Model.h +++ b/libraries/render-utils/src/Model.h @@ -240,7 +240,7 @@ public: // returns 'true' if needs fullUpdate after geometry change virtual bool updateGeometry(); - void setCollisionMesh(model::MeshPointer mesh); + void setCollisionMesh(graphics::MeshPointer mesh); void setLoadingPriority(float priority) { _loadingPriority = priority; } diff --git a/libraries/render-utils/src/RenderDeferredTask.cpp b/libraries/render-utils/src/RenderDeferredTask.cpp index f860c0494e..8b97f902ac 100644 --- a/libraries/render-utils/src/RenderDeferredTask.cpp +++ b/libraries/render-utils/src/RenderDeferredTask.cpp @@ -338,7 +338,7 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& // Setup haze iff curretn zone has haze auto hazeStage = args->_scene->getStage(); if (hazeStage && hazeStage->_currentFrame._hazes.size() > 0) { - model::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front()); + graphics::HazePointer hazePointer = hazeStage->getHaze(hazeStage->_currentFrame._hazes.front()); batch.setUniformBuffer(render::ShapePipeline::Slot::HAZE_MODEL, hazePointer->getHazeParametersBuffer()); } diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index 7f644add72..2eb063e9e8 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -546,7 +546,7 @@ void batchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* a if (pipeline.locations->materialBufferUnit >= 0) { // Create a default schema static bool isMaterialSet = false; - static model::Material material; + static graphics::Material material; if (!isMaterialSet) { material.setAlbedo(vec3(1.0f)); material.setOpacity(1.0f); diff --git a/libraries/render-utils/src/RenderShadowTask.cpp b/libraries/render-utils/src/RenderShadowTask.cpp index 2e5b7132e4..d83dfd73a5 100644 --- a/libraries/render-utils/src/RenderShadowTask.cpp +++ b/libraries/render-utils/src/RenderShadowTask.cpp @@ -271,7 +271,7 @@ void RenderShadowCascadeSetup::run(const render::RenderContextPointer& renderCon // Set the keylight render args args->pushViewFrustum(*(globalShadow->getCascade(_cascadeIndex).getFrustum())); args->_renderMode = RenderArgs::SHADOW_RENDER_MODE; - if (lightStage->getCurrentKeyLight()->getType() == model::Light::SUN) { + if (lightStage->getCurrentKeyLight()->getType() == graphics::Light::SUN) { const float shadowSizeScale = 1e16f; // Set the size scale to a ridiculously high value to prevent small object culling which assumes // the view frustum is a perspective projection. But this isn't the case for the sun which diff --git a/libraries/render-utils/src/StencilMaskPass.cpp b/libraries/render-utils/src/StencilMaskPass.cpp index ab1ac7c1aa..de8de9abcf 100644 --- a/libraries/render-utils/src/StencilMaskPass.cpp +++ b/libraries/render-utils/src/StencilMaskPass.cpp @@ -26,7 +26,7 @@ void PrepareStencil::configure(const Config& config) { _forceDraw = config.forceDraw; } -model::MeshPointer PrepareStencil::getMesh() { +graphics::MeshPointer PrepareStencil::getMesh() { if (!_mesh) { std::vector vertices { @@ -36,7 +36,7 @@ model::MeshPointer PrepareStencil::getMesh() { { 1.0f, -1.0f, 0.0f }, { 0.0f, -1.0f, 0.0f } }; std::vector indices { 0, 7, 1, 1, 3, 2, 3, 5, 4, 5, 7, 6 }; - _mesh = model::Mesh::createIndexedTriangles_P3F((uint32_t) vertices.size(), (uint32_t) indices.size(), vertices.data(), indices.data()); + _mesh = graphics::Mesh::createIndexedTriangles_P3F((uint32_t) vertices.size(), (uint32_t) indices.size(), vertices.data(), indices.data()); } return _mesh; } @@ -95,7 +95,7 @@ void PrepareStencil::run(const RenderContextPointer& renderContext, const gpu::F batch.setInputStream(0, mesh->getVertexStream()); // Draw - auto part = mesh->getPartBuffer().get(0); + auto part = mesh->getPartBuffer().get(0); batch.drawIndexed(gpu::TRIANGLES, part._numIndices, part._startIndex); } else { batch.setPipeline(getPaintStencilPipeline()); diff --git a/libraries/render-utils/src/StencilMaskPass.h b/libraries/render-utils/src/StencilMaskPass.h index ef1371d04e..a8e4d1e1f2 100644 --- a/libraries/render-utils/src/StencilMaskPass.h +++ b/libraries/render-utils/src/StencilMaskPass.h @@ -63,8 +63,8 @@ private: gpu::PipelinePointer _paintStencilPipeline; gpu::PipelinePointer getPaintStencilPipeline(); - model::MeshPointer _mesh; - model::MeshPointer getMesh(); + graphics::MeshPointer _mesh; + graphics::MeshPointer getMesh(); int _maskMode { 0 }; bool _forceDraw { false }; diff --git a/libraries/render-utils/src/ZoneRenderer.cpp b/libraries/render-utils/src/ZoneRenderer.cpp index c0d01c2eaf..c39e6068b7 100644 --- a/libraries/render-utils/src/ZoneRenderer.cpp +++ b/libraries/render-utils/src/ZoneRenderer.cpp @@ -145,14 +145,14 @@ void DebugZoneLighting::run(const render::RenderContextPointer& context, const I auto deferredTransform = inputs; auto lightStage = context->_scene->getStage(LightStage::getName()); - std::vector keyLightStack; + std::vector keyLightStack; if (lightStage && lightStage->_currentFrame._sunLights.size()) { for (auto index : lightStage->_currentFrame._sunLights) { keyLightStack.push_back(lightStage->getLight(index)); } } - std::vector ambientLightStack; + std::vector ambientLightStack; if (lightStage && lightStage->_currentFrame._ambientLights.size()) { for (auto index : lightStage->_currentFrame._ambientLights) { ambientLightStack.push_back(lightStage->getLight(index)); @@ -160,7 +160,7 @@ void DebugZoneLighting::run(const render::RenderContextPointer& context, const I } auto backgroundStage = context->_scene->getStage(BackgroundStage::getName()); - std::vector skyboxStack; + std::vector skyboxStack; if (backgroundStage && backgroundStage->_currentFrame._backgrounds.size()) { for (auto index : backgroundStage->_currentFrame._backgrounds) { auto background = backgroundStage->getBackground(index); diff --git a/libraries/script-engine/src/ModelScriptingInterface.cpp b/libraries/script-engine/src/ModelScriptingInterface.cpp index e58afeaba8..c693083ebf 100644 --- a/libraries/script-engine/src/ModelScriptingInterface.cpp +++ b/libraries/script-engine/src/ModelScriptingInterface.cpp @@ -102,7 +102,7 @@ QScriptValue ModelScriptingInterface::appendMeshes(MeshProxyList in) { indexStartOffset += numVertices; } - model::MeshPointer result(new model::Mesh()); + graphics::MeshPointer result(new graphics::Mesh()); gpu::Element vertexElement = gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ); gpu::Buffer* combinedVertexBuffer = new gpu::Buffer(combinedVertexSize, combinedVertexData.get()); @@ -130,12 +130,12 @@ QScriptValue ModelScriptingInterface::appendMeshes(MeshProxyList in) { gpu::BufferView combinedIndexesBufferView(combinedIndexesBufferPointer, indexElement); result->setIndexBuffer(combinedIndexesBufferView); - std::vector parts; - parts.emplace_back(model::Mesh::Part((model::Index)0, // startIndex - (model::Index)result->getNumIndices(), // numIndices - (model::Index)0, // baseVertex - model::Mesh::TRIANGLES)); // topology - result->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), + std::vector parts; + parts.emplace_back(graphics::Mesh::Part((graphics::Index)0, // startIndex + (graphics::Index)result->getNumIndices(), // numIndices + (graphics::Index)0, // baseVertex + graphics::Mesh::TRIANGLES)); // topology + result->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); @@ -153,7 +153,7 @@ QScriptValue ModelScriptingInterface::transformMesh(glm::mat4 transform, MeshPro } const auto inverseTransposeTransform = glm::inverse(glm::transpose(transform)); - model::MeshPointer result = mesh->map([&](glm::vec3 position){ return glm::vec3(transform * glm::vec4(position, 1.0f)); }, + graphics::MeshPointer result = mesh->map([&](glm::vec3 position){ return glm::vec3(transform * glm::vec4(position, 1.0f)); }, [&](glm::vec3 color){ return color; }, [&](glm::vec3 normal){ return glm::vec3(inverseTransposeTransform * glm::vec4(normal, 0.0f)); }, [&](uint32_t index){ return index; }); @@ -199,7 +199,7 @@ QScriptValue ModelScriptingInterface::getVertex(MeshProxy* meshProxy, int vertex QScriptValue ModelScriptingInterface::newMesh(const QVector& vertices, const QVector& normals, const QVector& faces) { - model::MeshPointer mesh(new model::Mesh()); + graphics::MeshPointer mesh(new graphics::Mesh()); // vertices auto vertexBuffer = std::make_shared(vertices.size() * sizeof(glm::vec3), (gpu::Byte*)vertices.data()); @@ -236,12 +236,12 @@ QScriptValue ModelScriptingInterface::newMesh(const QVector& vertices mesh->setIndexBuffer(indexBufferView); // parts - std::vector parts; - parts.emplace_back(model::Mesh::Part((model::Index)0, // startIndex - (model::Index)faces.size() * 3, // numIndices - (model::Index)0, // baseVertex - model::Mesh::TRIANGLES)); // topology - mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), + std::vector parts; + parts.emplace_back(graphics::Mesh::Part((graphics::Index)0, // startIndex + (graphics::Index)faces.size() * 3, // numIndices + (graphics::Index)0, // baseVertex + graphics::Mesh::TRIANGLES)); // topology + mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL)); diff --git a/libraries/script-engine/src/SceneScriptingInterface.cpp b/libraries/script-engine/src/SceneScriptingInterface.cpp index 3883b948df..7b36b815fb 100644 --- a/libraries/script-engine/src/SceneScriptingInterface.cpp +++ b/libraries/script-engine/src/SceneScriptingInterface.cpp @@ -112,17 +112,17 @@ bool SceneScripting::Stage::isSunModelEnabled() const { void SceneScripting::Stage::setBackgroundMode(const QString& mode) { if (mode == QString("inherit")) { - _skyStage->setBackgroundMode(model::SunSkyStage::NO_BACKGROUND); + _skyStage->setBackgroundMode(graphics::SunSkyStage::NO_BACKGROUND); } else if (mode == QString("skybox")) { - _skyStage->setBackgroundMode(model::SunSkyStage::SKY_BOX); + _skyStage->setBackgroundMode(graphics::SunSkyStage::SKY_BOX); } } QString SceneScripting::Stage::getBackgroundMode() const { switch (_skyStage->getBackgroundMode()) { - case model::SunSkyStage::NO_BACKGROUND: + case graphics::SunSkyStage::NO_BACKGROUND: return QString("inherit"); - case model::SunSkyStage::SKY_BOX: + case graphics::SunSkyStage::SKY_BOX: return QString("skybox"); default: return QString("inherit"); @@ -131,7 +131,7 @@ QString SceneScripting::Stage::getBackgroundMode() const { SceneScriptingInterface::SceneScriptingInterface() : _stage{ new SceneScripting::Stage{ _skyStage } } { // Let's make sure the sunSkyStage is using a proceduralSkybox - _skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox())); + _skyStage->setSkybox(graphics::SkyboxPointer(new ProceduralSkybox())); } void SceneScriptingInterface::setShouldRenderAvatars(bool shouldRenderAvatars) { @@ -148,6 +148,6 @@ void SceneScriptingInterface::setShouldRenderEntities(bool shouldRenderEntities) } } -model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const { +graphics::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const { return _skyStage; } diff --git a/libraries/script-engine/src/SceneScriptingInterface.h b/libraries/script-engine/src/SceneScriptingInterface.h index 160c37284c..07b8c22ca6 100644 --- a/libraries/script-engine/src/SceneScriptingInterface.h +++ b/libraries/script-engine/src/SceneScriptingInterface.h @@ -23,7 +23,7 @@ namespace SceneScripting { Q_OBJECT public: - Location(model::SunSkyStagePointer skyStage) : _skyStage{ skyStage } {} + Location(graphics::SunSkyStagePointer skyStage) : _skyStage{ skyStage } {} Q_PROPERTY(float longitude READ getLongitude WRITE setLongitude) Q_PROPERTY(float latitude READ getLatitude WRITE setLatitude) @@ -37,7 +37,7 @@ namespace SceneScripting { void setAltitude(float altitude); protected: - model::SunSkyStagePointer _skyStage; + graphics::SunSkyStagePointer _skyStage; }; using LocationPointer = std::unique_ptr; @@ -45,7 +45,7 @@ namespace SceneScripting { Q_OBJECT public: - Time(model::SunSkyStagePointer skyStage) : _skyStage{ skyStage } {} + Time(graphics::SunSkyStagePointer skyStage) : _skyStage{ skyStage } {} Q_PROPERTY(float hour READ getHour WRITE setHour) Q_PROPERTY(int day READ getDay WRITE setDay) @@ -56,7 +56,7 @@ namespace SceneScripting { void setDay(int day); protected: - model::SunSkyStagePointer _skyStage; + graphics::SunSkyStagePointer _skyStage; }; using TimePointer = std::unique_ptr