Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-extras
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glow
glow-extras
Commits
2e648754
Commit
2e648754
authored
6 years ago
by
Julian Schakib
Browse files
Options
Downloads
Patches
Plain Diff
glow shaders included properly, shadows on no background in screenshot too
parent
ee478f92
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pipeline/glow-extras/pipeline/RenderingPipeline.cc
+2
-0
2 additions, 0 deletions
pipeline/glow-extras/pipeline/RenderingPipeline.cc
pipeline/shader/glow-pipeline/output.fsh
+11
-3
11 additions, 3 deletions
pipeline/shader/glow-pipeline/output.fsh
with
13 additions
and
3 deletions
pipeline/glow-extras/pipeline/RenderingPipeline.cc
+
2
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
pipeline/shader/glow-pipeline/output.fsh
+
11
−
3
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;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment