We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Material loaded from separate glTF not applying correctly

Home Forums Programming Material loaded from separate glTF not applying correctly

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #18259
    cboston
    Customer

    Hi,

    I’ve built a configurator app which loads an initial glTF which has all the base geometry and some materials. Because our clients have so many options for chair materials we separated those into other glTF which we load dynamically when a user selects the option. For the most part applying these separately loaded materials seems to work fine but in certain cases it does not. Specifically, the roughness/reflective properties aren’t loading correctly when coming from a referenced glTF file.

    [removed link]

    This example shows the “Target Berry” material initially which was included in the base glTF so the reflection is correct. However if you select the Cornhusk option (which will load the separate Target materials glTF) and then switch back to Berry you can see its lost its reflection.

    The Durathane Brick option has neither its proper relfection or roughness texture.

    Do you have any ideas as to what the issue could be? Please any help would be greatly appreciated as I’m still fairly new to WebGL.

    #18263

    Hi,

    For some reason your gltf files are requested several times. I’m not sure if this might be the reason for that problem, but nevertheless, it looks suspicious. Also you’re using 2.9 which is fairly old version – may be the latest Verge3D will work better?

    If the above does not help, can you reproduce the issue with a simpler standalone application? Just a few puzzles or something like that – and send this project our way via enterprise support mail? It might help us narrow down this issue. Thanks!

    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #18271
    cboston
    Customer

    Thanks for the reply.

    The multiple entries in the Network tab are related to our hosting architecture where the app requests a file from API and it then 301 redirects to the actual file location. I’ve updated that link to temporarily use the direct file url but the issues still occur.

    Previously I posted here asking about if you were able to put the v3d.js on NPM to make it easier to stay up to date. Were you able to do this yet? In the mean time I grabbed the 2.14 version and its now using that.

    We are not using any Puzzles for this app but just directly interacting with your V3d.js library.

    I’m using v3d.GLTFLoader() to load in the separate files. To apply the material I’m using the scene.getObjectByName and then just doing obj.material = newMaterial.

    Is that all correct?

    #18302

    put the v3d.js on NPM to make it easier to stay up to date

    We are still considering this. I’ll consult with the developers to recall the reason why this is not done yet.

    I’m using v3d.GLTFLoader() to load in the separate files. To apply the material I’m using the scene.getObjectByName and then just doing obj.material = newMaterial.

    It’s correct except that instead using the low-level v3d.GLTFLoader, I’d recommend to go with the more convenient loadScene and appendScene methods. Check out the visual_logic.js file of the Load Unload demo for some examples.

    Chief 3D Verger | LinkedIn | Twitter

    #18393
    cboston
    Customer

    My only issue with appendScene is I do not actually want that scene to appear on screen. I just need the materials inside it to be able to apply to the geometry from the original base glTF.

    Looking at what appendScene does however led me to discover the _updateSceneCubeUVEnv function. Simply including that in my loader callback seems to have fixed my issue. Do you see any issue with me calling that directly? Attached a shot of it in context.

    Also, is it possible for me to see the v3d.js source code unminified? I was able to figure out the appendScene logic but it would be nice to see the full code.

    Thanks!

    #18395

    I do not actually want that scene to appear on screen. I just need the materials inside it to be able to apply to the geometry from the original base glTF.

    You can do it as follows: apply your materials to some light-weight geometry such as planes in an appended glTF, and make these planes invisible so that they load hidden. The materials then can be applied using the assign material puzzle as usual.

    Looking at what appendScene does however led me to discover the _updateSceneCubeUVEnv function. Simply including that in my loader callback seems to have fixed my issue. Do you see any issue with me calling that directly? Attached a shot of it in context.

    This is great that it worked for you. However, this is low-level API subject to possible changes in the future so I’d recommend using the same methods that are used behind Puzzles since they are heavily tested by us and by the community.

    Also, is it possible for me to see the v3d.js source code unminified? I was able to figure out the appendScene logic but it would be nice to see the full code.

    Of course, your company is an Enterprise customer. You may download the extended version of Verge3D with the source code of the engine from the dashboard (download access is granted to the same account using which your company purchased the Enterprise license).

    Chief 3D Verger | LinkedIn | Twitter

    #18396
    cboston
    Customer

    Got it, thanks for your help!

    Which dashboard do you mean for finding the source code? The App Manager? I’m not able to find it there.

    #18401

    You’ll find the source code in the src folder of your Verge3D Enterprise bundle, which in turn, can be downloaded using your company’s Enterprise account from this page. Let me know if it is there!

    Chief 3D Verger | LinkedIn | Twitter

    #18434
    cboston
    Customer

    Hey, I’m back :)

    Unfortunately, after I got our model working using the method above I had our 3D artist re-export the chair in the latest 2.14 version from 3DS Max and its caused the “durathane” material to not display at all now. Another concern our artist had is some emission maps he had in there are displaying much more vibrant than the previous version. Seems like maybe somewhere changed with how the saturation works? He previously had exported using 2.11.1

    I’ve tried with the _updateSceneCubeUVEnv solution mentioned above and with using appendScene and both give the same results.

    Any ideas what could be going on?

    [removed link]

    Thanks!

    #18435

    Hi,

    Let’s try to isolate the problem. :) Does the Sneak Peek button shows the same behavior as seen in the app?

    Chief 3D Verger | LinkedIn | Twitter

    #18436
    cboston
    Customer

    The Sneak Peek of just the durathane swatches looks fine as it does by itself in the app:
    [removed link]

    That same durathane glTF looks fine in combination with the 2.11.1 base model
    [removed link]

    Then in combination with the 2.14 model it has the issue
    [removed link]

    I’ve updated the app to use appendScene and without the swatch planes invisible so you can see it to the left of the chair.

    My artist mentioned it could be related to a gamma issue which he is going to look into.

    #18439

    I see. Can you make a quick test? Create a new Standard project with the App Manager. Use you chair model in the main scene so that it loads by default. Finally, use the append scene and assign material puzzles to load your swatches and apply materials to the chair.

    Chief 3D Verger | LinkedIn | Twitter

    #18441
    cboston
    Customer

    I setup a standard project and used the puzzles but unfortunately the same result with the durathane materials.

    On another note, even the materials that work seem to have different brightness from 3DS Max Sneak Peek to the actual exported version. See attached. Although that may be really just be due to some caching as we see it inconsistent between different PCs

    #18464

    Any chance you can share some files with us? You can use the private enterprise support email if you’d like. We’d take a closer look into this.

    Chief 3D Verger | LinkedIn | Twitter

    #18485
    cboston
    Customer

    Just sent it. Thanks!

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.