Babylon.js-PathTracing-Renderer icon indicating copy to clipboard operation
Babylon.js-PathTracing-Renderer copied to clipboard

Loading gltf failure

Open pcarret opened this issue 4 years ago • 8 comments

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

pcarret avatar Oct 06 '21 06:10 pcarret

@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 avatar Oct 06 '21 13:10 erichlof

@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. :-)

erichlof avatar Oct 06 '21 16:10 erichlof

@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 avatar Oct 06 '21 18:10 pcarret

Hi Erich,

I have followed the discussion on Babylon forum. Thank for that It seems many stuff need to be done to reorganize some part of code (yours and maybe BabylonJs) It seems also I can tweak the BabylonJs exception for a while if I don't care with textures for my first experiments

I'm ok with that. I am trying to find the best way to integrate your pathTracing renderer in an existing Babylon app. Did you write something on this subject on github ?

I have tried @PichouPichou BabylonJS-PathTracing-Renderer https://github.com/nakerwave/BabylonJS-PathTracing-Rendererbut couldn't find the way to make it working

Best regards, Philippe

Le mer. 6 oct. 2021 à 18:58, Erich Loftis @.***> a écrit :

@pcarret https://github.com/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. :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/erichlof/Babylon.js-PathTracing-Renderer/issues/3#issuecomment-936687295, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWV5C6PM2IHGBOLYIGPA23UFR54NANCNFSM5FNVAUCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

pcarret avatar Oct 07 '21 08:10 pcarret

Hi Erich,

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

Best regards, Philippe

pcarret avatar Oct 07 '21 12:10 pcarret

Hi Erich,

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

pcarret avatar Oct 15 '21 07:10 pcarret

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!

erichlof avatar Oct 16 '21 00:10 erichlof

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

pcarret avatar Oct 16 '21 09:10 pcarret