Giter VIP home page Giter VIP logo

Comments (9)

Foxar avatar Foxar commented on May 18, 2024 1

The way I understand this:

Render "no-texture" texture if texture is described in .obj, but texture loading failed.

  1. Load the obj file, load the texture name from inside of it.
  2. If it's missing (no usemtl texture), load default texture name ( "missingtex" for instance).
  3. If AddByMesh fails to find texture, (no texture.png found), instead default to loading missingtex.

Add new feature, which will enable 2D / 3D rendering without textures (new issue -> enhacement?).

Agreed, we can add a boolean value in loaders if they should expect or not material data. If we take an example of obj_loader: here

from tyra.

Foxar avatar Foxar commented on May 18, 2024

So far I've thought of these:

  • Basic material loading from .mtl file.

  • Default texture for .obj models, if no texture specified

  • Error message improvements (if loading failed, why? where exaclty?)

from tyra.

h4570 avatar h4570 commented on May 18, 2024
  • Default texture for .obj models, if no texture specified

Good point. I think that will be good idea to perform PRINT_ERR() (future assert()) on vt (texture data), vn (normal vector) and 2x on f (faces), if they are triangulated and all values are present.

from tyra.

Foxar avatar Foxar commented on May 18, 2024

How is using PRINT_ERR() on those values going to provide a default texture for a model? I was hoping to allow the engine to load a model and use some default texture (solid white color, or green and black squares tileset like in source games) to signify failure to load the texture for the model, without grinding the entire .elf executable to a halt.

Image for reference:
main-qimg-d3c394175ea164074ff37d70b1f62a66

from tyra.

Foxar avatar Foxar commented on May 18, 2024

I've changed my original TO-DO to specify that the ".mtl loading" should be for basic materials only, such as solid colors/gradients. This is because .mtl files themselves only designate a filename for textures, which seems redundant to have considering the current way TextureRepositories and png/bmp loaders work.

I'd like opinion on this and if you have any other suggestions for improvements to obj_loader, please add them. @h4570

from tyra.

h4570 avatar h4570 commented on May 18, 2024

Hmm.

My thought with PRINT_ERR() was, to just check if texture data is present (assert()) and print error if not.

This is pretty good idea, regarding the "no-texture" texture, we can generate this tex in c++ as well.
But yesterday I did small investigation there, and I see that we will MUST add non-texture meshes support.
For example yesterday I downloaded christmas tree .obj file, which has texture for tree, and only colors for christmas balls. Texture and colors was described in .mtl file.

My point of view is:

  • Render "no-texture" texture if texture is described in .obj, but texture loading failed.
  • Add new feature, which will enable 2D / 3D rendering without textures (new issue -> enhacement?).

What do you think?

from tyra.

Foxar avatar Foxar commented on May 18, 2024

I'd like to note here that recently we've commited some changes to objloader, allowing to load without complete set of Vectors Normals and UVmaps, however it is unlikely to render properly. As such this issue is on hold until we resolve #66

from tyra.

Foxar avatar Foxar commented on May 18, 2024

Tomorrow I'd like to look into this issue, testing to see the rendering behavior of models without Normals or UVMaps, as I understand that #66 has been fixed.

from tyra.

h4570 avatar h4570 commented on May 18, 2024

Resolved.
Tyra 2.0.0 uses tinyobjloader

from tyra.

Related Issues (20)

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.