Open Chargeuk opened 1 year ago
Can you share how that is done imperatively?
Can you share how that is done imperatively?
Sorry for the late reply, was on holiday.
I have create 2 playgrounds to show how I would create the materials in raw Babylon code.
Option 1, provide the materialSetupCallback function to BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh: https://playground.babylonjs.com/#NVAEWD#94 - note that the materialSetupCallbackPbr supports onlyAlphaTesting = true or false appropriately.
Option 2, create the AdvancedDynamicTexture directly and manually apply the material. Note this code path is the same as onlyAlphaTesting = false: https://playground.babylonjs.com/#NVAEWD#95
Hope this helps to illustrate what I mean.
Edit - now that I have come to think about it, exposing a materialSetupCallback on the current AdvancedDynamicTexture component within react-babylon that returns the material to use would also work for me, though I'm not sure it would fit in with the structure you have created...
Sorry - was AFK all long weekend. I feel like there are declarative solutions to both. Also, assignTo
looks like it should allow an array of strings. The only thing about the callback is I don't even have the original createForMesh
- I did add a createForParentMesh
property. The thing about putting materialSetupCallback
is that it would only need to be called with createForMesh and I think I copied the code from that static method. I certainly could call that though - I'm not necessarily against people "newing up" instances, but I think I would encourage a declarative option - that allows the reconciler to track the object and is eligible to prop updates. Even your 'onlyAlphaTesting' can be used to change what is "rendered"...
i'm trying to clear out some outstanding issues. sorry this didn't get looked at properly before. do you have a preferred option to go ahead?
Hi I was attempting to create an Advanced Dynamic texture for GUI elements that uses a PBR rather than standard material. Unfortunately, nesting the advancedDynamicTexture within the pbrMaterial node does not seem to work:
Is this possible? If so, how should it be created? Thanks