How to transform into nightmare?

Godot Version

Godot 4.5

Question

Im searching for something like the player walk into the unfamiliar town then suddenly the town transforms itself into nightmare like Silent Hill 1.
That, how they do that? Do they switch texture on the buildings, street and everything out of script or anything? Let me know in the comment.

1 Like

Can you link to a video that shows the effect?

Sure.
Im searching for something like this “darkness devouring the town”, so I want that in my game. @3:47:00

See the wall, and everything’s peeling off. Thats what Im looking for.

Looks like a texture mixing. It can be done in a shader or by animating the transparency of material overlay or the second material pass.

PS1 didn’t do multitexture; it was pretty much individual triangles with optional texture coordinates and vertex colors. It didn’t have a depth buffer either, so I imagine what they did was re-render the same scene with different textures plus alpha. On modern hardware, though, @normalized probably has your answer.

Yeah they probably did some hardware-specific retro trickery on PS1. On today’s hardware we don’t need to do any arcane stuff for this type of effect. It’s pretty straightforward.

1 Like

This took me a few days to find some stuff. Click my video.
What Im trying to aim for is that the player walks on the street, then suddenly everything peels off into nightmare effect without having a scene.
I’ve tried the AnimationPlayer, doesn’t seem to switch the textures and not have a peeling effect.
This is what I found: Nightmare GLSL script, while surfing the internet.
I’ve attached it and AnimationPlayer to Meshinstance BoxShape

Even I tried to export GLB from Blender to Godot 4.5, its need Mesh Instance to get attach Nightmare Script… Sigh.

This is what I got GLSL script, its pretty useful.

shader_type spatial;

uniform sampler2D clean_tex;
uniform sampler2D nightmare_tex;
uniform sampler2D noise_tex;

uniform float transition : hint_range(0.0, 1.0) = 0.0;

// Vertex displacement parameters
uniform float peel_height = 0.5;
uniform float peel_frequency = 10.0;

void vertex() {
    float mask = texture(noise_tex, UV).r;
    float peel_factor = mask * transition;

}

void fragment() {
    vec2 uv = UV;
    float mask = texture(noise_tex, uv).r;
    float t = smoothstep(transition - 0.1, transition + 0.1, mask);

    vec3 clean = texture(clean_tex, uv).rgb;
    vec3 nightmare = texture(nightmare_tex, uv).rgb;

    ALBEDO = mix(clean, nightmare, t);
}

However, there is a problem when I played it. It won’t animate in-game.

I also attached another script to Node3D at all way top in the Scene.

WorldController. GLB

extends Node3D

@export var transition_speed := 0.3
@export var camera_shake_strength := 0.08
@export var camera_shake_speed := 20.0
@export var chunk_force := 10.0

var transitioning := false
var shake_time := 0.2

func start_otherworld():
	# Play siren
	$SirenSound.play()

	# Show nightmare props
	for obj in get_tree().get_nodes_in_group("nightmare_objects"):
		obj.visible = true

	# Replace walls with chunks
	for wall in get_tree().get_nodes_in_group("world_walls"):
		wall.visible = false

	for chunk in get_tree().get_nodes_in_group("nightmare_chunks"):
		chunk.visible = true
		# Apply random impulse for “peeling off”
		var direction = Vector3(
			randf_range(-1,1),
			randf_range(0.5,1.5),
			randf_range(-1,1)
		).normalized()
		chunk.apply_impulse(Vector3.ZERO, direction * chunk_force)

	transitioning = true
	shake_time = 0.0

# Animate camera shake + fog
func _process(delta):
	if transitioning:
		# Camera shake
		shake_time += delta
		var player_cam = $Player
		var shake_offset = Vector3(
			sin(shake_time * camera_shake_speed),
			cos(shake_time * camera_shake_speed * 1.2),
			0
		) * camera_shake_strength
		player_cam.transform.origin = shake_offset

		# Fog intensifies
		var fog = $Fog.environment
		fog.fog_density = lerp(0.05, 0.4, shake_time * 0.5)

		# Optional: stop shake after 5s
		if shake_time > 5:
			transitioning = false
			player_cam.transform.origin = Vector3.ZERO

You need to animate the transition shader uniform, using an animation player or a tween.

Isn’t that I already did?

I don’t know. The script code you posted doesn’t touch that uniform and we don’t know what your animation player node is doing or if it even exist.

Silent hill is the most scary game ever and I’m never touching it lol

1 Like

Lol. I know right, but Im planning to make my game more scarier.

1 Like

NO PLEASE SPARE ME (sentence)

1 Like

Just figure em out. Its need AnimationTree Node and its work, but still not peeling effect or transition doing all wrong effect.

Just learned that Blender does have that vfx effect (struggling to get peel right), however, Im trying to export it to GLB to Godot 4.5 along with vfx… Should be fine with AnimationTree and AnimationPlayer nodes.

Wrong in what way?