-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The vizualizer is implemented inside filament itself and activated using the debug registry. This intended for filament development use.
- Loading branch information
1 parent
984006e
commit 1308254
Showing
8 changed files
with
174 additions
and
0 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
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,59 @@ | ||
material { | ||
name : shadowmap, | ||
parameters : [ | ||
{ | ||
type : sampler2dArray, | ||
name : shadowmap, | ||
precision : high | ||
}, | ||
{ | ||
type : float, | ||
name : power, | ||
precision : high | ||
}, | ||
{ | ||
type : float2, | ||
name : scale, | ||
}, | ||
{ | ||
type : int, | ||
name : layer | ||
}, | ||
{ | ||
type : int, | ||
name : level | ||
}, | ||
{ | ||
type : int, | ||
name : channel | ||
} | ||
], | ||
variables : [ | ||
vertex | ||
], | ||
vertexDomain : device, | ||
depthWrite : false, | ||
depthCulling : false, | ||
domain: postprocess | ||
} | ||
|
||
vertex { | ||
void postProcessVertex(inout PostProcessVertexInputs postProcess) { | ||
postProcess.vertex.xy = postProcess.normalizedUV; | ||
postProcess.position.xy = 1.0 + (postProcess.position.xy - 1.0) * materialParams.scale; | ||
} | ||
} | ||
|
||
fragment { | ||
void dummy(){} | ||
|
||
void postProcess(inout PostProcessInputs postProcess) { | ||
highp vec2 uv = uvToRenderTargetUV(variable_vertex.xy); | ||
highp vec3 p = vec3(uv, float(materialParams.layer)); | ||
float m = float(materialParams.level); | ||
highp float c = textureLod(materialParams_shadowmap, p, m)[materialParams.channel]; | ||
c = pow(abs(c), materialParams.power); | ||
postProcess.color.rgb = vec3(c); | ||
postProcess.color.a = 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