Rinnegatamante / lpp-vita

Lua Player Plus for PSVITA. Documentation on: http://rinnegatamante.github.io/lpp-vita/
GNU General Public License v3.0
175 stars 27 forks source link

General Issues with OBJ loading / Rendering #37

Open 0x8080 opened 6 years ago

0x8080 commented 6 years ago
Rinnegatamante commented 6 years ago

OBJ loading code is totally messed up, i recognize this. Be sure to properly use Blender to create compatible OBJ files as of now that can be read by lpp-vita. (How to adapt a model here: http://wololo.net/talk/viewtopic.php?p=419144)

0x8080 commented 6 years ago

Its only an issue when you point to a non existing OBJ, then the whole program will crash (no console output).

0x8080 commented 6 years ago

On another note, only 1 mesh in a model will render so all models with multiple meshes have to be split which becomes very tedious over time.

Also, is it possible for you to implement support for binding meshes to a skeleton / joint? This would make animations a lot easier than using key-frame animations.

Rinnegatamante commented 6 years ago

I have plans to just switch to vitaGL once ready with all the benefits it will gives (custom shaders, lights, fogging, more supported primitives, etc).

I don't plan to make upgrades to the current Render module until this switch will be performed.

0x8080 commented 6 years ago

Can't wait to see that!

However how much overhead does using LPP create compared to just using C++ in an ideal senario?

Rinnegatamante commented 6 years ago

Didn't run proper tests but it probably strongly depends on the kind of code being run.

0x8080 commented 6 years ago

Bugged:

2018-02-21-150307 2018-02-21-150352 2018-02-21-150343 2018-02-21-150318

Correct:

image image image

Textures are buggy too.

Correct versions are rendered in Blender

Rinnegatamante commented 6 years ago

Have you followed the instructions i provided in the link above to generate the model?

0x8080 commented 6 years ago

Yes

0x8080 commented 6 years ago

I've made sure all the models I exported only used Tris and that there is no materials.

Separating a model is tedious but at least it works.

The textures load fine (top right corner) but are rendered incorrectly, I'll and see if I can fix it.

0x8080 commented 6 years ago

image

I've managed to get images to display behind a model but I get horrible flickering.

Any solution?

`while true do

Graphics.initBlend()
Screen.clear(black)

drawScaledImage(menu[menuName].Image.Background, 0, 0, 960, 544)

Graphics.termBlend()

Graphics.initBlend()

renderMenu(menuName)
navMenu() -- Includes some 3D stuff

Graphics.termBlend()
Screen.flip()

end`

Rinnegatamante commented 6 years ago

You must not do two Blend instances for 3D and 2D. Same blend instance should be used for both 2D and 3D elements.

0x8080 commented 6 years ago

Noted. Is there a proper way for me to render 3D models on top of 2D images?

Rinnegatamante commented 6 years ago

2d images are always rendered with z = 0.5f so you should set your models accordingly.

0x8080 commented 6 years ago

Ah. I'll just see if I can branch LPP and make is so that I can change the Z axis.

0x8080 commented 6 years ago

image Never-mind, rescaling the models for now is easier

Rinnegatamante commented 6 years ago

It's not really related to lpp. It's related to vita2d. When lpp-vita will switch to vitaGL, we will be able to manage this aspect too.

0x8080 commented 6 years ago

ah, thanks.

Also, when LPP get's VitaGL will there be fixes for OBJs?

0x8080 commented 6 years ago

image image image

These UV maps are expecting that the texture is "repeated infinitely" (like PUs in Super Mario 64) so LPP is mapping a wrong part of the texture to the UV that's "out of bounds"?

0x8080 commented 6 years ago

image image image image

Confirmed issue