Activity

Guagyyy

Shipped this project!

Built from the ground up using vanilla JavaScript and WebGL2, this project is a deep dive into the raw math that governs 3D space.

The Hardest Part: Implementing the Z-Fail Stencil Shadow logic. Manually extruding silhouettes from complex geometry and managing the stencil buffer passes required surgical precision in the graphics pipeline to avoid flickering and buffer overflows.

The Best Feature: The Real-Time Level Inspector. It allows you to dynamically inject Point, Spot, and Directional lights into a scene, instantly recalculating volumetric shadows and Gouraud shading on the fly for any imported OBJ model.

Guagyyy

JS-3D Engine is a raw WebGL2 renderer built from scratch to push the limits of vanilla JavaScript. By bypassing high-level libraries, I’ve implemented low-level graphics math usually reserved for C++ engines.

Major Milestones
Z-Fail Stencil Shadows: Implemented “Carmack’s Reverse” to create pixel-perfect volumetric shadows by extruding mesh silhouettes into the stencil buffer.

Quaternion Camera: Built a 6-DOF camera system using quaternions and Gram-Schmidt orthogonalization to ensure smooth, gimbal-lock-free navigation.

Manual Pipeline: Created a custom .obj parser and a CPU-side clipping engine to handle geometry and vertex-normal averaging for high-fidelity lighting.

Integrated Light Manager: Developed a real-time inspector for Point, Spot, and Directional lights, allowing for instant scene manipulation and intensity scaling.

Mesh Loading & Performance
Please note that the initial plane model loaded is single-sided. Since the current lighting and shadow extrusion logic is not optimized for paper-thin, flat planes, lighting artifacts may occur on the reverse side. I strongly encourage users to utilize the OBJ Loader to import manifold 3D geometry; loading complex, solid models is the best way to truly test the engine’s architectural limits and the precision of the volumetric shadow system.

The Vision
The goal is to prove that a modern, feature-rich 3D engine can be lightweight, dependency-free, and highly performant using only the browser’s native capabilities.

Attachment
Attachment
0