From 71863a1550e20341a39308a03f2053a3e8a5aed4 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 16 Feb 2016 09:33:24 -0800 Subject: [PATCH] Fixing the material names --- .../entities-renderer/src/paintStroke.slf | 2 +- .../src/untextured_particle.slv | 2 +- libraries/render-utils/src/DeferredBuffer.slh | 6 ++--- .../render-utils/src/DeferredBufferWrite.slh | 12 +++++----- .../render-utils/src/DeferredGlobalLight.slh | 22 +++++++++---------- .../render-utils/src/DeferredLightingEffect.h | 2 +- libraries/render-utils/src/GeometryCache.cpp | 2 +- libraries/render-utils/src/animdebugdraw.slv | 2 +- libraries/render-utils/src/model.slf | 10 ++++----- libraries/render-utils/src/model_emissive.slf | 4 ++-- libraries/render-utils/src/model_lightmap.slf | 10 ++++----- libraries/render-utils/src/model_lightmap.slv | 2 +- .../src/model_lightmap_normal_map.slf | 10 ++++----- .../src/model_lightmap_normal_map.slv | 2 +- .../model_lightmap_normal_specular_map.slf | 12 +++++----- .../src/model_lightmap_specular_map.slf | 12 +++++----- .../render-utils/src/model_normal_map.slf | 10 ++++----- .../render-utils/src/model_normal_map.slv | 2 +- .../src/model_normal_specular_map.slf | 12 +++++----- .../render-utils/src/model_translucent.slf | 10 ++++----- libraries/render-utils/src/overlay3D.slf | 14 ++++++------ .../render-utils/src/overlay3D_emissive.slf | 6 ++--- .../src/overlay3D_translucent.slf | 14 ++++++------ .../src/overlay3D_translucent_emissive.slf | 4 ++-- libraries/render-utils/src/skin_model.slv | 2 +- 25 files changed, 93 insertions(+), 93 deletions(-) diff --git a/libraries/entities-renderer/src/paintStroke.slf b/libraries/entities-renderer/src/paintStroke.slf index fc659d5928..9b7193bbfc 100644 --- a/libraries/entities-renderer/src/paintStroke.slf +++ b/libraries/entities-renderer/src/paintStroke.slf @@ -15,7 +15,7 @@ <@include DeferredBufferWrite.slh@> -// the diffuse texture +// the albedo texture uniform sampler2D originalTexture; // the interpolated normal diff --git a/libraries/entities-renderer/src/untextured_particle.slv b/libraries/entities-renderer/src/untextured_particle.slv index ab0ea15219..85f9d438bf 100644 --- a/libraries/entities-renderer/src/untextured_particle.slv +++ b/libraries/entities-renderer/src/untextured_particle.slv @@ -16,7 +16,7 @@ out vec4 _color; void main(void) { - // pass along the diffuse color + // pass along the color _color = colorToLinearRGBA(inColor); TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/DeferredBuffer.slh b/libraries/render-utils/src/DeferredBuffer.slh index 3f9aef6dd1..40c4349ae2 100755 --- a/libraries/render-utils/src/DeferredBuffer.slh +++ b/libraries/render-utils/src/DeferredBuffer.slh @@ -12,8 +12,8 @@ <@def DEFERRED_BUFFER_SLH@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the normal texture uniform sampler2D normalMap; @@ -83,7 +83,7 @@ DeferredFragment unpackDeferredFragment(DeferredTransform deferredTransform, vec DeferredFragment frag; frag.depthVal = texture(depthMap, texcoord).r; frag.normalVal = texture(normalMap, texcoord); - frag.diffuseVal = texture(diffuseMap, texcoord); + frag.diffuseVal = texture(albedoMap, texcoord); frag.specularVal = texture(specularMap, texcoord); frag.obscurance = texture(obscuranceMap, texcoord).x; diff --git a/libraries/render-utils/src/DeferredBufferWrite.slh b/libraries/render-utils/src/DeferredBufferWrite.slh index 1045c4afc7..5cf40fad2d 100755 --- a/libraries/render-utils/src/DeferredBufferWrite.slh +++ b/libraries/render-utils/src/DeferredBufferWrite.slh @@ -43,32 +43,32 @@ float evalOpaqueFinalAlpha(float alpha, float mapAlpha) { const vec3 DEFAULT_SPECULAR = vec3(0.1); const float DEFAULT_SHININESS = 10; -void packDeferredFragment(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess) { +void packDeferredFragment(vec3 normal, float alpha, vec3 albedo, vec3 specular, float shininess) { if (alpha != 1.0) { discard; } - _fragColor0 = vec4(diffuse.rgb, 1.0); // Opaque + _fragColor0 = vec4(albedo.rgb, 1.0); // Opaque _fragColor1 = vec4(bestFitNormal(normal), 1.0); _fragColor2 = vec4(specular, shininess / 128.0); } -void packDeferredFragmentLightmap(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess, vec3 emissive) { +void packDeferredFragmentLightmap(vec3 normal, float alpha, vec3 albedo, vec3 specular, float shininess, vec3 emissive) { if (alpha != 1.0) { discard; } - _fragColor0 = vec4(diffuse.rgb, 0.5); + _fragColor0 = vec4(albedo.rgb, 0.5); _fragColor1 = vec4(bestFitNormal(normal), 0.5); _fragColor2 = vec4(emissive, shininess / 128.0); } -void packDeferredFragmentTranslucent(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess) { +void packDeferredFragmentTranslucent(vec3 normal, float alpha, vec3 albedo, vec3 specular, float shininess) { if (alpha <= 0.0) { discard; } - _fragColor0 = vec4(diffuse.rgb, alpha); + _fragColor0 = vec4(albedo.rgb, alpha); // _fragColor1 = vec4(normal, 0.0) * 0.5 + vec4(0.5, 0.5, 0.5, 1.0); // _fragColor2 = vec4(specular, shininess / 128.0); } diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index 75fe187e46..30c52fb3b6 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -70,7 +70,7 @@ uniform SphericalHarmonics ambientSphere; <@include model/Light.slh@> <@func declareEvalAmbientGlobalColor()@> -vec3 evalAmbientGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss) { +vec3 evalAmbientGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss) { // Need the light now Light light = getLight(); @@ -79,11 +79,11 @@ vec3 evalAmbientGlobalColor(mat4 invViewMat, float shadowAttenuation, float obsc vec4 fragEyeVector = invViewMat * vec4(-position, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - vec3 color = diffuse.rgb * getLightColor(light) * obscurance * getLightAmbientIntensity(light); + vec3 color = albedo * getLightColor(light) * obscurance * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); return color; } @@ -93,7 +93,7 @@ vec3 evalAmbientGlobalColor(mat4 invViewMat, float shadowAttenuation, float obsc <$declareSphericalHarmonics()$> -vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss) { +vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss) { // Need the light now Light light = getLight(); @@ -102,11 +102,11 @@ vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, floa vec3 fragEyeDir = normalize(fragEyeVector.xyz); vec3 ambientNormal = fragNormal.xyz; - vec3 color = diffuse.rgb * evalSphericalLight(ambientSphere, ambientNormal).xyz * obscurance * getLightAmbientIntensity(light); + vec3 color = albedo * evalSphericalLight(ambientSphere, ambientNormal).xyz * obscurance * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); return color; } @@ -117,7 +117,7 @@ vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, floa <$declareSkyboxMap()$> <$declareSphericalHarmonics()$> -vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss) { +vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss) { // Need the light now Light light = getLight(); @@ -125,18 +125,18 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu vec4 fragEyeVector = invViewMat * vec4(-position, 0.0); vec3 fragEyeDir = normalize(fragEyeVector.xyz); - vec3 color = diffuse.rgb * evalSphericalLight(ambientSphere, fragNormal).xyz * obscurance * getLightAmbientIntensity(light); + vec3 color = albedo * evalSphericalLight(ambientSphere, fragNormal).xyz * obscurance * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w + shading.rgb) * min(shadowAttenuation, obscurance) * getLightColor(light) * getLightIntensity(light); return color; } <@endfunc@> <@func declareEvalLightmappedColor()@> -vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 normal, vec3 diffuse, vec3 lightmap) { +vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 normal, vec3 albedo, vec3 lightmap) { Light light = getLight(); @@ -156,7 +156,7 @@ vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscur // ambient is a tiny percentage of the lightmap and only when in the shadow vec3 ambientLight = (1 - lightAttenuation) * lightmap * getLightAmbientIntensity(light); - return obscurance * diffuse * (ambientLight + diffuseLight); + return obscurance * albedo * (ambientLight + diffuseLight); } <@endfunc@> diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 6ef5794d95..9eef530bbc 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -50,7 +50,7 @@ public: // update global lighting void setAmbientLightMode(int preset); - void setGlobalLight(const glm::vec3& direction, const glm::vec3& diffuse, float intensity, float ambientIntensity); + void setGlobalLight(const glm::vec3& direction, const glm::vec3& color, float intensity, float ambientIntensity); void setGlobalSkybox(const model::SkyboxPointer& skybox); const LightStage& getLightStage() { return _lightStage; } diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp index 34a02b51d2..991397df8b 100644 --- a/libraries/render-utils/src/GeometryCache.cpp +++ b/libraries/render-utils/src/GeometryCache.cpp @@ -1846,7 +1846,7 @@ inline bool operator==(const SimpleProgramKey& a, const SimpleProgramKey& b) { void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool culled, bool emissive, bool depthBiased) { batch.setPipeline(getSimplePipeline(textured, culled, emissive, depthBiased)); - // If not textured, set a default diffuse map + // If not textured, set a default albedo map if (!textured) { batch.setResourceTexture(render::ShapePipeline::Slot::ALBEDO_MAP, DependencyManager::get()->getWhiteTexture()); diff --git a/libraries/render-utils/src/animdebugdraw.slv b/libraries/render-utils/src/animdebugdraw.slv index 3cb356c055..ffa44b6cee 100644 --- a/libraries/render-utils/src/animdebugdraw.slv +++ b/libraries/render-utils/src/animdebugdraw.slv @@ -16,7 +16,7 @@ out vec4 _color; void main(void) { - // pass along the diffuse color + // pass along the color _color = colorToLinearRGBA(inColor.rgba); TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model.slf b/libraries/render-utils/src/model.slf index 353c772327..d00ef917fb 100755 --- a/libraries/render-utils/src/model.slf +++ b/libraries/render-utils/src/model.slf @@ -16,7 +16,7 @@ <@include model/Material.slh@> // the diffuse texture -uniform sampler2D diffuseMap; +uniform sampler2D albedoMap; in vec4 _position; in vec3 _normal; @@ -25,15 +25,15 @@ in vec2 _texCoord0; void main(void) { - // Fetch diffuse map - vec4 diffuse = texture(diffuseMap, _texCoord0); + // Fetch albedo map + vec4 albedo = texture(albedoMap, _texCoord0); Material mat = getMaterial(); packDeferredFragment( normalize(_normal.xyz), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, getMaterialSpecular(mat), getMaterialShininess(mat)); } diff --git a/libraries/render-utils/src/model_emissive.slf b/libraries/render-utils/src/model_emissive.slf index 9705897399..ba0abc44c2 100644 --- a/libraries/render-utils/src/model_emissive.slf +++ b/libraries/render-utils/src/model_emissive.slf @@ -15,7 +15,7 @@ <@include DeferredBufferWrite.slh@> <@include model/Material.slh@> -uniform sampler2D diffuseMap; +uniform sampler2D albedoMap; in vec2 _texCoord0; in vec3 _normal; @@ -23,7 +23,7 @@ in vec3 _color; in float _alpha; void main(void) { - vec4 texel = texture(diffuseMap, _texCoord0); + vec4 texel = texture(albedoMap, _texCoord0); Material mat = getMaterial(); vec3 fragColor = getMaterialAlbedo(mat) * texel.rgb * _color; diff --git a/libraries/render-utils/src/model_lightmap.slf b/libraries/render-utils/src/model_lightmap.slf index 7cfeb5da32..ff91cc402d 100755 --- a/libraries/render-utils/src/model_lightmap.slf +++ b/libraries/render-utils/src/model_lightmap.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the emissive map texture and parameters uniform sampler2D emissiveMap; @@ -30,15 +30,15 @@ in vec3 _normal; in vec3 _color; void main(void) { - vec4 diffuse = texture(diffuseMap, _texCoord0); + vec4 albedo = texture(albedoMap, _texCoord0); vec4 emissive = texture(emissiveMap, _texCoord1); Material mat = getMaterial(); packDeferredFragmentLightmap( normalize(_normal), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, getMaterialSpecular(mat), getMaterialShininess(mat), (vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb)); diff --git a/libraries/render-utils/src/model_lightmap.slv b/libraries/render-utils/src/model_lightmap.slv index eacc91245c..8696b70373 100755 --- a/libraries/render-utils/src/model_lightmap.slv +++ b/libraries/render-utils/src/model_lightmap.slv @@ -28,7 +28,7 @@ out vec3 _normal; out vec3 _color; void main(void) { - // pass along the diffuse color in linear space + // pass along the color in linear space _color = colorToLinearRGB(inColor.xyz); // and the texture coordinates diff --git a/libraries/render-utils/src/model_lightmap_normal_map.slf b/libraries/render-utils/src/model_lightmap_normal_map.slf index 165ef4bf04..fa6cc60e1f 100755 --- a/libraries/render-utils/src/model_lightmap_normal_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_map.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the normal map texture uniform sampler2D normalMap; @@ -43,15 +43,15 @@ void main(void) { normalizedBitangent * localNormal.y + normalizedNormal * localNormal.z, 0.0); // set the diffuse, normal, specular data - vec4 diffuse = texture(diffuseMap, _texCoord0); + vec4 albedo = texture(albedoMap, _texCoord0); vec4 emissive = texture(emissiveMap, _texCoord1); Material mat = getMaterial(); packDeferredFragmentLightmap( normalize(viewNormal.xyz), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, getMaterialSpecular(mat), getMaterialShininess(mat), (vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb)); diff --git a/libraries/render-utils/src/model_lightmap_normal_map.slv b/libraries/render-utils/src/model_lightmap_normal_map.slv index 6046a67e10..eb8f80656d 100755 --- a/libraries/render-utils/src/model_lightmap_normal_map.slv +++ b/libraries/render-utils/src/model_lightmap_normal_map.slv @@ -29,7 +29,7 @@ out vec3 _tangent; out vec3 _color; void main(void) { - // pass along the diffuse color in linear space + // pass along the color in linear space _color = colorToLinearRGB(inColor.xyz); // and the texture coordinates 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 591cc45a40..a9e6325320 100755 --- a/libraries/render-utils/src/model_lightmap_normal_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_specular_map.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the emissive map texture and parameters uniform sampler2D emissiveMap; @@ -45,8 +45,8 @@ void main(void) { vec4 viewNormal = vec4(normalizedTangent * localNormal.x + normalizedBitangent * localNormal.y + normalizedNormal * localNormal.z, 0.0); - // set the diffuse, normal, specular data - vec4 diffuse = texture(diffuseMap, _texCoord0); + // set the albedo, normal, specular data + vec4 albedo = texture(albedoMap, _texCoord0); vec3 specular = texture(specularMap, _texCoord0).rgb; vec4 emissive = texture(emissiveMap, _texCoord1); @@ -54,8 +54,8 @@ void main(void) { packDeferredFragmentLightmap( normalize(viewNormal.xyz), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, specular, // no use of getMaterialSpecular(mat) getMaterialShininess(mat), (vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb)); diff --git a/libraries/render-utils/src/model_lightmap_specular_map.slf b/libraries/render-utils/src/model_lightmap_specular_map.slf index 97c1713e96..531e07c411 100755 --- a/libraries/render-utils/src/model_lightmap_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_specular_map.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the emissive map texture and parameters uniform sampler2D emissiveMap; @@ -33,8 +33,8 @@ in vec3 _normal; in vec3 _color; void main(void) { - // set the diffuse, normal, specular data - vec4 diffuse = texture(diffuseMap, _texCoord0); + // set the albedo, normal, specular data + vec4 albedo = texture(albedoMap, _texCoord0); vec3 specular = texture(specularMap, _texCoord0).rgb; vec4 emissive = texture(emissiveMap, _texCoord1); @@ -42,8 +42,8 @@ void main(void) { packDeferredFragmentLightmap( normalize(_normal), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, specular, // no use of getMaterialSpecular(mat) getMaterialShininess(mat), (vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb)); diff --git a/libraries/render-utils/src/model_normal_map.slf b/libraries/render-utils/src/model_normal_map.slf index 5749a437c8..aff8049d1d 100755 --- a/libraries/render-utils/src/model_normal_map.slf +++ b/libraries/render-utils/src/model_normal_map.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the normal map texture uniform sampler2D normalMap; @@ -37,14 +37,14 @@ void main(void) { vec4 viewNormal = vec4(normalizedTangent * localNormal.x + normalizedBitangent * localNormal.y + normalizedNormal * localNormal.z, 0.0); - vec4 diffuse = texture(diffuseMap, _texCoord0.st); + vec4 albedo = texture(albedoMap, _texCoord0.st); Material mat = getMaterial(); packDeferredFragment( normalize(viewNormal.xyz), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, getMaterialSpecular(mat), getMaterialShininess(mat)); } diff --git a/libraries/render-utils/src/model_normal_map.slv b/libraries/render-utils/src/model_normal_map.slv index 5ed4e37278..f7711cd326 100755 --- a/libraries/render-utils/src/model_normal_map.slv +++ b/libraries/render-utils/src/model_normal_map.slv @@ -28,7 +28,7 @@ out vec3 _tangent; out vec3 _color; void main(void) { - // pass along the diffuse color + // pass along the color _color = colorToLinearRGB(inColor.xyz); // and the texture coordinates diff --git a/libraries/render-utils/src/model_normal_specular_map.slf b/libraries/render-utils/src/model_normal_specular_map.slf index 7f27747791..703648c5ed 100755 --- a/libraries/render-utils/src/model_normal_specular_map.slf +++ b/libraries/render-utils/src/model_normal_specular_map.slf @@ -16,8 +16,8 @@ <@include model/Material.slh@> -// the diffuse texture -uniform sampler2D diffuseMap; +// the albedo texture +uniform sampler2D albedoMap; // the normal map texture uniform sampler2D normalMap; @@ -40,16 +40,16 @@ void main(void) { vec4 viewNormal = vec4(normalizedTangent * localNormal.x + normalizedBitangent * localNormal.y + normalizedNormal * localNormal.z, 0.0); - // set the diffuse, normal, specular data - vec4 diffuse = texture(diffuseMap, _texCoord0); + // set the albedo, normal, specular data + vec4 albedo = texture(albedoMap, _texCoord0); vec3 specular = texture(specularMap, _texCoord0).rgb; Material mat = getMaterial(); packDeferredFragment( normalize(viewNormal.xyz), - evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a), - getMaterialAlbedo(mat) * diffuse.rgb * _color, + evalOpaqueFinalAlpha(getMaterialOpacity(mat), albedo.a), + getMaterialAlbedo(mat) * albedo.rgb * _color, specular, //getMaterialSpecular(mat), getMaterialShininess(mat)); } diff --git a/libraries/render-utils/src/model_translucent.slf b/libraries/render-utils/src/model_translucent.slf index 1ce0d22bc5..d90662a574 100755 --- a/libraries/render-utils/src/model_translucent.slf +++ b/libraries/render-utils/src/model_translucent.slf @@ -20,7 +20,7 @@ <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> -vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss, float opacity) { +vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss, float opacity) { // Need the light now Light light = getLight(); @@ -31,11 +31,11 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 d vec3 fragEyeDir; <$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$> - vec3 color = opacity * diffuse.rgb * getLightColor(light) * getLightAmbientIntensity(light); + vec3 color = opacity * albedo * getLightColor(light) * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); return vec4(color, opacity); } @@ -56,7 +56,7 @@ void main(void) { Material mat = getMaterial(); vec3 fragPosition = _position.xyz; vec3 fragNormal = normalize(_normal); - vec3 fragDiffuse = getMaterialAlbedo(mat) * albedo.rgb * _color; + vec3 fragAlbedo = getMaterialAlbedo(mat) * albedo.rgb * _color; vec3 fragSpecular = getMaterialSpecular(mat); float fragGloss = getMaterialShininess(mat) / 128; float fragOpacity = getMaterialOpacity(mat) * albedo.a * _alpha; @@ -64,7 +64,7 @@ void main(void) { _fragColor = evalGlobalColor(1.0, fragPosition, fragNormal, - fragDiffuse, + fragAlbedo, fragSpecular, fragGloss, fragOpacity); diff --git a/libraries/render-utils/src/overlay3D.slf b/libraries/render-utils/src/overlay3D.slf index 66a48e95f4..8de7a23898 100644 --- a/libraries/render-utils/src/overlay3D.slf +++ b/libraries/render-utils/src/overlay3D.slf @@ -17,7 +17,7 @@ <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> -vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss, float opacity) { +vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss, float opacity) { // Need the light now Light light = getLight(); @@ -28,11 +28,11 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 d vec3 fragEyeDir; <$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$> - vec3 color = opacity * diffuse.rgb * getLightColor(light) * getLightAmbientIntensity(light); + vec3 color = opacity * albedo * getLightColor(light) * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); return vec4(color, opacity); } @@ -48,14 +48,14 @@ in float _alpha; out vec4 _fragColor; void main(void) { - vec4 diffuse = texture(originalTexture, _texCoord0); + vec4 albedo = texture(originalTexture, _texCoord0); vec3 fragPosition = _position.xyz; vec3 fragNormal = normalize(_normal); - vec3 fragDiffuse = diffuse.rgb * _color; + vec3 fragAlbedo = albedo.rgb * _color; vec3 fragSpecular = vec3(0.1); float fragGloss = 10.0 / 128.0; - float fragOpacity = diffuse.a; + float fragOpacity = albedo.a; if (fragOpacity <= 0.1) { discard; @@ -64,7 +64,7 @@ void main(void) { vec4 color = evalGlobalColor(1.0, fragPosition, fragNormal, - fragDiffuse, + fragAlbedo, fragSpecular, fragGloss, fragOpacity); diff --git a/libraries/render-utils/src/overlay3D_emissive.slf b/libraries/render-utils/src/overlay3D_emissive.slf index ad689baf91..727eb0f317 100644 --- a/libraries/render-utils/src/overlay3D_emissive.slf +++ b/libraries/render-utils/src/overlay3D_emissive.slf @@ -20,12 +20,12 @@ in vec3 _color; out vec4 _fragColor; void main(void) { - vec4 diffuse = texture(originalTexture, _texCoord0); + vec4 albedo = texture(originalTexture, _texCoord0); - if (diffuse.a <= 0.1) { + if (albedo.a <= 0.1) { discard; } - vec4 color = vec4(diffuse.rgb * _color, diffuse.a); + vec4 color = vec4(albedo.rgb * _color, albedo.a); // Apply standard tone mapping _fragColor = vec4(pow(color.xyz, vec3(1.0 / 2.2)), color.w); diff --git a/libraries/render-utils/src/overlay3D_translucent.slf b/libraries/render-utils/src/overlay3D_translucent.slf index dcc15ba25b..8e6dbb9eff 100644 --- a/libraries/render-utils/src/overlay3D_translucent.slf +++ b/libraries/render-utils/src/overlay3D_translucent.slf @@ -18,7 +18,7 @@ <@include gpu/Transform.slh@> <$declareStandardCameraTransform()$> -vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 diffuse, vec3 specular, float gloss, float opacity) { +vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 albedo, vec3 specular, float gloss, float opacity) { // Need the light now Light light = getLight(); @@ -29,11 +29,11 @@ vec4 evalGlobalColor(float shadowAttenuation, vec3 position, vec3 normal, vec3 d vec3 fragEyeDir; <$transformEyeToWorldDir(cam, fragEyeVectorView, fragEyeDir)$> - vec3 color = opacity * diffuse.rgb * getLightColor(light) * getLightAmbientIntensity(light); + vec3 color = opacity * albedo * getLightColor(light) * getLightAmbientIntensity(light); vec4 shading = evalFragShading(fragNormal, -getLightDirection(light), fragEyeDir, specular, gloss); - color += vec3(diffuse * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); + color += vec3(albedo * shading.w * opacity + shading.rgb) * shadowAttenuation * getLightColor(light) * getLightIntensity(light); return vec4(color, opacity); } @@ -49,19 +49,19 @@ in float _alpha; out vec4 _fragColor; void main(void) { - vec4 diffuse = texture(originalTexture, _texCoord0); + vec4 albedo = texture(originalTexture, _texCoord0); vec3 fragPosition = _position.xyz; vec3 fragNormal = normalize(_normal); - vec3 fragDiffuse = diffuse.rgb * _color; + vec3 fragAlbedo = albedo.rgb * _color; vec3 fragSpecular = vec3(0.1); float fragGloss = 10.0 / 128.0; - float fragOpacity = diffuse.a * _alpha; + float fragOpacity = albedo.a * _alpha; vec4 color = evalGlobalColor(1.0, fragPosition, fragNormal, - fragDiffuse, + fragAlbedo, fragSpecular, fragGloss, fragOpacity); diff --git a/libraries/render-utils/src/overlay3D_translucent_emissive.slf b/libraries/render-utils/src/overlay3D_translucent_emissive.slf index bcfec7d588..61935f3c67 100644 --- a/libraries/render-utils/src/overlay3D_translucent_emissive.slf +++ b/libraries/render-utils/src/overlay3D_translucent_emissive.slf @@ -21,7 +21,7 @@ in float _alpha; out vec4 _fragColor; void main(void) { - vec4 diffuse = texture(originalTexture, _texCoord0); + vec4 albedo = texture(originalTexture, _texCoord0); - _fragColor = vec4(diffuse.rgb * _color, diffuse.a * _alpha); + _fragColor = vec4(albedo.rgb * _color, albedo.a * _alpha); } diff --git a/libraries/render-utils/src/skin_model.slv b/libraries/render-utils/src/skin_model.slv index 8ab475e1fd..199b97ba53 100755 --- a/libraries/render-utils/src/skin_model.slv +++ b/libraries/render-utils/src/skin_model.slv @@ -32,7 +32,7 @@ void main(void) { skinPositionNormal(inSkinClusterIndex, inSkinClusterWeight, inPosition, inNormal.xyz, position, interpolatedNormal); - // pass along the diffuse color + // pass along the color _color = colorToLinearRGB(inColor.rgb); // and the texture coordinates