Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
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
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Vulkan2021
VkCV Framework
Commits
d06431b5
Commit
d06431b5
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#82
] More robust and subtle lens distortion
parent
0cbb4c29
No related branches found
No related tags found
1 merge request
!70
Resolve "Voxel cone tracing"
Pipeline
#26039
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/voxelization/resources/shaders/tonemapping.comp
+16
-5
16 additions, 5 deletions
projects/voxelization/resources/shaders/tonemapping.comp
with
16 additions
and
5 deletions
projects/voxelization/resources/shaders/tonemapping.comp
+
16
−
5
View file @
d06431b5
...
...
@@ -74,11 +74,22 @@ vec3 applyGrain(ivec2 uv, vec3 c){
}
vec2 computeDistortedUV(vec2 uv, float aspectRatio){
vec2 toCenter = vec2(vec2(0.5) - uv);
float r2 = dot(toCenter, toCenter);
float k1 = 0.15f;
float k2 = 0.2f;
return uv + toCenter * (r2*k1 + r2*r2*k2);
uv = uv * 2 - 1;
float r2 = dot(uv, uv);
float k1 = 0.02f;
float maxR2 = dot(vec2(1), vec2(1));
float maxFactor = maxR2 * k1;
// correction only needed for pincushion distortion
maxFactor = min(maxFactor, 0);
uv /= 1 + r2*k1;
// correction to avoid going out of [-1, 1] range when using barrel distortion
uv *= 1 + maxFactor;
return uv * 0.5 + 0.5;
}
float computeLocalContrast(vec2 uv){
...
...
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