A 3D rendering project featuring an iconic Coca-Cola contour bottle, implemented with both native Metal (macOS) and WebGPU (browser) support.
- 🍾 Detailed 3D Coca-Cola Bottle - Classic contour shape with authentic label design
- 🎨 High-Quality Label - Sharp, detailed label with ribbon patterns, borders, and color gradients
- 💻 Native Metal Rendering - C++ Metal implementation for macOS
- 🌐 WebGPU Browser Rendering - Modern web graphics API support
- 📦 3D Model Export - Export to OBJ, glTF/GLB formats (convertible to FBX)
cube-project/
├── main.cpp # Native Metal C++ renderer
├── definitions.metal # Metal shader code
├── Makefile # Build configuration
├── web/ # WebGPU browser version
│ ├── index.html # Main web page
│ ├── cube.js # WebGPU rendering logic
│ └── test-webgpu.html # WebGPU compatibility test
├── web-server/ # HTTP streaming server
└── README.md # This file
- macOS with Metal support
- Xcode Command Line Tools
- C++ compiler
make
./cube- Modern browser with WebGPU support:
- Chrome 113+ / Edge 113+
- Safari 16.4+
- Firefox (experimental)
- Open
web/index.htmlin a WebGPU-compatible browser - Or serve via a local web server:
cd web python3 -m http.server 8000 # Then visit http://localhost:8000
- Real-time 3D rotation
- Detailed Coca-Cola label with:
- White border stripes
- Dynamic ribbon wave pattern
- Gold accent lines
- Text area zone
- Export to OBJ, glTF/GLB formats
The web version includes export buttons:
- Export OBJ - Universal 3D format
- Export glTF - Modern web standard (preserves vertex colors)
- Export FBX - Instructions for converting via Blender/Maya
- Export glTF from the web interface
- Import
.glbfile into Blender - Export as FBX from Blender
- Metal Shaders: MSL (Metal Shading Language)
- WebGPU Shaders: WGSL (WebGPU Shading Language)
- Matrix Math: Column-major matrices
- Geometry: Procedurally generated bottle with 64 segments
- Label Detail: 20+ rings in label area for sharp definition
This project is for educational purposes.