Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@


name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
with:
persist-credentials: false

- uses: actions/setup-node@v2-beta
with:
node-version: "15.x"

- uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}

- name: Install and Build 🔧
run: |
npm ci
export NODE_ENV=production
npm run-script build
touch dist/.nojekyll
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
CLEAN: true
64 changes: 64 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

dist/bundle.js
dist/bundle.js.map
Binary file added NoisyPlanet2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# CIS 566 Project 1: Noisy Planets

## Results
![Image1](https://github.com/QennyS/hw01-noisy-planet/blob/master/NoisyPlanet2.gif) \
Live link: https://qennys.github.io/Noisy-Planet/ \
Name: Yilei Li PennKey: 47053708

### Implementation details
#### Biomes
My noisy planet has 5 distinct biomes: **ocean**, **shore**, **forest**, **mountain** and **snow**. The basic idea is classifying biomes based on the height of noise result. I used fbm noise and also iq's warping technique in this case. The highest is
obviously the top, snowy part of a mountain and then mountain itself, forest, etc...

#### Toolbox functions
- `smoothstep`: smoothstep function is used to smoothly blend the color between 2 different biomes.
- `sin`: sin function is used to animate the terrain overtime, including
- the change of noise output
- the height of the snow biome to mimic the changing of seasons
- `bias`: bias function is used to alter the playing curve of the animation of snow biome
- `gain`: gain function is used to alter the playing curve of the animation of the noise output


#### Controls
- `Lambert`: toggle between Lambert and Bilnn-Phong shading mode
- `Octaves`: change the number of octaves in the noise function used in terrain generation
- `Frequency`: change the frequency of in the noise function used in terrain generation
- `Bias`: add bias to the animation (0.5 as the linear playing rate)
- `Height`: change the height of the terrain above ocean
- `Speed`: change the speed of animation (0 as stationary)


#### Sources
- [iq's warping technique](https://www.iquilezles.org/www/articles/warp/warp.htm)

## Objective
- Continue practicing WebGL and Typescript
- Experiment with noise functions to procedurally generate the surface of a planet
Expand Down
20 changes: 20 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<title>Project 0: Getting Started | CIS 566</title>
<style>
html, body {
margin: 0;
overflow: hidden;
}
#canvas {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<script type="text/javascript" src="bundle.js"></script>
</body>
</html>
Loading