Texture colors are being changed #112

Closed
opened 2025-07-24 11:33:18 +00:00 by Poblo0 · 0 comments
Poblo0 commented 2025-07-24 11:33:18 +00:00 (Migrated from github.com)

Describe the bug
When displaying textures the engine is changing the color of them

Screenshots
Image

Image

Original images
Image

Image

Desktop (please complete the following information):

  • OS: Windows 10

Code: (As it is only 41 lines long I've decided to paste it whole)

use blue_engine::{
    prelude::{Engine, ObjectSettings}, primitive_shapes::rectangle, EngineSettings,
};

use std::f32::consts::PI;

fn main() -> Result<(), blue_engine::error::Error> {
    // Create the engine
    let mut engine = Engine::new_config(EngineSettings {
        width: 1280,
        height: 720,
        title: "3D File Explorer",
        ..Default::default()
    }).expect("Unexpectedly, the engine couldn't be initialized");

    rectangle(
        6.0,
        8.0,
        "floor",
        ObjectSettings::default(),
        &mut engine.renderer,
        &mut engine.objects,
    )?;
    let floor = engine.objects.get_mut("floor").expect("Unexpectedly, the 'floor' object wasn't found.");
    floor.set_rotation((-PI/2.0, 0.0, 0.0));
    
    let img_floor = blue_engine::image::open("./assets/BirdieIcon.png").expect("Unexpectedly, the floor image wasn't found.");

    floor.set_texture("floor",  blue_engine::TextureData::Image(img_floor), blue_engine::TextureMode::Repeat, &mut engine.renderer).expect("Unexpectedly, the floor texture couldn't be processed.");

    let radius = 2f32;
    let start = std::time::Instant::now();

    engine.update_loop(move |engine| {
        let camx = start.elapsed().as_secs_f32().sin() * radius;
        let camz = start.elapsed().as_secs_f32().cos() * radius;
        engine.camera.set_position([camx, 2.0, camz]);
    })?;

    Ok(())
}
**Describe the bug** When displaying textures the engine is changing the color of them **Screenshots** <img width="1335" height="787" alt="Image" src="https://github.com/user-attachments/assets/c0d991c9-6924-48a3-ae07-e90d5ba06324" /> <img width="1309" height="771" alt="Image" src="https://github.com/user-attachments/assets/a328c6de-ac47-4b29-ad00-22c0ef561518" /> **Original images** <img width="128" height="128" alt="Image" src="https://github.com/user-attachments/assets/708e397e-4506-4920-913c-a53360d31690" /> <img width="385" height="352" alt="Image" src="https://github.com/user-attachments/assets/f7aef771-a074-46bb-ae71-dcdf2005f77e" /> **Desktop (please complete the following information):** - OS: Windows 10 **Code:** (As it is only 41 lines long I've decided to paste it whole) ``` use blue_engine::{ prelude::{Engine, ObjectSettings}, primitive_shapes::rectangle, EngineSettings, }; use std::f32::consts::PI; fn main() -> Result<(), blue_engine::error::Error> { // Create the engine let mut engine = Engine::new_config(EngineSettings { width: 1280, height: 720, title: "3D File Explorer", ..Default::default() }).expect("Unexpectedly, the engine couldn't be initialized"); rectangle( 6.0, 8.0, "floor", ObjectSettings::default(), &mut engine.renderer, &mut engine.objects, )?; let floor = engine.objects.get_mut("floor").expect("Unexpectedly, the 'floor' object wasn't found."); floor.set_rotation((-PI/2.0, 0.0, 0.0)); let img_floor = blue_engine::image::open("./assets/BirdieIcon.png").expect("Unexpectedly, the floor image wasn't found."); floor.set_texture("floor", blue_engine::TextureData::Image(img_floor), blue_engine::TextureMode::Repeat, &mut engine.renderer).expect("Unexpectedly, the floor texture couldn't be processed."); let radius = 2f32; let start = std::time::Instant::now(); engine.update_loop(move |engine| { let camx = start.elapsed().as_secs_f32().sin() * radius; let camz = start.elapsed().as_secs_f32().cos() * radius; engine.camera.set_position([camx, 2.0, camz]); })?; Ok(()) } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ArkForgeLabs/BlueEngine#112
No description provided.