Infinite islands level
This commit is contained in:
1 parent
4d07c5fb73
commit
e489469119
5 files changed
+448
-84
No files matched your search
@@ -22,7 +22,7 @@ void vertex() {
|
||||
// Pass the distance to the fragment shader using a varying attribute.
|
||||
vec3 world_position = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||
vec3 camera_position = (INV_VIEW_MATRIX * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
|
||||
|
||||
|
||||
pixel_distance = distance(world_position, camera_position);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void fragment() {
|
||||
// This is because the exit camera views the exit portal from the perspective of the player watching
|
||||
// the entrance portal, meaning the exit portal will occupy the same screen-space as the entrance portal.
|
||||
vec3 portal_color = texture(albedo, SCREEN_UV).rgb;
|
||||
|
||||
|
||||
// Fade-out color
|
||||
float t = smoothstep(fade_out_distance_min, fade_out_distance_max, pixel_distance);
|
||||
ALBEDO = mix(portal_color, fade_out_color.rgb, t);
|
||||
|
||||
Reference in new issue
Block a user