mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix ssao
This commit is contained in:
parent
021cfd8a1e
commit
3e66ff5924
4 changed files with 9 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ uniform samplerCube u_skybox;
|
|||
|
||||
void main(){
|
||||
vec3 dir = normalize(v_coord);
|
||||
f_position = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
f_position = vec4(0.0, 0.0, -1e9, 1.0);
|
||||
f_normal = vec4(0.0);
|
||||
f_color = texture(u_skybox, dir);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#param vec3 u_ssaoSamples[64]
|
||||
#param int u_kernelSize = 16
|
||||
#param float u_radius = 0.2
|
||||
#param float u_radius = 0.4
|
||||
#param float u_bias = 0.006
|
||||
|
||||
vec4 effect() {
|
||||
|
|
@ -32,5 +32,5 @@ vec4 effect() {
|
|||
|
||||
float z = -position.z * 0.01;
|
||||
z = max(0.0, 1.0 - z);
|
||||
return vec4(occlusion, 0.0, 0.0, 1.0);
|
||||
return vec4(mix(1.0, occlusion, z), 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue