|
From: Andreas P. <and...@gm...> - 2025-03-17 18:35:00
|
Hi Aaron, That looks good. I noticed that the sword example only uses a diffuse texture. The CommonSurfaceShader and new Material nodes really only provide an improvement over regular Material if additional textures like a normal texture are also provided. Would the exporter provide textures other than diffuse if available in the Maya model ? CommonSurfaceShader supports normal, shininess, and specular textures. -Andreas On Sat, Mar 15, 2025 at 4:52 PM Bergstrom, Aaron <aar...@un...> wrote: > Andreas, > > > > The more I dug into it, the more I realized that it would just be easiest > to check the encoding at the time of export, and write out a > CommonSurfaceShader node instead of the Material node if the encoding was > ‘html’. > > > > So that’s what it does. I changed very little code to make it work… so it > didn’t take me nearly as long as I expected that it would. > > > > See an HTML version of the Sword model exported using RawKee for Maya that > uses a CommonSurfaceShader instead of a Material node. Same URL as before: > > https://vr.csgrid.org/x3dom/swordtest.html > > > > To compare it to what it looks like in Maya, see this screenshot: > > https://vr.csgrid.org/x3dom/maya-screenshot.png > > > > Looks nearly identical to what is displayed in Maya, so I’m pretty happy > with the results. > > > > If you check the HTML source of swordtest.html, you’ll see it uses a > CommonSurfaceShader. > > > > I’m only exporting Material/CommonSurfaceShader for Maya Phong, PhongE, > Blinn, and Lambert shaders. Otherwise the exporter defaults to > PhysicalMaterial nodes for all other Maya shaders no matter the X3D > encoding (XML, VRML, JSON, or HTML). > > > > I need to do a bit of more code work yet to tighten up my PhysicalMaterial > node export, but that doesn’t affect the swordtest.html example using > CommonSurfaceShader. > > > > Aaron > > > > *From:* Bergstrom, Aaron > *Sent:* Friday, March 14, 2025 9:49 AM > *To:* Andreas Plesch <and...@gm...> > *Cc:* x3d...@li... > *Subject:* RE: [x3dom-developers] Maya/RawKee export for X3DOM Material > node > > > > Excellent, I can make that approach work too. > > > > Aaron > > > > > > *From:* Andreas Plesch <and...@gm...> > *Sent:* Friday, March 14, 2025 9:45 AM > *To:* Bergstrom, Aaron <aar...@un...> > *Cc:* x3d...@li... > *Subject:* Re: [x3dom-developers] Maya/RawKee export for X3DOM Material > node > > > > Hi Aaron, > > > > While CommonSurfaceShader would indeed be the basis for an updated > Material node, I do not think that such updating could occur in the near or > medium term future. > > > > So you were right the first time and a CommonSurfaceShader option for > RawKee would be great to have if possible. > > > > Yes, CommonSurfaceShader would be added to the MFNode Appearance.shaders > field. > > > > It is a MFNode field to be able to contain fallbacks, in order of > preference: > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD//Part01/components/shaders.html#Selecting > <https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/shaders.html#Selecting> > > > > I think providing such fallbacks occurs very rarely in practice, and is > perhaps not supported by most x3d browsers. I am not aware of an example. > > > > All the best, -Andreas > > > > On Fri, Mar 14, 2025 at 10:30 AM Bergstrom, Aaron <aar...@un...> > wrote: > > Andreas, > > > > Oops, I misunderstood your email. > > > > I see that you were proposing CommonSurfaceShader as the basis for an > updated Material node. > > > > So change what I just said, for now I will add an export option that > allows the user to select the export type they want to use: > > - Material (old style with textures added to Appearance) > - Material (new style with textures in the material node) > - PhysicalMaterial > > > > Aaron > > > > > > *From:* Bergstrom, Aaron <aar...@un...> > *Sent:* Friday, March 14, 2025 8:59 AM > *To:* Andreas Plesch <and...@gm...> > *Cc:* x3d...@li... > *Subject:* Re: [x3dom-developers] Maya/RawKee export for X3DOM Material > node > > > > Andreas, > > > > Thank you for this. > > > > Based on your feedback, for at least the older shader types in Maya, I’ll > add an export option allowing the user to pick which method they want to > use for exporting a shader, either: > > - Material (old style with textures added to Appearance) > - Material (new style with textures in the material node) > - PhysicalMaterial > - CommonSurfaceShader > > > > It’ll probably take me a few days to re-write that section of the exporter > code, but I should have the change completed by the end of the month. > > > > I would assume that “CommonSurfaceShader” would be added to the “shaders” > field of the Appearance node. However, I see that “shaders” is an MFNode > field. Do you have an example/tutorial of how multiple shaders are used, or > is having multiple shaders not common? Why is “shaders” an MFNode field and > not an SFNode field? > > > > Aaron > > > > *From:* Andreas Plesch <and...@gm...> > *Sent:* Thursday, March 13, 2025 9:16 PM > *To:* Bergstrom, Aaron <aar...@un...> > *Cc:* x3d...@li... > *Subject:* Re: [x3dom-developers] Maya/RawKee export for X3DOM Material > node > > > > Hi Aaron, > > > > It is probably time to support the X3D v.4 Material features but it is not > in the cards in the near term. See > > > > https://doc.x3dom.org/tutorials/lighting/commonSurfaceShaderNode/index.html > > > and > > > https://andreasplesch.github.io/x3dom/test/functional/commonSurfaceShader06.html > > > > for an older x3dom equivalent which is very similar but can only use one > set of texture coordinates. > > > > This would be also the starting point for supporting the new Material > fields if anybody is interested in giving it a try. > > > > Also note that the x3dom PhysicalMaterial is older than X3D v.4 and mostly > intended for glTF inlines. So it does not exactly conform to X3D v.4. I > think for example it directly accepts binary buffers which can be passed to > webgl. > > > > Hope this helps, -Andreas > > > > On Thu, Mar 13, 2025 at 12:04 PM Bergstrom, Aaron <aar...@un...> > wrote: > > I realize that X3DOM supports the ‘PhysicalMaterial’ node, but are there > any plans to update support for the old ‘Material’ node to be X3D 4.0 > compliant? > > > > The new RawKee plugin has 4.0 export support for both the > ‘PhysicalMaterial’ and ‘Material’ nodes. I’m currently exporting Maya > Phong, PhongE, Blinn, and Lambert shadingEngine nodes as 4.0 ‘Material’ > nodes. However, X3DOM doesn’t seem to support the 4.0 texture map features > for the 4.0 ‘Material’ node. > > > > If there is no intent to have X3DOM to support the newer features of the > ‘Material’ node going forward, I will change how I am exporting the Phong, > PhongE, Blinn, and Lambert shaders from Maya. > > > > Thanks, > > > > Aaron > > _______________________________________________ > x3dom-developers mailing list > x3d...@li... > https://lists.sourceforge.net/lists/listinfo/x3dom-developers > > > > > -- > > Andreas Plesch > Waltham, MA 02453 > > > > -- > > Andreas Plesch > Waltham, MA 02453 > -- Andreas Plesch Waltham, MA 02453 |