Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Glow
glow-extras
Commits
2e648754
Commit
2e648754
authored
Mar 26, 2019
by
Julian Schakib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glow shaders included properly, shadows on no background in screenshot too
parent
ee478f92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
pipeline/glow-extras/pipeline/RenderingPipeline.cc
pipeline/glow-extras/pipeline/RenderingPipeline.cc
+2
-0
pipeline/shader/glow-pipeline/output.fsh
pipeline/shader/glow-pipeline/output.fsh
+11
-3
No files found.
pipeline/glow-extras/pipeline/RenderingPipeline.cc
View file @
2e648754
...
...
@@ -265,6 +265,8 @@ void RenderingPipeline::render(const std::function<void(RenderPass const& pass)>
// copy shader (with downsampling and dithering)
auto
shader
=
mShaderOutput
->
use
();
shader
.
setTexture
(
"uTexture"
,
toColorTmp
?
mTargetColor
:
mTargetColorTmp
);
shader
.
setTexture
(
"uTextureDepth"
,
mTargetDepth
);
shader
.
setTexture
(
"uTexRevealage"
,
mTargetTranspReveal
);
shader
.
setUniform
(
"uOutputSize"
,
glm
::
vec2
(
getOutputWidth
(),
getOutputHeight
()));
shader
.
setUniform
(
"uDitheringStrength"
,
mDitheringStrength
);
...
...
pipeline/shader/glow-pipeline/output.fsh
View file @
2e648754
#include "utils.glsl"
uniform sampler2DRect uTexture;
uniform sampler2DRect uTextureDepth;
uniform sampler2DRect uTexRevealage;
uniform vec2 uOutputSize;
uniform float uDitheringStrength;
in vec2 aPosition;
out vec
3
fColor;
out vec
4
fColor;
void main()
{
// this is tested to properly down-scale 2-to-1
vec
3
color = texture(uTexture, gl_FragCoord.xy * textureSize(uTexture) / uOutputSize).rgb;
vec
4
color = texture(uTexture, gl_FragCoord.xy * textureSize(uTexture) / uOutputSize).rgb
a
;
uint seed = uint(gl_FragCoord.x) + uint(gl_FragCoord.y) * 8096;
float r = wang_float(wang_hash(seed * 3 + 0));
...
...
@@ -20,5 +22,11 @@ void main()
float b = wang_float(wang_hash(seed * 3 + 2));
vec3 random = vec3(r, g, b);
fColor = color + (random - .5) * uDitheringStrength;
fColor.rgb = color.rgb + (random - .5) * uDitheringStrength;
float alpha = texelFetch(uTexRevealage, ivec2(gl_FragCoord.xy)).r;
fColor.a = float(texture(uTextureDepth, gl_FragCoord.xy).r != 1);
if(alpha != 1)
fColor.a = alpha;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment