switchbrew / switch-examples

Switch examples for devkitA64 and libnx.
https://devkitpro.org/viewforum.php?f=42
559 stars 100 forks source link

I made a 3D Model Loader for Switch, can you post it to the Samples Folder? #47

Closed niko1point0 closed 5 years ago

niko1point0 commented 5 years ago

https://drive.google.com/file/d/1m39E1kA5oFO9m0E_UXovZx6ebNJPuHSk/view?usp=sharing

I have been experimenting with the SwitchBrew Open Source SDK, and I have a few questions. There are multiple ways where this project could be improved, maybe you can help me. I want this project to be available to everyone, so that people can make Homebrew Switch games.

The SDK has a feature where PNGs are compiled into .o files, and then a .h file is given to access the compiled PNG data

Here I wrote a fully working OBJ loader for Nintendo Switch Right now I use pbr_cube\data\Model\program.pl to convert OBJ model to .h file

I use this command "perl Obj2OpenGL.pl ./gun.obj" and it generates "gun.h", which I rename to "Gun_obj.h"

Here's the problem, I cannot convert the arrays to a compiled .o That means, when I use #include "Gun_obj.h" it has to recompile the data arrays every time Can you find a way to automatically convert the OBJ model into .o and .h in a similar way to how you do it with PNG?

Can you post this in the Samples folder on Github? I give full consent to making this code open source I took your textured_cube sample, and added support for Specular Mapping, and Ambient Occlusion mapping, in addition to diffuse mapping.

Also, in lines 387 - 400 of main.cpp, I have to construct the Vertex array, out of three arrays that OBJ2OpenGL exports. Can you make it so the full Vertex array is generated and compiled before the program launches?

Thank you!

fincs commented 5 years ago

If you have something to contribute, feel free to submit a Pull Request.

niko1point0 commented 5 years ago

I'm not sure how

fincs commented 5 years ago

A good starting point would be this:

https://help.github.com/articles/fork-a-repo/ https://help.github.com/articles/about-pull-requests/

fincs commented 5 years ago

Another thing to add: you might be interested in talking to us directly through IRC (EFnet #switchdev). We can provide help to solve your build system issue before you submit a PR.

niko1point0 commented 5 years ago

I submitted a pull request

niko1point0 commented 5 years ago

It fully works at the moment, but it can be better. I can push again later. How do I use IRC?

fincs commented 5 years ago

I use HexChat.

niko1point0 commented 5 years ago

Is it IRC4Fun, IRCNet, IRCHighWay?

fincs commented 5 years ago

EFnet is the name of the server.

fincs commented 5 years ago

I'm going to close this issue, moving to #48.