-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use linear viewZ for accurate and controllable weighted filtering
- Loading branch information
1 parent
1d9b63b
commit 099c4b4
Showing
5 changed files
with
65 additions
and
12 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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include lumi:shaders/pass/header.glsl | ||
|
||
/****************************************************** | ||
lumi:shaders/pass/depth.frag | ||
******************************************************/ | ||
|
||
uniform sampler2D u_vanilla_depth; | ||
|
||
out float viewZ; | ||
|
||
void main() | ||
{ | ||
float depth = texture(u_vanilla_depth, v_texcoord).r; | ||
vec4 temp = frx_inverseProjectionMatrix * vec4(v_texcoord * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0); | ||
viewZ = -temp.z / temp.w; | ||
} |