Author Topic: How to export Corona material 3d's to a glb format  (Read 4322 times)

2023-08-01, 19:52:01

BlueAlienArts

  • Users
  • *
  • Posts: 2
    • View Profile
Hi everyone! Its my firts post here.
Soo I'm trying to export a 3d i have in max with corona materials in it, as a "GLB" format so i can use in VR..
but corona materials r not supported in those.

Someone knows if there is a way to make it work?
like some plugin or script...


2023-08-01, 20:14:19
Reply #1

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
You need to convert your materials to glb format first:
https://help.autodesk.com/view/3DSMAX/2023/ENU/?guid=GUID-7ABFB805-1D9F-417E-9C22-704BFDF160FA

Or the way I do it (since I havent updated to 3dsmax 2023) is use my script to convert vray materials (not corona) to standard, export to blender then export to glb. Note if you are exporting from vray you need to be working in the roughness workflow, not glossiness.:
https://github.com/jmdvella/3dsmax-scripts/blob/main/JV_VrayRoughnessToFBX.ms




2023-08-01, 20:54:59
Reply #2

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
You can use this script to convert Corona physical materials to Autodesk physical and then use 3ds Max built-in converter to convert Autodesk physical to GLB material. That last step is optional, since 3ds Max can export its own physical material to GLB without issues.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-01, 20:59:11
Reply #3

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
haha or that one, romullus probably has more experience using the latest version of 3dsmax. Jeez I should just upgrade at this point I feel like I'm missing out! :D

Not to hijack the thread but genuinely curious, I can install 3dsmax 2024 as well (since Autodesk keeps bugging me) but I remember in the past it screwed up my 3dsmax 2021 thumbnails, is this still the case or can I install it along side 2021 without issues romullus?

2023-08-01, 22:47:01
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
No issues with thumbnails on my side, but i have only Max 2023 and 2024 at the moment. To be honest, last time i had troubles with MAX files thumbnails, was probably with Max 7-9 and Windows XP, or something like that.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-02, 13:14:19
Reply #5

BlueAlienArts

  • Users
  • *
  • Posts: 2
    • View Profile
tnks guys, u i was on a week trying to find a pluging for it haha.

about the thumbnail's issue, i didn't see those but every time max update it's a new wonderful wave of bugs.

2023-08-02, 14:43:15
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
[..] but every time max update it's a new wonderful wave of bugs.

Couldn't agree more.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-03, 18:48:31
Reply #7

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
No issues with thumbnails on my side, but i have only Max 2023 and 2024 at the moment. To be honest, last time i had troubles with MAX files thumbnails, was probably with Max 7-9 and Windows XP, or something like that.

So I installed 3dsmax 2024, and yeah as I was worried I cant open 2021 as default lol... I had a feeling this would happen.

