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

Loading gltf failure #3

Open
pcarret opened this issue Oct 6, 2021 · 8 comments
Open

Loading gltf failure #3

pcarret opened this issue Oct 6, 2021 · 8 comments

Comments

@pcarret
Copy link

pcarret commented Oct 6, 2021

Hi Erich,

Thanks for your tremendous work
I have an error message when loading a "simple" gltf file with two files :
babylon.js:16 BJS - [08:42:31]: Unable to load assets from https://raw.githubusercontent.com/pcarret/assets/master/alk/twoParts-opaque.gltf: Error in onSuccess callback (Cannot merge vertex data that do not have the same set of attributes)

function loadModel()
{
	modelNameAndExtension = "twoParts-opaque.gltf";
	BABYLON.SceneLoader.LoadAssetContainer("https://raw.githubusercontent.com/pcarret/assets/master/alk/", 
        modelNameAndExtension, pathTracingScene, function (container)
..
}

This gltf is correctly loaded in Babylon
Any help iwould be welcome

@erichlof
Copy link
Owner

erichlof commented Oct 6, 2021

@pcarret

Hi, sorry you are having trouble loading your gltf file into the path tracer. I will definitely take a look, and if I can't figure it out, I will forward this issue over to the Babylon.js path tracing forum thread. Over there are gltf experts ready and willing to come to the rescue! 😉

I'm afraid one of my many programming weaknesses is gltf loading and gltf data processing. I was so excited to just get the path tracing of gltf working in the beginning (ha), but I knew that my code is not robust and I knew there would be cases like yours in the future that don't fit my simple gltf processing scheme.

I will say this though, I think it is possible what you're trying to do: with my original three.js pathtracing renderer, I was able to combine multiple gltf models into 1 bigger model, and then path trace the whole thing as a unit. I used three.js' 'mergeBufferGeometry' utility when these cases came up, and it would magically squash all the separate gltf components, no matter how many there are (could be dozens or hundreds). I can't seem to locate the Babylon.js equivalent, but hopefully we can get some help from the Babylon.js experts.

One more note: take a look at my three.js pathtracing renderer GitHub page and find the 'gltf Viewer' demo, that was contributed by a second person, other than myself. He seems to be able to do what you're wanting to do with the three.js renderer version, in that his large apartment model starts out as dozens of smaller gltf models, each with their own vertex attributes, but then somehow get squashed into one large 'apartment' file for path tracing purposes.

The way my triangle BVH acceleration structure is set up, at the moment you can have only 1 large merged gltf model by the time it is sent down the pipeline to the path tracer. Handling multiple gltf models and ray tracing with different tiers of acceleration structures (like NVIDIA does with their proprietary technology) but in webgl and the browser would be very challenging and is a possible project for the future - hence the requirement to merge gltf component files into 1 final resulting model.

Will be back with more info on your issue.

-Erich

@erichlof
Copy link
Owner

erichlof commented Oct 6, 2021

@pcarret

As a follow-up, I just now forwarded your issue to the Babylon.js forum/team.
https://forum.babylonjs.com/t/path-tracing-in-babylonjs/11475/189

Hopefully someone there will be able to understand the error message and spot the problem. Once I know what is wrong, I can start working on making the loading code more robust for a wider array of glTF use-cases.

Will report back with any findings. :-)

@pcarret
Copy link
Author

pcarret commented Oct 6, 2021

@erichlof
Hi Erich,

Many thanks for your answers. I hope you will get some help from Babylon experts
Your work is amazing. I hope I will be able to integrate it in my future app. It seems it will be integrated in Babylon directly but I have no clue if any information is available on a "release". I saw a sample was done by pichoupichou in Typescript but O was unable to make it working.

@pcarret
Copy link
Author

pcarret commented Oct 7, 2021 via email

@pcarret
Copy link
Author

pcarret commented Oct 7, 2021

Hi Erich,

Would it be possible for you to send me the src code of this :
image

Best regards,
Philippe

@pcarret
Copy link
Author

pcarret commented Oct 15, 2021

Hi Erich,

Do you think reading the texture data from babylon gltf import will be possible ?

@erichlof
Copy link
Owner

Hi @pcarret ,
Sorry I got a little side-tracked with that RTX 3090 issue over on the Babylon forum. And then I've had to tend to some other things going on in life (ha). I promise I'll take a look at this for you very soon!

@pcarret
Copy link
Author

pcarret commented Oct 16, 2021

That will be Fantastic if PathTracing can handle textures !
I saw the discussion about the RTX 3090. Seems Chrome has a memory issue versus Firefox.

For curiosity, you can check this link where I tried a webgl renderer

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