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

Support treating 3D objects as 2D layers #22

Open
LunaTheFoxgirl opened this issue Sep 16, 2022 · 0 comments
Open

Support treating 3D objects as 2D layers #22

LunaTheFoxgirl opened this issue Sep 16, 2022 · 0 comments
Assignees
Labels
Enhancement New feature or request
Milestone

Comments

@LunaTheFoxgirl
Copy link
Member

LunaTheFoxgirl commented Sep 16, 2022

A lot of rigging in the VTuber space nowadays tries to emulate 3D using 2D, we can do better than that by allowing 3D models to be seamlessly integrated in to the Inochi2D workflow.

Some highlights of how this should be implemented for future reference

  • glTF loader that discards anything we don't need
  • We have a new 3D Root node type, which contains blendshapes and a range of 3D Object children (1 by default)
  • We have 3D Object children which contains meshes and materials, they can not be moved out of their parent 3D Root.
  • A 3D Object can be split in to a seperate object by mesh, 3D object will inherit any textures it needs to render.
  • Meshes can be moved between 3D Objects and be re-sorted in 2D.
  • Meshes will be deformed to match their 3D Root's blendshape configuration
  • 3D Objects can be used for masking and be masked by rendering them to the stencil buffer or by using the Clip To Lower blending mode.

Rendering Steps is as follows:
For each 3D Object that is sorted in sequence

  1. Enable and clear depth buffer
  2. Render 3D Object(s) and their meshes
  3. Disable depth buffer and continue

Note: 3D Objects will NOT be PBR workflow, we will still take Emission and Normal Map textures from the models, but they will be used for 2D lighting.

Considerations to be made:

  1. Will we support CPU side semi-transparent triangle sorting? (Probably not)

(More will be added as I think of them)

@LunaTheFoxgirl LunaTheFoxgirl added the Enhancement New feature or request label Sep 16, 2022
@LunaTheFoxgirl LunaTheFoxgirl self-assigned this Sep 16, 2022
@LunaTheFoxgirl LunaTheFoxgirl added this to the Post-1.0 milestone Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant