Skip to content

Commit 69e2997

Browse files
authored
Update three-d-asset (#510)
* Update three-d-asset * Support advanced mip map settings * Improve texture example with texture settings * Update three-d-asset to 0.8 * Fix texture example on web * Fix texture example on web
1 parent f23beec commit 69e2997

File tree

65 files changed

+290
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+290
-173
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ text = ["swash", "lyon"] # Text mesh generation features
2626
[dependencies]
2727
glow = "0.14"
2828
cgmath = "0.18"
29-
three-d-asset = {version = "0.7"}
29+
three-d-asset = "0.8"
3030
thiserror = "2"
3131
open-enum = "0.5"
3232
winit = {version = "0.28", optional = true}
@@ -51,7 +51,7 @@ instant = "0.1.11"
5151

5252
[dev-dependencies]
5353
rand = "0.7"
54-
three-d-asset = {version = "0.7", features = ["hdr", "gltf", "obj", "vol", "pcd", "png", "jpeg", "http", "data-url"] }
54+
three-d-asset = {version = "0.8", features = ["hdr", "gltf", "obj", "vol", "pcd", "png", "jpeg", "http", "data-url"] }
5555
noise = {version = "0.6", default-features = false}
5656
winit = "0.28"
5757

@@ -118,6 +118,7 @@ path = "examples/sprites/src/main.rs"
118118
[[example]]
119119
name = "texture"
120120
path = "examples/texture/src/main.rs"
121+
required-features = ["egui-gui"]
121122

122123
[[example]]
123124
name = "volume"

examples/animation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
three-d = { path = "../../" }
12-
three-d-asset = {version = "0.7", features = ["gltf", "png", "jpeg", "http", "data-url"] }
12+
three-d-asset = {version = "0.8", features = ["gltf", "png", "jpeg", "http", "data-url"] }
1313

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

examples/animation/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub async fn run() {
2525
0.1,
2626
1000.0,
2727
);
28-
let mut control = OrbitControl::new(*camera.target(), 1.0, 1000.0);
28+
let mut control = OrbitControl::new(camera.target(), 1.0, 1000.0);
2929

3030
// Source: https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0
3131
let mut loaded = if let Ok(loaded) =
@@ -47,8 +47,8 @@ pub async fn run() {
4747
.for_each(|part| part.compute_normals());
4848
let mut model = Model::<PhysicalMaterial>::new(&context, &cpu_model).unwrap();
4949

50-
let light0 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, &vec3(0.0, -0.5, -0.5));
51-
let light1 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, &vec3(0.0, 0.5, 0.5));
50+
let light0 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, -0.5, -0.5));
51+
let light1 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, 0.5, 0.5));
5252

5353
// main loop
5454
window.render_loop(move |mut frame_input| {

examples/assets/checkerboard.jpg

40.9 KB
Loading

examples/environment/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
three-d = { path = "../../", features=["egui-gui"] }
12-
three-d-asset = {version = "0.7",features = ["hdr", "http"] }
12+
three-d-asset = {version = "0.8",features = ["hdr", "http"] }
1313

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

examples/environment/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub async fn run() {
2525
0.1,
2626
1000.0,
2727
);
28-
let mut control = OrbitControl::new(*camera.target(), 1.0, 100.0);
28+
let mut control = OrbitControl::new(camera.target(), 1.0, 100.0);
2929

3030
// Source: https://polyhaven.com/
3131
let mut loaded = if let Ok(loaded) =

examples/fireworks/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn run() {
8888
Srgba::new_opaque(40, 178, 222),
8989
];
9090
let mut square = CpuMesh::square();
91-
square.transform(&Mat4::from_scale(0.6)).unwrap();
91+
square.transform(Mat4::from_scale(0.6)).unwrap();
9292

9393
// A particle system is created with an acceleration of -9.82 in the y direction to simulate gravity.
9494
let particles = ParticleSystem::new(

examples/fog/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
three-d = { path = "../../" }
12-
three-d-asset = {version = "0.7",features = ["obj", "http"] }
12+
three-d-asset = {version = "0.8",features = ["obj", "http"] }
1313

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

examples/fog/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub async fn run() {
3939
.for_each(|m| m.material.render_states.cull = Cull::Back);
4040

4141
let ambient = AmbientLight::new(&context, 0.4, Srgba::WHITE);
42-
let directional = DirectionalLight::new(&context, 2.0, Srgba::WHITE, &vec3(-1.0, -1.0, -1.0));
42+
let directional = DirectionalLight::new(&context, 2.0, Srgba::WHITE, vec3(-1.0, -1.0, -1.0));
4343

4444
// Fog
4545
let mut fog_effect = FogEffect {

examples/forest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
three-d = { path = "../../" }
12-
three-d-asset = {version = "0.7",features = ["obj", "jpeg", "http"] }
12+
three-d-asset = {version = "0.8",features = ["obj", "jpeg", "http"] }
1313

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

0 commit comments

Comments
 (0)