-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into emilk/cleaner-space-view-ui
- Loading branch information
Showing
50 changed files
with
3,292 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"objectron", | ||
"Skybox", | ||
"smallvec", | ||
"texcoords", | ||
"Tonemapper", | ||
"tonemapping", | ||
"Wgsl" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
crates/re_renderer/shader/tonemap.wgsl → crates/re_renderer/shader/composite.wgsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#import <./types.wgsl> | ||
#import <./utils/srgb.wgsl> | ||
#import <./global_bindings.wgsl> | ||
|
||
struct VertexOutput { | ||
@builtin(position) position: Vec4, | ||
@location(0) texcoord: Vec2, | ||
}; | ||
|
||
// TODO(andreas): Move global bindings to shared include | ||
@group(0) @binding(1) | ||
var nearest_sampler: sampler; | ||
|
||
@group(1) @binding(0) | ||
var hdr_texture: texture_2d<f32>; | ||
var input_texture: texture_2d<f32>; | ||
|
||
@fragment | ||
fn main(in: VertexOutput) -> @location(0) Vec4 { | ||
// Note that we can't use a simple textureLoad using @builtin(position) here despite the lack of filtering. | ||
// The issue is that positions provided by @builtin(position) are not dependent on the set viewport, | ||
// but are about the location of the texel in the target texture. | ||
let hdr = textureSample(hdr_texture, nearest_sampler, in.texcoord).rgb; | ||
let input = textureSample(input_texture, nearest_sampler, in.texcoord).rgb; | ||
// TODO(andreas): Do something meaningful with values above 1 | ||
let hdr = clamp(hdr, vec3<f32>(0.0), vec3<f32>(1.0)); | ||
return Vec4(srgb_from_linear(hdr), 1.0); | ||
let input = clamp(input, vec3<f32>(0.0), vec3<f32>(1.0)); | ||
|
||
// Convert to srgb - this is necessary since the final eframe output does *not* have an srgb format. | ||
// Note that the input here is assumed to be linear - if the input texture was an srgb texture it would have been converted on load. | ||
return Vec4(srgb_from_linear(input), 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.