Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
03202f4
Update README.md
Aurcereal Nov 6, 2025
8cd36a8
Update README.md
Aurcereal Nov 6, 2025
d9435bc
Update README.md
Aurcereal Nov 6, 2025
29fa499
Initialize WebGPU
Aurcereal Nov 6, 2025
c172bad
WebGPU Device & Adapter Setup
Aurcereal Nov 7, 2025
246a63f
Add GLFW and Include Libraries in SRC for Syntax Highlighting
Aurcereal Nov 7, 2025
91b9ea8
Open Window
Aurcereal Nov 7, 2025
fed1a63
Setup Multi-Source files & Refactor
Aurcereal Nov 7, 2025
ff8b741
GLFW3WebGPU and CMake Modifications
Aurcereal Nov 7, 2025
e21b1fb
Swap Chain Setup
Aurcereal Nov 7, 2025
61cdea8
Draw Solid Window Color
Aurcereal Nov 8, 2025
3a1f497
Use C++ Header
Aurcereal Nov 9, 2025
071ea24
Update main.cpp
Aurcereal Nov 9, 2025
f1c466b
Triangle
Aurcereal Nov 9, 2025
0aae469
Buffer Copy & Read Test
Aurcereal Nov 10, 2025
b50024f
Create test_shader.wgsl
Aurcereal Nov 10, 2025
38df108
Vertex Buffer
Aurcereal Nov 10, 2025
992433b
Second Triangle
Aurcereal Nov 10, 2025
d69eaab
Color Attribute
Aurcereal Nov 10, 2025
3d1079c
Index Buffer
Aurcereal Nov 11, 2025
429a074
Setup Shader Loading Untested
Aurcereal Nov 12, 2025
66e6537
Shader Loading
Aurcereal Nov 12, 2025
1450a48
Time Uniform
Aurcereal Nov 13, 2025
e9662db
Add GLM
Aurcereal Nov 13, 2025
4d78c7d
Fix GLM Integration
Aurcereal Nov 13, 2025
3264497
Multiple Uniforms
Aurcereal Nov 13, 2025
bfb9d37
Add Util
Aurcereal Nov 13, 2025
d828a72
Depth Buffer
Aurcereal Nov 14, 2025
068dd05
Camera Setup
Aurcereal Nov 14, 2025
1a8ea6c
Camera Finish
Aurcereal Nov 14, 2025
accd873
Texture Loading
Aurcereal Nov 14, 2025
654b427
Rendering 3D Texture Slice
Aurcereal Nov 15, 2025
4aa403e
Compute Shader Untested
Aurcereal Nov 16, 2025
adb6d16
Setting up Compute Shader ✈️
Aurcereal Nov 16, 2025
1fa3bc0
Compute Shader Writing to 3D Texture
Aurcereal Nov 16, 2025
f9bcb1b
More 3D Texture Writing & ShaderParameter System Setup
Aurcereal Nov 16, 2025
93ba72f
Setup Mesh Generation Test Compute Shader
Aurcereal Nov 17, 2025
76798c9
Buffer Shader Parameter Untested
Aurcereal Nov 17, 2025
02a6a47
Refactor
Aurcereal Nov 17, 2025
e3f1619
Additional Refactoring, Fix ShaderParameter Construction
Aurcereal Nov 17, 2025
508bf98
Compute Shader Generates Test Geometry
Aurcereal Nov 17, 2025
a8b2692
Atomic Add Generating Mesh in Parallel
Aurcereal Nov 18, 2025
69f54f6
Refactor Compute Shader Mesh Gen
Aurcereal Nov 18, 2025
1b1b44e
Test Lots of Mesh Generation
Aurcereal Nov 18, 2025
9d4e0e1
Wait After Dispatching Compute Shader
Aurcereal Nov 19, 2025
d940c5f
Marching Cubes Working
Aurcereal Nov 19, 2025
b7b78c9
Flat Normals
Aurcereal Nov 19, 2025
2f77754
Marching Cubes Manager Setup
Aurcereal Nov 19, 2025
78bf2e1
Update marching_cubes_manager.h
Aurcereal Nov 19, 2025
2050c5e
Partial Setup
Aurcereal Nov 19, 2025
b22d32e
Use Depth Texture and Shader Class (Before Deletion of Old Code)
Aurcereal Nov 19, 2025
4c44c1b
Delete Old Code
Aurcereal Nov 19, 2025
c985e3c
Smooth Marching Cubes
Aurcereal Nov 19, 2025
6b73e1a
More Marching Cube Manager Skeleton Code
Aurcereal Nov 19, 2025
ec3388e
Switched to R32 Format (Required extra RequiredFeature)
Aurcereal Nov 20, 2025
4d60d0b
Transitioned to MarchingCubes::Manager Class
Aurcereal Nov 20, 2025
6f29145
Delete Old code
Aurcereal Nov 21, 2025
8bb6741
Index Count written to with Compute Shader
Aurcereal Nov 21, 2025
edec964
Copyback Texture Test Working
Aurcereal Nov 21, 2025
01f4197
Test Progressive Mesh Drawing Working
Aurcereal Nov 22, 2025
84affaa
Setup Uniformer Skeleton Code
Aurcereal Nov 22, 2025
a0122f0
Uniform Manager (Tested moving brush)
Aurcereal Nov 23, 2025
0598fd7
Using More Uniforms in Shaders & Subtraction Test
Aurcereal Nov 23, 2025
3d4b778
Test Mouse Move & Click Callback
Aurcereal Nov 23, 2025
0317096
Raycast
Aurcereal Nov 23, 2025
379f997
Untested GPU Raycast BBX Intersect
Aurcereal Nov 24, 2025
8b4e757
Raycast Edits Geometry (Not According to Cursor Position yet)
Aurcereal Nov 24, 2025
8335cd0
Raycast Edits Geometry Correctly (Subtract Brush On)
Aurcereal Nov 24, 2025
08d1d31
Milestone 2 Readme
Aurcereal Nov 24, 2025
cd1b748
Update README.md
Aurcereal Nov 24, 2025
1e94884
Right Click Camera Controls
Aurcereal Nov 25, 2025
708fcf0
Merge branch 'main' of https://github.com/Aurcereal/final-project
Aurcereal Nov 25, 2025
851d81e
Add imgui to project
Aurcereal Nov 25, 2025
444c188
ImGUI Test Window
Aurcereal Nov 25, 2025
f883095
Setup Test Settings
Aurcereal Nov 25, 2025
36122ed
Smooth Shading, UI Option for it, Negative Normal Fix
Aurcereal Nov 25, 2025
8af7655
Delete Old Test Shaders
Aurcereal Nov 25, 2025
ac5355a
Change Marching Cubes Resolution UI
Aurcereal Nov 25, 2025
685a733
Blinn Phong
Aurcereal Nov 25, 2025
8f69708
Fix Normals & Cam Pos From View Mat
Aurcereal Nov 26, 2025
8324e31
Camera Zoom
Aurcereal Nov 26, 2025
a4605c9
Brush Subtract with Alt
Aurcereal Nov 26, 2025
c545661
Smoother Geometry & Cleaner Field On Subtract
Aurcereal Nov 26, 2025
dfdda2c
Can't Draw Near Bounding Box
Aurcereal Nov 26, 2025
b38177d
Brush Size, Power UI Control
Aurcereal Nov 26, 2025
d71b635
Color Changing Brush UI
Aurcereal Nov 26, 2025
aa53262
Disable Controls when Hovering over UI
Aurcereal Nov 26, 2025
2926d79
Brush Sphere is Squished Towards Normal for better drawing
Aurcereal Nov 27, 2025
39c2062
Initialize Object Plane & Log Scale on Brush UI
Aurcereal Nov 27, 2025
290dc1f
Mirror X
Aurcereal Nov 27, 2025
deb2327
Paint Mode
Aurcereal Nov 27, 2025
d7a9ade
Lighting Adjustment & Brush Hardness Option
Aurcereal Nov 27, 2025
93e8d4b
Update marching_cubes_manager.h
Aurcereal Nov 27, 2025
e5d1133
Twirl Setup (Partial)
Aurcereal Nov 28, 2025
777226b
Option for Draw vs Twirl, Draw Shape (Sphere, Cube)
Aurcereal Nov 28, 2025
5c8d38c
Brush Align w/ Normal Toggle
Aurcereal Nov 28, 2025
a611407
Checker, Comb, Cube Comb
Aurcereal Nov 28, 2025
49900fc
Polka Dot (Change Name, doesn't look like it), Sphere Pattern
Aurcereal Nov 28, 2025
e9d8b4b
Allow Twirling Color, Twirling working with Mirror, Reset Draw Parame…
Aurcereal Nov 28, 2025
aca918a
Gyroid Sculpt Texture
Aurcereal Nov 28, 2025
199af24
Paint Textures: Swirly, Polka Dot, Checker
Aurcereal Nov 28, 2025
b106de1
Striped, Circle Pattern, Noisy Paint Texture; Noisy Sculpt Texture
Aurcereal Nov 29, 2025
bd08316
Draw Cone Shape
Aurcereal Nov 29, 2025
3510b97
Star, Triangle, Store Normal only on Mouse Click Option
Aurcereal Nov 29, 2025
0488496
Delete Comment
Aurcereal Nov 29, 2025
26178e3
Fix Twirl with Mirror
Aurcereal Nov 29, 2025
9979989
Separated Polka Dot into Polka Dot and Bumpy (Sculpt Textures)
Aurcereal Nov 29, 2025
dbbd7e4
Lower required limits
Aurcereal Dec 1, 2025
1377f9a
Better polka dot paint texture
Aurcereal Dec 1, 2025
3140f60
Leveled Mode
Aurcereal Dec 1, 2025
b897406
Delete Cubed Mesh Field Sampling, tanh Mesh Field Sampling
Aurcereal Dec 1, 2025
ac0a27c
Voronoi Brush
Aurcereal Dec 1, 2025
892dcd7
Voronoi more dramatic
Aurcereal Dec 1, 2025
7751fa0
Update README.md
Aurcereal Dec 2, 2025
541a03b
Merge branch 'main' of https://github.com/Aurcereal/final-project
Aurcereal Dec 2, 2025
2eb5aee
Editable Light Direction & Smaller Starter Objects
Aurcereal Dec 2, 2025
d5f7c13
Make Starter Sphere Larger, Update README with images
Aurcereal Dec 2, 2025
cf95470
Video and PostMortem
Aurcereal Dec 2, 2025
f458bfd
Twirl into Border Fix & Refactor
Aurcereal Dec 6, 2025
2c6f35a
Buffer Readback Untested
Aurcereal Dec 6, 2025
944ddf1
Buffer Readback Tested & Post Submission ReadME
Aurcereal Dec 7, 2025
35e806b
Lower Texture Resolution (Temp)
Aurcereal Dec 7, 2025
06a09c3
Create Normal Frame on Mouse Raycast Intersection
Aurcereal Dec 7, 2025
a12e1ff
Tracking 2D Offset while Drawing
Aurcereal Dec 7, 2025
74bbfd2
2D Cursor Along Mesh Tracking Showing in Field Update Shader (sp)
Aurcereal Dec 8, 2025
ef75197
Update .gitignore
Aurcereal Dec 8, 2025
9f0814e
Wrap SDF Around Mesh (Brush Orientation)
Aurcereal Dec 8, 2025
a9732c8
Spike Testing
Aurcereal Dec 9, 2025
9ee87cf
Add Spiky Sculpt Brush
Aurcereal Dec 9, 2025
97359f7
Option For Intersection Volume Only Generated On Click
Aurcereal Dec 9, 2025
a493fd0
Spiky Brush Improvements
Aurcereal Dec 10, 2025
a53aa9a
Cylindrical Mirror Mode
Aurcereal Dec 10, 2025
7bbb544
Create cylindricalMirror.png
Aurcereal Dec 10, 2025
c65a1d1
Twirl Cylindrical Mirror Fix
Aurcereal Dec 10, 2025
33a27e8
Showcase Images
Aurcereal Dec 11, 2025
0b598c8
Update README.md
Aurcereal Jan 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
*.mp4
171 changes: 70 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,117 +1,86 @@
# Final Project!

This is it! The culmination of your procedural graphics experience this semester. For your final project, we'd like to give you the time and space to explore a topic of your choosing. You may choose any topic you please, so long as you vet the topic and scope with an instructor or TA. We've provided some suggestions below. The scope of your project should be roughly 1.5 homework assignments). To help structure your time, we're breaking down the project into 4 milestones:

