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

Adding multiple gltf models #11

Open
siddhartpai opened this issue Jan 31, 2018 · 3 comments
Open

Adding multiple gltf models #11

siddhartpai opened this issue Jan 31, 2018 · 3 comments

Comments

@siddhartpai
Copy link

Hi @bwasty I was trying to add an extra default gltf model in the scene, so that i could add reflections for the loaded object rather than a solid color.
Is it possible to somehow add an object to the scene as we do in three.js ?

@bwasty
Copy link
Owner

bwasty commented Feb 3, 2018

I was thinking about how to add/remove objects after initial loading or loading multiple gltf models at the same time a while ago, but didn't come up with a definitive design yet. So far the scene is immutable after loading, so this might require a fair bit of refactoring.

On second thought - since you want reflections, this could also be done with an environment map and the full IBL (Image based lighting) PBR. IBL is already in the shader (since it's based on the reference implementation), but currently unused.

@siddhartpai
Copy link
Author

I meant shadows rather than reflections, and i don't need to edit the scene after loading , I'd rather add a custom object inside the scene before loading .

@bwasty
Copy link
Owner

bwasty commented Feb 23, 2018

As a general feature, I could imagine giving several files as the FILE parameter and then having several roots/scenes in the GltfViewer struct (I thought about getting rid of scene and putting everything in to root -> src). The render loop would then simply iterate the roots and call draw on them.

The first file passed would be the "main" file, because the parameters --cam-index and --scene can't easily refer to multiple files.

Shadows are a topic for themselves - I thought about implementing some standard shadow mapping technique, but only completing glTF support (a large chunk that's still missing is animations -> #3) and IBL.

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

No branches or pull requests

2 participants