diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a528ed10..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -matrix: - include: - - language: rust - addons: - apt: - packages: - - libasound2-dev - rust: - - stable - # - beta - # - nightly - jobs: - # allow_failures: - # - rust: nightly - fast_finish: true - scripts: - - cargo build --verbose - - language: node_js - node_js: - - lts/* - install: - - npm ci - script: - - npm run build - deploy: - provider: pages - skip_cleanup: true - local_dir: docs/.vuepress/dist - github_token: $GITHUB_TOKEN # A token generated on GitHub allowing Travis to push code on you repository. Set in the Travis settings page of your repository, as a secure variable - keep_history: true - on: - branch: master \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 6535d8a5..1831caf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2870,6 +2870,7 @@ dependencies = [ "image 0.24.0", "log", "pollster", + "reqwest", "tobj 3.2.0", "wasm-bindgen", "wasm-bindgen-futures", @@ -2884,14 +2885,21 @@ version = "0.1.0" dependencies = [ "anyhow", "bytemuck", + "cfg-if 1.0.0", "cgmath", + "console_error_panic_hook", + "console_log", "env_logger", "fs_extra", "glob", - "image 0.23.14", + "image 0.24.0", "log", "pollster", + "reqwest", "tobj 3.2.0", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "wgpu", "winit", ] @@ -2902,14 +2910,21 @@ version = "0.1.0" dependencies = [ "anyhow", "bytemuck", + "cfg-if 1.0.0", "cgmath", + "console_error_panic_hook", + "console_log", "env_logger", "fs_extra", "glob", - "image 0.23.14", + "image 0.24.0", "log", "pollster", + "reqwest", "tobj 3.2.0", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "wgpu", "winit", ] @@ -2920,15 +2935,22 @@ version = "0.1.0" dependencies = [ "anyhow", "bytemuck", + "cfg-if 1.0.0", "cgmath", + "console_error_panic_hook", + "console_log", "env_logger", "fs_extra", "glob", - "image 0.23.14", + "image 0.24.0", "log", "pollster", "rayon", + "reqwest", "tobj 3.2.0", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "wgpu", "winit", ] diff --git a/build-wasm.sh b/build-wasm.sh index e7a6322d..dc2f6efe 100755 --- a/build-wasm.sh +++ b/build-wasm.sh @@ -1,4 +1,4 @@ -(trap 'kill 0' SIGINT; +(trap 'killall background' INT; wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/pong code/showcase/pong & wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial1_window code/beginner/tutorial1-window & wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial2_surface code/beginner/tutorial2-surface & @@ -8,5 +8,7 @@ wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial5_text wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial6_uniforms code/beginner/tutorial6-uniforms & wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial7_instancing code/beginner/tutorial7-instancing & wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial8_depth code/beginner/tutorial8-depth & -wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial9_models code/beginner/tutorial9-models +wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial9_models code/beginner/tutorial9-models & +wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial10_lighting code/intermediate/tutorial10-lighting & +wasm-pack build --out-dir ../../../docs/.vuepress/components/wasm/tutorial11_normals code/intermediate/tutorial11-normals ) diff --git a/code/beginner/tutorial1-window/src/lib.rs b/code/beginner/tutorial1-window/src/lib.rs index ff80406e..77b83fcd 100644 --- a/code/beginner/tutorial1-window/src/lib.rs +++ b/code/beginner/tutorial1-window/src/lib.rs @@ -8,7 +8,7 @@ use winit::{ use wasm_bindgen::prelude::*; #[cfg_attr(target_arch="wasm32", wasm_bindgen(start))] -pub async fn run() { +pub fn run() { cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); diff --git a/code/beginner/tutorial2-surface/src/lib.rs b/code/beginner/tutorial2-surface/src/lib.rs index f6e92b3b..fb890a39 100644 --- a/code/beginner/tutorial2-surface/src/lib.rs +++ b/code/beginner/tutorial2-surface/src/lib.rs @@ -23,7 +23,7 @@ impl State { // The instance is a handle to our GPU // BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU - let instance = wgpu::Instance::new(wgpu::Backends::all()); + let instance = wgpu::Instance::new(wgpu::Backends::GL); let surface = unsafe { instance.create_surface(window) }; let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { diff --git a/code/beginner/tutorial9-models/src/lib.rs b/code/beginner/tutorial9-models/src/lib.rs index f56ab81b..f6d13a69 100644 --- a/code/beginner/tutorial9-models/src/lib.rs +++ b/code/beginner/tutorial9-models/src/lib.rs @@ -596,7 +596,6 @@ pub async fn run() { } // State::new uses async code, so we're going to wait for it to finish - log::warn!("Creating State"); let mut state = State::new(&window).await; event_loop.run(move |event, _, control_flow| { diff --git a/code/intermediate/tutorial10-lighting/Cargo.toml b/code/intermediate/tutorial10-lighting/Cargo.toml index f671dc03..9468fd8f 100644 --- a/code/intermediate/tutorial10-lighting/Cargo.toml +++ b/code/intermediate/tutorial10-lighting/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" authors = ["Ben Hansen "] edition = "2018" +[lib] +crate-type = ["cdylib", "rlib"] + [dependencies] cfg-if = "1" anyhow = "1.0" @@ -22,6 +25,7 @@ default-features = false features = ["png", "jpeg"] [target.'cfg(target_arch = "wasm32")'.dependencies] +reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "0.2" wgpu = { version = "0.12", features = ["webgl"]} diff --git a/code/beginner/tutorial9-models/index.html b/code/intermediate/tutorial10-lighting/index.html similarity index 87% rename from code/beginner/tutorial9-models/index.html rename to code/intermediate/tutorial10-lighting/index.html index 10afb64e..090a79db 100644 --- a/code/beginner/tutorial9-models/index.html +++ b/code/intermediate/tutorial10-lighting/index.html @@ -14,7 +14,7 @@