## Project planning: Design Doc (due 11/5)
Before submitting your first milestone, _you must get your project idea and scope approved by Rachel, Adam or a TA._

### Design Doc
Start off by forking this repository. In your README, write a design doc to outline your project goals and implementation plan. It must include the following sections:
## Design Document:

#### Introduction
- What motivates your project?
I plan to create a sculpting tool using marching cubes and WebGPU. I'm motivated to explore marching cubes in a sculpting context and create a fun tool.

#### Goal
- What do you intend to achieve with this project?
I intend to create a simple sculpting tool in WebGPU that can be used on the web.

#### Inspiration/reference:
- You must have some form of reference material for your final project. Your reference may be a research paper, a blog post, some artwork, a video, another class at Penn, etc.
- Include in your design doc links to and images of your reference material.
- [This Terraforming video by Sebastion Lague](https://www.youtube.com/watch?v=vTMEdHcKgM4)
- [This Marching Squares Article by Jamie Wong](https://jamie-wong.com/2014/08/19/metaballs-and-marching-squares/)
- [Astroneer](http://store.steampowered.com/app/361420/ASTRONEER/), a game that makes heavy use of terraforming.

#### Specification:
- Outline the main features of your project.
I plan on the project featuring a draw brush that allows for the creation of geometry as well as a subtract brush that deletes geometry. I hope to have different types of brushes as well. I may also allow the user to use different visual materials.

#### Techniques:
- What are the main technical/algorithmic tools you’ll be using? Give an overview, citing specific papers/articles.
I will almost definitely use marching cubes, but I may use other techniques that I'm not currently aware of.

#### Design:
- How will your program fit together? Make a simple free-body diagram illustrating the pieces.
<img width="484" height="553" alt="image" src="https://github.com/user-attachments/assets/6f7b39cf-6aac-40d7-b936-06c56b3efd62" />

#### Timeline:
- Create a week-by-week set of milestones for each person in your group. Make sure you explicitly outline what each group member's duties will be.
- Week 1: Setup WebGPU, Research Terraforming/Sculpting, Implement Basic Marching Cubes
- Week 2: Finish/fix implementation if necessary, add basic sculpting
- Week 3: Troubleshoot, add UI and a few different brushes
- Week 4: Polish, troubleshoot, test building, and potentially add different visual materials

Submit your Design doc as usual via pull request against this repository.
## Milestone 1: Implementation part 1 (due 11/12)
Begin implementing your engine! Don't worry too much about polish or parameter tuning -- this week is about getting together the bulk of your generator implemented. By the end of the week, even if your visuals are crude, the majority of your generator's functionality should be done.

Put all your code in your forked repository.

Submission: Add a new section to your README titled: Milestone #1, which should include
- written description of progress on your project goals. If you haven't hit all your goals, what's giving you trouble?
- Examples of your generators output so far
We'll check your repository for updates. No need to create a new pull request.
## Milestone 2: Implementation part 2 (due 11/24)
We're over halfway there! This week should be about fixing bugs and extending the core of your generator. Make sure by the end of this week _your generator works and is feature complete._ Any core engine features that don't make it in this week should be cut! Don't worry if you haven't managed to exactly hit your goals. We're more interested in seeing proof of your development effort than knowing your planned everything perfectly.

Put all your code in your forked repository.

Submission: Add a new section to your README titled: Milestone #3, which should include
- written description of progress on your project goals. If you haven't hit all your goals, what did you have to cut and why?
- Detailed output from your generator, images, video, etc.
We'll check your repository for updates. No need to create a new pull request.

Come to class on the due date with a WORKING COPY of your project. We'll be spending time in class critiquing and reviewing your work so far.

## Final submission (due 12/1)
Time to polish! Spen this last week of your project using your generator to produce beautiful output. Add textures, tune parameters, play with colors, play with camera animation. Take the feedback from class critques and use it to take your project to the next level.

Submission:
- Push all your code / files to your repository
- Come to class ready to present your finished project
- Update your README with two sections
- final results with images and a live demo if possible
- post mortem: how did your project go overall? Did you accomplish your goals? Did you have to pivot?

## Topic Suggestions

### Create a generator in Houdini

### A CLASSIC 4K DEMO
- In the spirit of the demo scene, create an animation that fits into a 4k executable that runs in real-time. Feel free to take inspiration from the many existing demos. Focus on efficiency and elegance in your implementation.
- Example:
- [cdak by Quite & orange](https://www.youtube.com/watch?v=RCh3Q08HMfs&list=PLA5E2FF8E143DA58C)

### A RE-IMPLEMENTATION
- Take an academic paper or other pre-existing project and implement it, or a portion of it.
- Examples:
- [2D Wavefunction Collapse Pokémon Town](https://gurtd.github.io/566-final-project/)
- [3D Wavefunction Collapse Dungeon Generator](https://github.com/whaoran0718/3dDungeonGeneration)
- [Reaction Diffusion](https://github.com/charlesliwang/Reaction-Diffusion)
- [WebGL Erosion](https://github.com/LanLou123/Webgl-Erosion)
- [Particle Waterfall](https://github.com/chloele33/particle-waterfall)
- [Voxelized Bread](https://github.com/ChiantiYZY/566-final)

### A FORGERY
Taking inspiration from a particular natural phenomenon or distinctive set of visuals, implement a detailed, procedural recreation of that aesthetic. This includes modeling, texturing and object placement within your scene. Does not need to be real-time. Focus on detail and visual accuracy in your implementation.
- Examples:
- [The Shrines](https://github.com/byumjin/The-Shrines)
- [Watercolor Shader](https://github.com/gracelgilbert/watercolor-stylization)
- [Sunset Beach](https://github.com/HanmingZhang/homework-final)
- [Sky Whales](https://github.com/WanruZhao/CIS566FinalProject)
- [Snail](https://www.shadertoy.com/view/ld3Gz2)
- [Journey](https://www.shadertoy.com/view/ldlcRf)
- [Big Hero 6 Wormhole](https://2.bp.blogspot.com/-R-6AN2cWjwg/VTyIzIQSQfI/AAAAAAAABLA/GC0yzzz4wHw/s1600/big-hero-6-disneyscreencaps.com-10092.jpg)

### A GAME LEVEL
- Like generations of game makers before us, create a game which generates an navigable environment (eg. a roguelike dungeon, platforms) and some sort of goal or conflict (eg. enemy agents to avoid or items to collect). Aim to create an experience that will challenge players and vary noticeably in different playthroughs, whether that means procedural dungeon generation, careful resource management or an interesting AI model. Focus on designing a system that is capable of generating complex challenges and goals.
- Examples:
- [Rhythm-based Mario Platformer](https://github.com/sgalban/platformer-gen-2D)
- [Pokémon Ice Puzzle Generator](https://github.com/jwang5675/Ice-Puzzle-Generator)
- [Abstract Exploratory Game](https://github.com/MauKMu/procedural-final-project)
- [Tiny Wings](https://github.com/irovira/TinyWings)
- Spore
- Dwarf Fortress
- Minecraft
- Rogue

### AN ANIMATED ENVIRONMENT / MUSIC VISUALIZER
- Create an environment full of interactive procedural animation. The goal of this project is to create an environment that feels responsive and alive. Whether or not animations are musically-driven, sound should be an important component. Focus on user interactions, motion design and experimental interfaces.
- Examples:
- [The Darkside](https://github.com/morganherrmann/thedarkside)
- [Music Visualizer](https://yuruwang.github.io/MusicVisualizer/)
- [Abstract Mesh Animation](https://github.com/mgriley/cis566_finalproj)
- [Panoramical](https://www.youtube.com/watch?v=gBTTMNFXHTk)
- [Bound](https://www.youtube.com/watch?v=aE37l6RvF-c)

### YOUR OWN PROPOSAL
- You are of course welcome to propose your own topic . Regardless of what you choose, you and your team must research your topic and relevant techniques and come up with a detailed plan of execution. You will meet with some subset of the procedural staff before starting implementation for approval.

## Milestone 1:

For this milestone, I mostly just setup WebGPU and classes for drawing and using compute shaders with it. Setting up and learning WebGPU took me more time than I expected.

## Milestone 2:

For this milestone, I set up compute shaders for generating and updating the 3D scalar field as well as compute shaders for generating the mesh from the field (marching cubes) and a compute shader for raycasting to the surface. The user can edit geometry with their mouse.

https://github.com/user-attachments/assets/c61c4dfe-7189-4275-b309-5f1b5789c22c

I plan on adding UI for changing the brush size and power, as well as adding color and smooth normals. I plan on having extra operations like mirror, twist around an axis, and sdf-like domain repetition. I'm not sure if I'll have time to add the sdf-like operations for the final submission.

## Final Submission:

### Final Results

[Slideshow Version](https://docs.google.com/presentation/d/1K8j5KwaZzlcoo3jWt414LCfCrM3Et9RGUvkCsfZc7_M/edit?usp=sharing)

#### Overview

[![Final Result](ShowcaseMedia/thumb.png)](https://youtu.be/52YrgT6Ieqk)

The final result is a sculpting tool made with WebGPU and C++. The user is able to use a variety of brushes and operations to sculpt their model. All of the mesh operations are done with compute shaders.

![](ShowcaseMedia/broccoli.png)

#### Implementation Details

The model the user creates is represented by a 3D scalar field in a 3D texture. From the 3D texture, we create a mesh using marching cubes implemented inside a compute shader. Every edit the user makes is to the 3D scalar field, which then changes the mesh generated.

![](ShowcaseMedia/stripey.png)
![](ShowcaseMedia/redCharacter.png)

#### Functionality

Because the model is represented with a scalar field, we can take advantage of SDF-like brushes and operations. The user can use different brush shapes like a sphere, cube, and cone; as well as more procedural shapes like sphere fractal, gyroid, voronoi… etc. There’s also a mirror mode and a twisting brush.

![](ShowcaseMedia/sdflike.png)
![](ShowcaseMedia/voronoi.png)
![](ShowcaseMedia/twirlSpherePattern.png)

#### Possible Future Features

- Brushes & Operations
- A stretching operation that allows the user to click and drag geometry to stretch it.
- Brush that makes pipes/other repeated objects (different types of skin, fur, grass, or fabric)
- Can draw roughness/metallic as well as albedo (maybe PBR)
- Optimizations
- Divide the mesh into 3D chunks and only regenerate the part of the mesh that’s changed.
- Only dispatch the scalar field updating compute shader in places where there’ll be changes.

![](ShowcaseMedia/ralsei.png)

### Post Mortem

I was able to accomplish most of my goals within the timespan. Learning WebGPU took more time than I thought, but setting up the compute shaders took less time than I thought. This project was fun to work on, especially the sculpting and painting brushes.
Binary file added ShowcaseMedia/ant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/broccoli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/cylinderTwirl1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/cylinderTwirl2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/cylindricalMirror.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/milestone2.mp4
Binary file not shown.
Binary file added ShowcaseMedia/mun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/ralsei.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/redCharacter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/sdflike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/spikeRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/spiky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/stripey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/twirlSpherePattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ShowcaseMedia/voronoi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.26100.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
71 changes: 71 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"files.associations": {
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"format": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"memory": "cpp",
"new": "cpp",
"ostream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xutility": "cpp",
"variant": "cpp",
"algorithm": "cpp",
"chrono": "cpp",
"cstdarg": "cpp",
"filesystem": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"iomanip": "cpp",
"optional": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"string": "cpp",
"marching_uniformer": "cpp",
"array": "cpp"
}
}
95 changes: 95 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
cmake_minimum_required(VERSION 3.0...3.25)

project(
LearnWebGPU # name of the project, which will also be the name of the visual studio solution if you use it
VERSION 4.2.0 # any version number
LANGUAGES CXX C # programming languages used by the project
)

if (NOT EMSCRIPTEN)
# Add the 'glfw' directory, which contains the definition of a 'glfw' target
add_subdirectory(glfw)
else()
# Create a mock 'glfw' target that just sets the `-sUSE_GLFW=3` link option:
# Because Emscripten already supports glfw
add_library(glfw INTERFACE)
target_link_options(glfw INTERFACE -sUSE_GLFW=3)
endif()

# Include directories to define targets
add_subdirectory(webgpu)
add_subdirectory(glfw3webgpu)
add_subdirectory(imgui)

set(SOURCE_FILES
main.cpp
application.cpp
webgpu_utils.cpp
resource_manager.cpp
camera.cpp
texture_holder.cpp
compute_shader.cpp
shader.cpp
depth_texture.cpp
marching_cubes_manager.cpp
field_editor.cpp
mesh_generator.cpp
drawer.cpp
uniform_manager.cpp
input_manager.cpp
raycaster.cpp
gui_manager.cpp
gui_to_params.cpp
input_handler.cpp
buffer_helper.cpp)

add_executable(App ${SOURCE_FILES})

option(DEV_MODE "Development helper settings" ON)
if(DEV_MODE)
target_compile_definitions(App PRIVATE
RESOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources"
)
else()
target_compile_definitions(App PRIVATE
RESOURCE_DIR="./resources"
)
endif()

target_include_directories(App PRIVATE .)

target_link_libraries(App PRIVATE webgpu glfw glfw3webgpu imgui)

# Make sure that the .dll file our binary depends on at runtime is copied next to the binary. Unnecessary for Dawn
target_copy_webgpu_binaries(App)

set_target_properties(App PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
COMPILE_WARNING_AS_ERROR ON
)

if (MSVC)
target_compile_options(App PRIVATE /W4)
else()
target_compile_options(App PRIVATE -Wall -Wextra -pedantic)
endif()

# Options specific to Emscripten (for putting on web)
if (EMSCRIPTEN)
set_target_properties(App PROPERTIES SUFFIX ".html")
target_link_options(App PRIVATE -sASYNCIFY)

target_link_options(App PRIVATE
--preload-file "${CMAKE_CURRENT_SOURCE_DIR}/resources"
)

endif()

# Ignore a warning that GLM requires to bypass
if (MSVC)
# Disable warning C4201: nonstandard extension used: nameless struct/union
target_compile_options(App PUBLIC /wd4201)
endif (MSVC)

Loading