mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
More experimental shaders
This commit is contained in:
parent
c36e3693be
commit
b2051767ff
@ -95,6 +95,10 @@ void main() {
|
||||
tgt_color = vec4(mat_colors[mat.a % 5u], 1);
|
||||
return;
|
||||
#endif
|
||||
#ifdef EXPERIMENTAL_VIEWDEPTH
|
||||
tgt_color = vec4(vec3(pow(clamp(depth_at(uv) / 524288.0, 0, 1), 0.3)), 1);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef EXPERIMENTAL_BAREMINIMUM
|
||||
tgt_color = vec4(color.rgb, 1);
|
||||
|
@ -27,6 +27,13 @@ float hash_two(uvec2 q) {
|
||||
return float(n) * (1.0 / float(0xffffffffU));
|
||||
}
|
||||
|
||||
float hash_three(uvec3 q) {
|
||||
q *= uvec3(M1, M2, M3);
|
||||
uint n = q.x ^ q.y ^ q.z;
|
||||
n = n * (n ^ (n >> 15));
|
||||
return float(n) * (1.0 / float(0xffffffffU));
|
||||
}
|
||||
|
||||
float hash_fast(uvec3 q) {
|
||||
q *= uvec3(M1, M2, M3);
|
||||
|
||||
|
@ -314,5 +314,11 @@ void main() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EXPERIMENTAL_NEWSPAPER
|
||||
float nz = hash_three(uvec3(uvec2(uv * screen_res.xy), tick.x * dot(fract(uv * 10) + 5, vec2(1)) * 0.3));
|
||||
nz = (nz > 0.5) ? (pow(nz * 2 - 1, 1.5) * 0.5 + 0.5) : (pow(nz * 2, 1/1.5) * 0.5);
|
||||
final_color.rgb = vec3(step(nz, length(final_color.rgb))) * mix(vec3(1, 0.5, 0.3), normalize(final_color.rgb), 0.05);
|
||||
#endif
|
||||
|
||||
tgt_color = vec4(final_color.rgb, 1);
|
||||
}
|
||||
|
@ -515,6 +515,8 @@ pub enum ExperimentalShader {
|
||||
ViewNormals,
|
||||
/// Show gbuffer materials.
|
||||
ViewMaterials,
|
||||
/// Show gbuffer depth.
|
||||
ViewDepth,
|
||||
/// Rather than fading out screen-space reflections at view space borders,
|
||||
/// smear screen space to cover the reflection vector.
|
||||
SmearReflections,
|
||||
@ -526,4 +528,6 @@ pub enum ExperimentalShader {
|
||||
/// Prefer using physically-based values for various rendering parameters,
|
||||
/// where possible.
|
||||
Photorealistic,
|
||||
/// A dithered newspaper effect.
|
||||
Newspaper,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user