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
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ path = "examples/multiwindow/src/main.rs"
[[example]]
name = "logo"
path = "examples/logo/src/main.rs"

[[example]]
name = "heightmap"
path = "examples/heightmap/src/main.rs"
required-features = ["egui-gui"]
9 changes: 9 additions & 0 deletions examples/assets/attribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Asset Attribution

| Asset | Source |
|----------------------|-----------------------------------------------------|
| /textures/brick/* | https://freepbr.com/product/alley-brick-wall-pbr/ |
| /textures/concrete/* | https://freepbr.com/product/broken-down-concrete-2/ |
| /textures/metal/* | https://freepbr.com/product/alien-abstract-metal/ |

All assets used under non-commercial terms and fair use doctrine.
Binary file added examples/assets/textures/brick/brick_albedo.jpg
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 examples/assets/textures/brick/brick_ao.jpg
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 examples/assets/textures/brick/brick_height.jpg
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 examples/assets/textures/brick/brick_metallic.jpg
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 examples/assets/textures/brick/brick_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 examples/assets/textures/metal/metal_albedo.jpg
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 examples/assets/textures/metal/metal_ao.jpg
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 examples/assets/textures/metal/metal_height.jpg
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 examples/assets/textures/metal/metal_metallic.jpg
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 examples/assets/textures/metal/metal_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions examples/heightmap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "heightmap"
version = "0.1.0"
authors = ["Asger Nyman Christiansen <asgernyman@gmail.com>"]
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
three-d = { path = "../../" }
three-d-asset = {git = "https://github.com/asny/three-d-asset", features = ["png", "jpeg", "http"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
log = "0.4"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
console_error_panic_hook = "0.1"
console_log = "1"
19 changes: 19 additions & 0 deletions examples/heightmap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#![allow(special_module_name)]
mod main;

// Entry point for wasm
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen(start)]
pub async fn start() -> Result<(), JsValue> {
console_log::init_with_level(log::Level::Debug).unwrap();

use log::info;
info!("Logging works!");

std::panic::set_hook(Box::new(console_error_panic_hook::hook));
main::run().await;
Ok(())
}
Loading