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
vec3 hbao(){ | |
vec3 posc = texture(worldPosTex, UV).rgb; | |
vec3 norm = texture(normalsTex, UV).rgb; | |
float buf = 0, counter = 0, div = 1.0/(length(posc)+1.0); | |
for(float g = 0; g < mPI2; g+=0.52){ | |
for(float g2 = 0.1; g2 < 1.0; g2+=0.29){ | |
vec3 pos = texture(worldPosTex, UV + (vec2(sin(g + g2)*ratio, cos(g + g2)) * (getRand() * 4.09)) * div).rgb; | |
buf += max(0, sign(length(posc) - length(pos))) * (dot(norm, normalize(pos - posc))) * max(0, (10.0 - length(pos - posc))/10.0); | |
counter+=0.3; | |
} |
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
vec2 projdir(vec3 start, vec3 end) | |
{ | |
vec4 clipspace = (ProjectionMatrix * ViewMatrix) * vec4((start), 1.0); | |
vec2 sspace1 = ((clipspace.xyz / clipspace.w).xy + 1.0) / 2.0; | |
clipspace = (ProjectionMatrix * ViewMatrix) * vec4((end), 1.0); | |
vec2 sspace2 = ((clipspace.xyz / clipspace.w).xy + 1.0) / 2.0; | |
return (sspace2 - sspace1); | |
} | |
bool testVisibility3d(vec2 cuv, vec3 w1, vec3 w2) |
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
#version 430 core | |
in vec2 UV; | |
layout(binding = 0) uniform sampler2DMS texColor; | |
layout(binding = 1) uniform sampler2DMS texDepth; | |
const int samples = 8; | |
float samplesInverted = 1.0 / samples; |
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
vec3 blurWhitening(){ | |
vec3 outc = vec3(0); | |
for(float g = 0; g < mPI2; g+=0.6){ | |
for(float g2 = 0; g2 < 14.0; g2+=2.0){ | |
vec2 gauss = vec2(sin(g)*ratio, cos(g)) * (g2 * 0.001); | |
vec3 color = fetchColor(UV + gauss); | |
float luminance = length(color); // luminance from 1.4 to 1.7320 | |
if(luminance > 1.0){ | |
luminance = (luminance - 1.0) / 0.320; | |
outc += 0.042857142 * luminance; |
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
using System; | |
namespace ConsoleApplication4 | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
float test = 666.6666666f; | |
DateTime now = DateTime.Now; |