Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Issues with OBJ loading / Rendering #37

Open
0x8080 opened this issue Feb 21, 2018 · 20 comments
Open

General Issues with OBJ loading / Rendering #37

0x8080 opened this issue Feb 21, 2018 · 20 comments

Comments

@0x8080
Copy link

0x8080 commented Feb 21, 2018

  • Attempting to load non-existent OBJ results in LPP crashing
  • Buggy Rendering on some Textures
  • Won't render OBJ sub-meshes (individual parts have to be exported into a separate mesh)
@Rinnegatamante
Copy link
Owner

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
Copy link
Author

0x8080 commented Feb 21, 2018

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

@0x8080
Copy link
Author

0x8080 commented Feb 21, 2018

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
Copy link
Owner

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
Copy link
Author

0x8080 commented Feb 21, 2018

Can't wait to see that!

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

@Rinnegatamante
Copy link
Owner

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

@0x8080
Copy link
Author

0x8080 commented Feb 21, 2018

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

@0x8080 0x8080 changed the title Failing to load OBJ results in crash General Issues with OBJ Feb 21, 2018
@0x8080 0x8080 changed the title General Issues with OBJ General Issues with OBJ loading / Rendering Feb 21, 2018
@Rinnegatamante
Copy link
Owner

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

@0x8080
Copy link
Author

0x8080 commented Feb 21, 2018

Yes

@0x8080
Copy link
Author

0x8080 commented Feb 21, 2018

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
Copy link
Author

0x8080 commented Feb 25, 2018

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
Copy link
Owner

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

@0x8080
Copy link
Author

0x8080 commented Feb 25, 2018

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

@Rinnegatamante
Copy link
Owner

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

@0x8080
Copy link
Author

0x8080 commented Feb 25, 2018

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

@0x8080
Copy link
Author

0x8080 commented Feb 25, 2018

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

@Rinnegatamante
Copy link
Owner

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
Copy link
Author

0x8080 commented Feb 25, 2018

ah, thanks.

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

@0x8080
Copy link
Author

0x8080 commented Feb 25, 2018

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
Copy link
Author

0x8080 commented Feb 25, 2018

image
image
image
image

Confirmed issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants