Skip to content

Commit

Permalink
Merge branch 'main' into gi_clipmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e authored Aug 1, 2024
2 parents 4beaac3 + fd9fe31 commit 57b0d33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Shaders/ssrefr_pass/ssrefr_pass.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,13 @@ void main() {

vec3 dir = refracted * (1.0 - rand(texCoord) * ss_refractionJitter * roughness) * 2.0;
vec4 coords = rayCast(dir);

vec3 refractionCol;
if (all(equal(coords, vec4(0.0)))) // out of range
refractionCol = textureLod(tex1, texCoord, 0.0).rgb;
else
refractionCol = textureLod(tex1, coords.xy, 0.0).rgb;

refractionCol = clamp(refractionCol, 0.0, 1.0);
vec3 color = textureLod(tex, texCoord.xy, 0.0).rgb;
#ifdef _VoxelRefract
vec3 voxelsRefr = textureLod(voxels_refraction, texCoord, 0.0).rgb * voxelgiRefr;
refractionCol = (refractionCol + voxelsRefr) / 2;
#endif

vec3 refractionCol = textureLod(tex1, coords.xy, 0.0).rgb;
refractionCol = clamp(refractionCol, 0.0, 1.0);
vec3 color = textureLod(tex, texCoord.xy, 0.0).rgb;
#ifdef _VoxelRefract
vec3 voxelsRefr = textureLod(voxels_refraction, texCoord, 0.0).rgb * voxelgiRefr;
refractionCol = (refractionCol + voxelsRefr) / 2;
#endif
fragColor.rgb = mix(refractionCol, color, opac);
}
1 change: 1 addition & 0 deletions Shaders/voxel_temporal/voxel_temporal.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ void main() {
radiance.rgb *= diffuse_indirect;
#endif
radiance.rgb += emission.rgb;

#else
opac = float(imageLoad(voxels, src)) / 255;
#endif
Expand Down

0 comments on commit 57b0d33

Please sign in to comment.