Skip to content

Commit

Permalink
Gloom: Further transparency tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 3a18dfa commit 621192d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doomsday/tests/test_gloom/net.dengine.gloom.pack/images.dei
Expand Up @@ -13,9 +13,9 @@ group world {
}
image test2.diffuse { path = "images/mat-test2.png" }
group water {
image diffuse { path = "images/softnoise.png/Color.solid:0,0,0,0" }
image diffuse { path = "images/softnoise.png/Color.solid:128,64,0,128" }
image normaldisp { path = "images/softnoise.png/HeightMap.toNormals" }
image specgloss { path = "images/softnoise.png/Color.solid:128,128,128,255"}
image specgloss { path = "images/softnoise.png/Color.solid:255,255,255,255"}
}
}

Expand Down
Expand Up @@ -15,7 +15,7 @@ void main(void) {
float dp = dot(surface.normal, uLightDir);
if (dp > 0.0) {
// Apply a slight bias to backfaces to avoid peter panning.
//gl_Position.z *= 1.0 + 0.1*(1.0 - dp);
// gl_Position.z *= 1.0 + 0.1*(1.0 - dp);
gl_Position.z -= 0.004;
}
vUV = Gloom_MapSurfaceTexCoord(surface);
Expand Down
Expand Up @@ -72,7 +72,7 @@ void main(void) {
vec3 refracted = refract(vsViewDir, vsNormal, 1.05);
if (refracted != vec3(0.0)) {
reflectRatio = max(0.0, dot(refracted, vsViewDir));
float refrFactor = 0.05 / max(1.0, viewDistance);
float refrFactor = 0.05 / max(1.0, viewDistance * 0.5);
vec2 fragPos = (gl_FragCoord.xy + refracted.xy * uViewportSize.y * refrFactor) / uViewportSize;
refractedColor = texture(uRefractedFrame, fragPos) * (1.0 - reflectRatio);
backPos = GBuffer_ViewSpacePos(fragPos).xyz;
Expand Down

0 comments on commit 621192d

Please sign in to comment.