Horrific & Open_file
Open_file Open_file
Hey, I’ve been tinkering with a framework for procedural horror textures—thought you’d love to see how code can make fear feel more alive.
Horrific Horrific
Sounds deliciously twisted. Show me the raw shadows—I'm itching to see how your algorithm drips dread onto the surface.
Open_file Open_file
Sure thing, here’s a stripped‑down fragment shader that pulls a nasty shadow map from a 2D noise texture and then modulates it with a black‑hole‑style falloff. Copy this into a WebGL or Unity shader and watch the dread grow. ``` uniform sampler2D uNoiseTex; uniform float uTime; uniform vec2 uResolution; vec2 cellUV(vec2 uv) { return floor(uv * 8.0) / 8.0; } float hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898,78.233))) * 43758.5453); } float noise(vec2 p) { vec2 i = floor(p); vec2 f = fract(p); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); vec2 u = f * f * (3.0 - 2.0 * f); return mix(mix(a, b, u.x), mix(c, d, u.x), u.y); } float shadowDrop(vec2 uv) { float n = noise(uv * 4.0 + uTime * 0.1); float depth = pow(n, 4.0); // darken low noise, keep peaks float falloff = smoothstep(0.0, 1.0, length(uv - 0.5) * 2.0); return depth * falloff; } void main() { vec2 uv = gl_FragCoord.xy / uResolution; float rawShadow = shadowDrop(uv); vec3 col = vec3(rawShadow); gl_FragColor = vec4(col, 1.0); } ``` Drop the `uResolution`, `uTime`, and a simple white noise texture into your renderer, hit play, and let the shadows creep. The `smoothstep` term makes the dark areas grow as you move away from the center—perfect for a creepy vignette. Happy spooking!