Replies: 16 comments
-
gltf/scene.gltf is the scene its loading, and its correct but I need this whole whole model to use this aqua_diffuse.png like this |
Beta Was this translation helpful? Give feedback.
-
im just doing in main: fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins);
#[cfg(debug_assertions)]
{
use bevy::diagnostic::FrameTimeDiagnosticsPlugin;
app.add_plugins(FrameTimeDiagnosticsPlugin::default());
}
app.add_systems(Startup, setup);
app.add_systems(Update, camera_movement);
app.run();
} |
Beta Was this translation helpful? Give feedback.
-
and in setup(): fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y),
..std::default::Default::default()
});
commands.spawn(SceneBundle{
scene: asset_server.load("gltf/scene.gltf#Scene0"),
..default()
}); among other lines of code but this is the only ones that refer to the gltf |
Beta Was this translation helpful? Give feedback.
-
please help also, when I try either exporting this, as glb or gltf (with the textures mapped) and I try to load that exported file with the asset_server this is what I get like only the fan gets rendered at least with the correct textures tho but only the fan out of the whole scene/mesh |
Beta Was this translation helpful? Give feedback.
-
also if I try to call for Scene1 instead of Scene0 I get this this is the message from the console output: https://pastebin.com/m1xHr93u |
Beta Was this translation helpful? Give feedback.
-
please let me know how to put textures to this model I am so close to actually mapping the textures but I am not sure how please help |
Beta Was this translation helpful? Give feedback.
-
https://github.com/Xbz-24/Bevy-Sandbox.git this is the code if needed. |
Beta Was this translation helpful? Give feedback.
-
please can someone take a look at why is this not mapping the textures properly? |
Beta Was this translation helpful? Give feedback.
-
I cloned your repo and used this: https://gltf-viewer.donmccurdy.com/ I dropped the entire The viewer shows the same as Bevy: The meshes are there but the textures are not attached. I think it's more likely you are having Blender exporting issues than Bevy issues. My advice then is to figure out the Blender side of things first, validate (with the one I linked or any GLTF validator) that things are working, then try it with Bevy. |
Beta Was this translation helpful? Give feedback.
-
but how do I do that without requiring of blender? |
Beta Was this translation helpful? Give feedback.
-
I dont want to do it in blender, I know this model is not PBR so if I try to use a PBR bundle with the material as the texture of aqua_diffuse.png do you think i twill work? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am loading the emissive png using asset server pub fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
mut window_query: Query<&mut Window, With<PrimaryWindow>>,
) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y),
..std::default::Default::default()
}).insert(Player::default());
let emissive_texture_handle = asset_server.load("assets/gltf/textures/aqua_emissive.png");
let emissive_material = materials.add(StandardMaterial {
emissive_texture: Some(emissive_texture_handle.clone()),
emissive: Color::WHITE,
..default()
});
commands.spawn(SceneBundle{
scene: asset_server.load("gltf/scene.gltf#Scene0"),
..default()
}); for example SceneBundle does not receive a material if I use PbrBundle then it doesnt render at all anything pub fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
mut window_query: Query<&mut Window, With<PrimaryWindow>>,
) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y),
..std::default::Default::default()
}).insert(Player::default());
let emissive_texture_handle = asset_server.load("gltf/textures/aqua_emissive.png");
let emissive_material = materials.add(StandardMaterial {
emissive_texture: Some(emissive_texture_handle.clone()),
emissive: Color::WHITE,
..default()
});
commands.spawn(PbrBundle{
mesh: asset_server.load("gltf/scene.gltf#Scene0"),
material: emissive_material,
..default()
}); |
Beta Was this translation helpful? Give feedback.
-
this is so frustrating please help me fix without blender please |
Beta Was this translation helpful? Give feedback.
-
any updates? |
Beta Was this translation helpful? Give feedback.
-
this is my project structure
Beta Was this translation helpful? Give feedback.
All reactions