Refract the shard with the ice again and make it bigger

It is sampled at the refracted position like every other sheet, so the
cracks cut across it and bend its silhouette; SHARD 0.70 -> 0.95.
This commit is contained in:
emil28092005
2026-10-30 21:31:34 +03:00
parent 01123b8bac
commit 62355eb047
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ vec3 shardLocal(vec3 p, float phase) {
p.yz /= vec2(1.0, 1.45); p.yz /= vec2(1.0, 1.45);
return abs(p); return abs(p);
} }
const float SHARD = 0.70; // how big the shard is in sheet units const float SHARD = 0.95; // how big the shard is in sheet units
// Cross two octahedra: the intersection is an eight-sided gem, so the shard still // Cross two octahedra: the intersection is an eight-sided gem, so the shard still
// reads as a cut stone from any angle instead of a flat kite. // reads as a cut stone from any angle instead of a flat kite.
vec3 gemAxes(vec3 l, out vec2 r) { vec3 gemAxes(vec3 l, out vec2 r) {
+1 -3
View File
@@ -87,9 +87,7 @@ void main() {
float depth = solid ? OBJECT_DEPTH float depth = solid ? OBJECT_DEPTH
: texture2D(u_scene, atlasUV(hit.xy + par, layer)).a * 2.6; : texture2D(u_scene, atlasUV(hit.xy + par, layer)).a * 2.6;
float path = (hit.z - (FRONT - depth)) / -inside.z; // ice crossed to reach this sheet float path = (hit.z - (FRONT - depth)) / -inside.z; // ice crossed to reach this sheet
// The shard keeps its shape: it is sampled without the refraction offset, so it vec2 at = (hit + inside * path).xy + par;
// stays one solid piece instead of being cut up by the crack steps.
vec2 at = solid ? hit.xy + par * 0.5 : (hit + inside * path).xy + par;
vec3 plasma; vec3 plasma;
plasma.r = texture2D(u_scene, atlasUV(at + shearR * path, layer)).r; plasma.r = texture2D(u_scene, atlasUV(at + shearR * path, layer)).r;
plasma.g = texture2D(u_scene, atlasUV(at, layer)).g; plasma.g = texture2D(u_scene, atlasUV(at, layer)).g;
+2 -2
View File
File diff suppressed because one or more lines are too long