monkey2 icon indicating copy to clipboard operation
monkey2 copied to clipboard

PbrMaterial.Load could allow suffixes

Open DoctorWhoof opened this issue 6 years ago • 3 comments

Hi,

While I can certainly work around this issue, I feel like allowing PbrMaterial.Load to require specific file names (color.png, normal.png, etc.) restricts how I want to organize and import things, specially when I'm dealing with the world outside Monkey2 (i.e. 3d apps and their file paths).

Instead, it would be nice if it just checked for how the name ends (cube_color.png, cube.normal.png, etc.), so that I can write the specific asset name in front of the required strings.

Thanks!

DoctorWhoof avatar Jun 02 '18 20:06 DoctorWhoof

The main reason the pbr 'format' (haha) is the way it is is because it's pretty much what this site uses for it's downloads:

https://freepbr.com/

...and that's pretty much my only source of pbr materials.

The need for material name prefixes seemed redundant (to me anyway) since the textures are already in a dir with the material name, but this could easily be added. I guess on macos, which for some reason seems to hate telling you document path, it could be a problem...

I have since added support for a material.json file in the .pbr dir that allows you to set other material properties such as roughness coloFactor etc. I was considering adding optional texture paths to this too, which would allow you to just dump all your materials into a 'flat' directory structure and do other tricky stuff. This could also be a .mojo3d file I guess but all the "ctor" stuff would be overkill in this case I think?

I am very open to any suggestions here, but will no doubt be unable to please everyone. Perhaps support for material loaders could be added the way there are model loaders? I guess it's likely there are other material formats around thyat mojo3d should really be supporting? I've just need really heard of any, beyond perhaps 'substance' (?) but I couldn't really find any docs for that and, frankly, I never though mojo3d materials would be as capable of as much as the way you've been using them!

On Sun, Jun 3, 2018 at 8:42 AM, DoctorWhoof [email protected] wrote:

Hi,

While I can certainly work around this issue, I feel like allowing PbrMaterial.Load to require specific file names (color.png, normal.png, etc.) restricts how I want to organize and import things, specially when I'm dealing with the world outside Monkey2 (i.e. 3d apps and their file paths).

Instead, it would be nice if it just checked for how the name ends (cube_color.png, cube.normal.png, etc.), so that I can write the specific asset name in front of the required strings.

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/389, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3Qk2w5IePMPaUm2DPzMmKqm_G2_aPks5t4viqgaJpZM4UX1aI .

blitz-research avatar Jun 03 '18 00:06 blitz-research

No problem, I think the json file idea for pbr materials works nicely.

The reason I asked for a suffix based scheme is that it would actually stay compatible with the current scheme, i.e: if you're looking for a file name that ends with "color", and the name is simply "color", you'd find it. But it would also find a file named "test_color", etc.

DoctorWhoof avatar Jun 03 '18 06:06 DoctorWhoof

Opportunity to close this issue.

seyhajin avatar Jun 04 '19 14:06 seyhajin