webg

maze2 (sci-fi tube edition)

English 日本語

maze2

Overview

maze2 is a walk-through maze with a 4 m wall-center pitch and ceiling height. Structural slopes at the wall/floor and wall/ceiling corners produce an octagonal corridor section. At an L corner, quadrilateral miter bridges connect adjacent rail ends while keeping the opening clear for traversal. Rendering, collision, and radar geometry share the same logical wall boundaries, so doors and junctions remain traversable.

Rendering uses ComputeEffectPipeline. The G-buffer, Deferred Shading, SSR, Bloom, and geometry edge stages share the same CameraFrame finalized by WebgApp immediately before drawing. Each cell has a thin longitudinal ceiling panel centered at y = 3.95m, with a point Local Light for corridor illumination below it at y = 3.70m. The point Local Light illuminates all directions with a radius of 7.2m and an intensity of 5.2, lighting the corridor below while producing a strong direct reflection on the fixture underside about 0.2375m above the light. The structural ceiling uses a roughness of 0.55 to broaden and weaken narrow specular highlights from the point lights. Point lights provide direct lighting with the Shadow Map disabled. Lighting omits geometry occlusion so the corridor and light placement can be inspected. Fixtures use emissive = 0.10. Direct lighting on each underside creates the main high-dynamic-range highlight with specular = 0.80 and roughness = 0.10. White lights account for 60% of cells, while green, orange, and red each account for 13.3%. Up to 64 nearby lights are evaluated. SSR is applied to the floor, walls, slopes, and ceiling. Bloom uses threshold = 0.60, softKnee = 0.40, strength = 1.10, and 1/32 Weight = 0.80, producing a broad glow from the underside HDR reflection. The Shadow Map and SSAO effects remain disabled.

How to Run

webg Features Used

Implementation Flow

main.js builds a 15 by 15 cell maze from a fixed seed, overlays rooms and doors, and finalizes traversable logical wall boundaries. It then creates grouped floor, slope, wall, rail, and ceiling meshes and collision segments from the same boundaries. The radar reads those collision segments, so visible walls, movement constraints, and radar lines are not generated from separate rules.

During each update, input produces first-person movement and CollisionWorld pushes the player cylinder out of wall segments. Nearby lights are selected again only after the camera has moved a configured distance, and at most 64 lights are sent to Deferred Lighting. The HUD and radar use the position after collision resolution.

For rendering, ComputeEffectPipeline.renderScene() uses the cameraFrame received by onBeforeDraw, and encode() receives the same frame in onAfterDraw3d. The completed texture is presented through beginPresentPass() and FullscreenPass, followed by clearDepthBuffer() to restore the depth-enabled HUD pass. Shadow Map and SSAO remain disabled; SSR, Bloom, and geometry edges are enabled according to their settings.

Controls

Verification

Files