diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index c6a05e0d65..da264cbf7d 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -178,13 +178,13 @@ void initDeferredPipelines(render::ShapePlumber& plumber) { modelVertex, modelPixel); addPipeline( Key::Builder(), - modelVertex, simplePixel); + simpleVertex, simplePixel); addPipeline( Key::Builder().withMaterial().withUnlit(), modelVertex, modelUnlitPixel); addPipeline( Key::Builder().withUnlit(), - modelVertex, simpleUnlitPixel); + simpleVertex, simpleUnlitPixel); addPipeline( Key::Builder().withMaterial().withTangents(), modelNormalMapVertex, modelNormalMapPixel); diff --git a/libraries/render-utils/src/simple_transparent_textured.slf b/libraries/render-utils/src/simple_transparent_textured.slf index f61a2c3608..b9eb921e9d 100644 --- a/libraries/render-utils/src/simple_transparent_textured.slf +++ b/libraries/render-utils/src/simple_transparent_textured.slf @@ -13,29 +13,50 @@ // <@include gpu/Color.slh@> + <@include DeferredBufferWrite.slh@> -<@include model/Material.slh@> +<@include DeferredGlobalLight.slh@> +<$declareEvalGlobalLightingAlphaBlended()$> + +<@include gpu/Transform.slh@> +<$declareStandardCameraTransform()$> // the albedo texture uniform sampler2D originalTexture; // the interpolated normal +in vec4 _position; in vec3 _normal; in vec4 _color; in vec2 _texCoord0; void main(void) { vec4 texel = texture(originalTexture, _texCoord0.st); - float colorAlpha = _color.a; + float opacity = _color.a; if (_color.a <= 0.0) { texel = colorToLinearRGBA(texel); - colorAlpha = -_color.a; + opacity = -_color.a; } + opacity *= texel.a; + vec3 albedo = _color.rgb * texel.rgb; - packDeferredFragmentTranslucent( - normalize(_normal), - colorAlpha, - _color.rgb * texel.rgb, + vec3 fragPosition = _position.xyz; + vec3 fragNormal = normalize(_normal); + + TransformCamera cam = getTransformCamera(); + + _fragColor0 = vec4(evalGlobalLightingAlphaBlended( + cam._viewInverse, + 1.0, + 1.0, + fragPosition, + fragNormal, + albedo, DEFAULT_FRESNEL, - DEFAULT_ROUGHNESS); + 0.0, + vec3(0.0f), + DEFAULT_ROUGHNESS, + opacity), + opacity); + } \ No newline at end of file diff --git a/libraries/render-utils/src/simple_transparent_textured_unlit.slf b/libraries/render-utils/src/simple_transparent_textured_unlit.slf index 9ef3e6b82a..693d7be2db 100644 --- a/libraries/render-utils/src/simple_transparent_textured_unlit.slf +++ b/libraries/render-utils/src/simple_transparent_textured_unlit.slf @@ -22,6 +22,9 @@ in vec3 _normal; in vec4 _color; in vec2 _texCoord0; + +layout(location = 0) out vec4 _fragColor0; + void main(void) { vec4 texel = texture(originalTexture, _texCoord0.st); float colorAlpha = _color.a;