Comments (9)
The way I understand this:
Render "no-texture" texture if texture is described in .obj, but texture loading failed.
- Load the obj file, load the texture name from inside of it.
- If it's missing (no
usemtl texture
), load default texture name ( "missingtex" for instance). - 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
tyra/src/engine/loaders/obj_loader.cpp
Line 73 in d58163d
from tyra.
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.
- 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.
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.
from tyra.
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.
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.
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.
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.
Resolved.
Tyra 2.0.0 uses tinyobjloader
from tyra.
Related Issues (20)
- Add support for PS2 fog
- MD2 Loader refactor
- Add z-index to Sprite
- Fix z-buffer issue in debug 3D rendering
- [Tyrav2]Port the formats from tyrav1 to v2 HOT 2
- [OBJ] Get texture names from .mtl file instead of material name.
- Problem with `SifLoadModule()`, PS2Link not work
- Cross platform with x86 architecture HOT 3
- Memory leak in static renderer when using PipelineFrustumCulling_Simple
- Soft reset is breaking PS2link connection. HOT 3
- tyra not working only on real hardware
- Tutorials and demos not working on emulator and in real ps2 HOT 9
- Can you make a exe compiled version ??? HOT 1
- Tasks.json - Copy source code to docker volume causes "syntax error" error.
- VCL PROBLEM LINK HOT 2
- 576i@50hz support HOT 1
- Glitched texture on skybox
- Tracking real hardware support HOT 5
- Intellisense package does not contain sprite.offset HOT 2
- Docker image / PS2SDK update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tyra.