-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
23 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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#version $GLSL_VERSION_STR | ||
$GLSL_DEFAULT_PRECISION_FLOAT | ||
|
||
#pragma vp_entryPoint "oe_ldb_vert" | ||
#pragma vp_entryPoint "oe_logDepth_vert" | ||
#pragma vp_location "vertex_clip" | ||
#pragma vp_order "FLT_MAX" | ||
|
||
uniform float oe_ldb_C; | ||
uniform float oe_ldb_FC; | ||
uniform float oe_logDepth_C; | ||
uniform float oe_logDepth_FC; | ||
|
||
void oe_ldb_vert(inout vec4 clip) | ||
void oe_logDepth_vert(inout vec4 clip) | ||
{ | ||
clip.z = (log2(max(1e-6,oe_ldb_C*clip.w+1.0))*oe_ldb_FC - 1.0) * clip.w; | ||
clip.z = (log2(max(1e-6,oe_logDepth_C*clip.w+1.0))*oe_logDepth_FC - 1.0) * clip.w; | ||
} |
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,14 +1,14 @@ | ||
#version $GLSL_VERSION_STR | ||
$GLSL_DEFAULT_PRECISION_FLOAT | ||
|
||
#pragma vp_entryPoint "oe_ldb_frag" | ||
#pragma vp_entryPoint "oe_logDepth_frag" | ||
#pragma vp_location "fragment_lighting" | ||
#pragma vp_order "FLT_MAX" | ||
|
||
uniform float oe_ldb_FC; | ||
varying float oe_ldb_logz; | ||
uniform float oe_logDepth_FC; | ||
varying float oe_logDepth_logz; | ||
|
||
void oe_ldb_frag(inout vec4 color) | ||
void oe_logDepth_frag(inout vec4 color) | ||
{ | ||
gl_FragDepth = log2(oe_ldb_logz)*0.5*oe_ldb_FC; | ||
gl_FragDepth = log2(oe_logDepth_logz)*0.5*oe_logDepth_FC; | ||
} |
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,16 +1,16 @@ | ||
#version $GLSL_VERSION_STR | ||
$GLSL_DEFAULT_PRECISION_FLOAT | ||
|
||
#pragma vp_entryPoint "oe_ldb_vert" | ||
#pragma vp_entryPoint "oe_logDepth_vert" | ||
#pragma vp_location "vertex_clip" | ||
#pragma vp_order "FLT_MAX" | ||
|
||
uniform float oe_ldb_C; | ||
uniform float oe_ldb_FC; | ||
varying float oe_ldb_logz; | ||
uniform float oe_logDepth_C; | ||
uniform float oe_logDepth_FC; | ||
varying float oe_logDepth_logz; | ||
|
||
void oe_ldb_vert(inout vec4 clip) | ||
void oe_logDepth_vert(inout vec4 clip) | ||
{ | ||
oe_ldb_logz = max(1e-6, clip.w*oe_ldb_C + 1.0); | ||
clip.z = log2(oe_ldb_logz)*oe_ldb_FC - 1.0; | ||
oe_logDepth_logz = max(1e-6, clip.w*oe_logDepth_C + 1.0); | ||
clip.z = log2(oe_logDepth_logz)*oe_logDepth_FC - 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