mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:57:58 +02:00
FIxing the bug for image3D overlay drawn in scene
This commit is contained in:
parent
b18d82bd19
commit
6385a702cd
3 changed files with 34 additions and 10 deletions
|
@ -178,13 +178,13 @@ void initDeferredPipelines(render::ShapePlumber& plumber) {
|
||||||
modelVertex, modelPixel);
|
modelVertex, modelPixel);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder(),
|
Key::Builder(),
|
||||||
modelVertex, simplePixel);
|
simpleVertex, simplePixel);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withUnlit(),
|
Key::Builder().withMaterial().withUnlit(),
|
||||||
modelVertex, modelUnlitPixel);
|
modelVertex, modelUnlitPixel);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withUnlit(),
|
Key::Builder().withUnlit(),
|
||||||
modelVertex, simpleUnlitPixel);
|
simpleVertex, simpleUnlitPixel);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withTangents(),
|
Key::Builder().withMaterial().withTangents(),
|
||||||
modelNormalMapVertex, modelNormalMapPixel);
|
modelNormalMapVertex, modelNormalMapPixel);
|
||||||
|
|
|
@ -13,29 +13,50 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
<@include gpu/Color.slh@>
|
<@include gpu/Color.slh@>
|
||||||
|
|
||||||
<@include DeferredBufferWrite.slh@>
|
<@include DeferredBufferWrite.slh@>
|
||||||
<@include model/Material.slh@>
|
<@include DeferredGlobalLight.slh@>
|
||||||
|
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||||
|
|
||||||
|
<@include gpu/Transform.slh@>
|
||||||
|
<$declareStandardCameraTransform()$>
|
||||||
|
|
||||||
// the albedo texture
|
// the albedo texture
|
||||||
uniform sampler2D originalTexture;
|
uniform sampler2D originalTexture;
|
||||||
|
|
||||||
// the interpolated normal
|
// the interpolated normal
|
||||||
|
in vec4 _position;
|
||||||
in vec3 _normal;
|
in vec3 _normal;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
float colorAlpha = _color.a;
|
float opacity = _color.a;
|
||||||
if (_color.a <= 0.0) {
|
if (_color.a <= 0.0) {
|
||||||
texel = colorToLinearRGBA(texel);
|
texel = colorToLinearRGBA(texel);
|
||||||
colorAlpha = -_color.a;
|
opacity = -_color.a;
|
||||||
}
|
}
|
||||||
|
opacity *= texel.a;
|
||||||
|
vec3 albedo = _color.rgb * texel.rgb;
|
||||||
|
|
||||||
packDeferredFragmentTranslucent(
|
vec3 fragPosition = _position.xyz;
|
||||||
normalize(_normal),
|
vec3 fragNormal = normalize(_normal);
|
||||||
colorAlpha,
|
|
||||||
_color.rgb * texel.rgb,
|
TransformCamera cam = getTransformCamera();
|
||||||
|
|
||||||
|
_fragColor0 = vec4(evalGlobalLightingAlphaBlended(
|
||||||
|
cam._viewInverse,
|
||||||
|
1.0,
|
||||||
|
1.0,
|
||||||
|
fragPosition,
|
||||||
|
fragNormal,
|
||||||
|
albedo,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_ROUGHNESS);
|
0.0,
|
||||||
|
vec3(0.0f),
|
||||||
|
DEFAULT_ROUGHNESS,
|
||||||
|
opacity),
|
||||||
|
opacity);
|
||||||
|
|
||||||
}
|
}
|
|
@ -22,6 +22,9 @@ in vec3 _normal;
|
||||||
in vec4 _color;
|
in vec4 _color;
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
|
|
||||||
|
|
||||||
|
layout(location = 0) out vec4 _fragColor0;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0.st);
|
vec4 texel = texture(originalTexture, _texCoord0.st);
|
||||||
float colorAlpha = _color.a;
|
float colorAlpha = _color.a;
|
||||||
|
|
Loading…
Reference in a new issue