Giter VIP home page Giter VIP logo

easy-gltf's People

Contributors

bjadamson avatar colonelthirtytwo avatar flomonster avatar wolfiestyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easy-gltf's Issues

Tangents are incorrectly normalised

In GLTF the tangents are 4D vectors with W containing either 1 or -1 to denote the tangent space handedness. During loading, easy-gltf normalises the tangent including that "flag" field. This makes the actual direction part of the tangent incorrect and mangles the flag value

Load names

Support for loading the names of the objects would be nice.

Needs a feature flag on the gltf crate.

incorrect index type

The mesh indices are returned as usize, and that makes them unusable as direct GPU input. Indices usually only allow u16 or u32 data formats.

problems with the Vertex type

The provided vertex type isn't repr(C) or Copy, so it's hard to properly feed the data directly to the GPU (fields get shuffled by the compiler). Also it would be nice if it implemented bytemuck's Pod/Zeroable for safe transmuting.

It should look like this:

/// Contains a position, normal and texture coordinates vectors.
#[repr(C)]
#[derive(Clone, Debug, Copy, PartialEq, Default)]
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
pub struct Vertex {
    /// Position
    pub position: Vector3<f32>,
    /// Normalized normal
    pub normal: Vector3<f32>,
    /// Tangent normal
    pub tangent: Vector4<f32>,
    /// Texture coordinates
    pub tex_coords: Vector2<f32>,
}

Also there is no need to use cgmath's Vector types, they could be just arrays like [f32; 4] to avoid the cgmath dependency.

load from slice

Would be convenient to have a function that loads scene from slice instead of only from path.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.