When selecting 3dsmax 2021 as default it automatically switches this back to 3dsmax 2024. :(

Do you know a workaround? Same thing happens in windows 11 settings > default apps > choose defaults by file type

3dsmax" border="0

I also lost both my thumbnails 3dsmax 2021 and 2024 =:::( After restarting my 3dsmax 2021 still has no icon, 3dsmax2024 icon is fine.... Oh man!
thumbs" border="0

« Last Edit: 2023-08-03, 19:19:04 by James Vella »

2023-08-04, 11:10:00
Reply #8

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
Not corona related, and not sure if I should put this in a new thread but curious rommulus. Do you use ORM textures for GLB files? I have 2 issues, the first is

Physical material:
I cant find a slot for the ambient occlusion. So this leads me to my second question.

glTF material:
When using standard bitmaps it works as expected. When using ORM texture (R/G/B split for occlusion/rough/metal) I cant use an RGB Tint or Colorcorrect to split the channels to use one texture for all 3. It doesn't accept nodes between the bitmap and material. I also tried the PBR material and found the same issue.

RGB Tint split (doesnt work):
gltf-tint" border="0

RGB split using Output curves in bitmap (doesn't work either, it messes up the rough/metal channels):
gltf-q" border="0

Strangely enough I can do all these functions in blender but I would prefer to update my pipeline to work with 3dsmax gltf exporter... but so far it seems like splitting channels just doesnt work as expected.

2023-08-04, 11:59:20
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
No, i don't pack textures into channels, i leave this job for exporters to deal with, but i noticed that GLB file exported from 3ds Max and then imported to Sketchfab quite often leads to messed up result and i have to re-import my own textures and rebuild the material. IMO glTF should be well defined standard, but as usual everyone feels that they need to interpret and implement things in their own way which is not fully compatible with other implementations. In general i don't trust Autodesk glTF exporter and only use it when there's no other easy options.

P.S. sorry, i can't help you with the 3ds Max file icons and defaults conundrum, other than to say that this doesn't surprise me much - every single product from Autodesk and Microsoft that i've ever used are full of bugs :[
« Last Edit: 2023-08-04, 12:04:31 by romullus »
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-04, 12:10:43
Reply #10

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
No, i don't pack textures into channels, i leave this job for exporters to deal with

You are referring to the exporter in the software correct?

but i noticed that GLB file exported from 3ds Max and then imported to Sketchfab quite often leads to messed up result

Yes me too, which is why Ive been using blender for the past few years to export to GLB, it always gets the all channels correct.

and i have to re-import my own textures and rebuild the material.

where do you import/rebuild the material?

IMO glTF should be well defined standard, but as usual everyone feels that they need to interpret and implement things in their own way which is not fully compatible with other implementations.

What do you mean, its fairly standard right? As long as the glb has all the intended channels the person who downloads/uses that glb file should be able to enable/disable any channel they choose if it doesn't fit their workflow. What implementations are you referring to?

This is also why I dont want to use the Physical material since I would have to bake the AO into the Base Color, I prefer the customer has the option to switch off or replace the AO if they need to.

In general i don't trust Autodesk glTF exporter and only use it when there's no other easy options.

I'm coming to this conclusion myself. I thought 3dsmax 2024 would have this sorted out by now and it was just my error. I'm starting to think its not fully functional (or atleast compatible with basic nodes or OSL functions which work perfectly fine in blender for example).

P.S. sorry, i can't help you with the 3ds Max file icons and defaults conundrum, other than to say that this doesn't surprise me much - every single product from Autodesk and Microsoft that i've ever used are full of bugs :[

Thanks, I did it the old school way in the end, filestypeman is a portable software that lets you switch defaults/icons manually and hardcodes it back into windows. I prefer using built-in windows when possible but I just dont think its possible without editing the registry, rather just use filestypeman which does the same thing in a user friendly way.

2023-08-04, 17:02:29
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
You are referring to the exporter in the software correct?

Yes, in this particular instance i was referring to 3ds max exporter.

Quote
Yes me too, which is why Ive been using blender for the past few years to export to GLB, it always gets the all channels correct.

I would love to use the Blender for this too, but i find Blender's shading editor so alien and cumbersome to use, that i abandoned that idea after couple tries. And in general my Blender knowledge is below basic level.

Quote
where do you import/rebuild the material?

I mean in the Sketchfab editor. I discard any texture that was generated by 3ds Max exporter and replace them with my original textures. I might be braking some glTF rules by doing that, but frankly i don't care, it's only for Sketchfab preview. As for the GLB files that's meant for customer to download and use, i rely on auto generated files by Sketchfab - usually they do better job at that than i can do myself.

Quote
What do you mean, its fairly standard right? As long as the glb has all the intended channels the person who downloads/uses that glb file should be able to enable/disable any channel they choose if it doesn't fit their workflow. What implementations are you referring to?

Mainly it's about 3ds Max exported files not being read correctly in other apps.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-04, 17:57:51
Reply #12

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
OK that all makes sense, thanks for clarifying.

I also made a script to make things easier in blender from 3dsmax, but if you have your own workflow sorted ignore this. Its mainly because I build everything in Vray then convert to other formats so if you natively work in Corona then its probably not going to help you:
https://jamesvella.wordpress.com/2022/05/22/vray-to-blender-pbr-fbx/

As a side note, the blender principle shader is super easy to work with once you use it a few times, actually does a much better job than 3dsmax (exporting to glb) but yeah takes some time and that's our most precious resource so I understand when you have other priorities. In hindsight saved me a lot of time though.

Sigh, I was excited when I seen 3dsmax 2024 ability to export to glb, now that I've been testing it all day trying to work out a way to automate it its just a bunch of garbage lol. Think ill just continue fleshing out my glb script for blender since that one I posted above does 90% of things but when you need to use UV channel 2 for plant AO (stacked leaves) then I need to do things manually (swapping ao when things are placed on a table for example or using uv2), so back to the drawing board I suppose.

2023-08-04, 22:06:34
Reply #13

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 9311
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I will definitely check your script, even if i have no Vray, but maybe it can be useful nonetheless. Thanks for sharing!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-08-06, 19:23:01
Reply #14

James Vella

  • Active Users
  • **
  • Posts: 678
    • View Profile
Ok just an update on this, after testing all weekend I found out that you can use the 3dsmax2024 glTF material for exporting which works pretty consistently. Ive got something pretty solid that converts vray materials ready for export directly. The good thing about the gltf exporter is that it respects UV channels, so if you have AO on uv2 (for stacked leaves) then you can swap it easy in 3dsmax bitmap. Only down side is you cant use packed textures, but it packs the rough/metal anyway so the occlusion only adds a few extra kb so its not the biggest deal for the trade off - speed.

If I get time later this week I can take a look at something for Corona, but for simplicity I will make it for standard bitmaps so you will just have to use the Corona converter to switch your bitmaps back to standard before running the script. Its a bit hacky since you need a Roughness texture for all materials (which would be pretty standard by now, hopefully) Stay tuned...

Also romullus, do you know why my scripts when run are greyed out in toolbar, it labels it as 'missing' when I restart 3dsmax, never happened to me in 2021. Is there some admin thing Im not aware of?
« Last Edit: 2023-08-06, 19:27:53 by James Vella »