Cannot apply materials to imported meshes

Ok, so I’m probably doing something wrong, but I definitely need help with this.

When I import a custom mesh that I made in blender it looks like this:

But then immediately when I assign a material, it turns out like this:

It looks super shiny as if I had turned the roughness to 0. But the material I added was a cave rock black and it was an element brush and I did not paint this. In fact, I cannot paint at all. As soon as I assign the material, the whole mesh changes into this mirror-like material and I cannot modify it in any way.

If I import another .obj I downloaded from somewhere this does not happen, so I need to know if I need to do something in blender when exporting. I already tried exporting with and without materials in both gltf and obj formats.

I should note this mesh has inverted normals, it’s meant to be looked at from the inside, but still no dice when I try to paint it like that:

I would really appreciate it if anyone knows how to solve this. Thanks.

Hello @Ignawesome and welcome to our community!

Would you be able to provide either the mesh or the InstaMAT Package (.IMP) file with the mesh included to test?

Thanks!

Thanks for the help.

Here is the IMP file, it includes the obj and the glb files:

And a zip with the blend, glb and obj separately: Cave.zip - Google Drive

Here are some errors that showed up in the console:

ERROR: OBJ: Unable to locate material file cave8.mtl
ERROR: OBJ: Unable to locate fallback material file C:\Users\IGNAWE~1\AppData\Local\Temp\204a9f0a-ea89-4b4a-a143-720766b3956c\MeshImport.mtl
Preparing InstaLODMesh “Caves_-col” (224184 polygons / 1 materials)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel BaseColor: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Height: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Roughness: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Metalness: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)
WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Normal: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

Hello @Ignawesome,

Thanks for providing the package. From what I can tell, it looks like the mesh does not have any unwrapped UV coordinates.

The UVs of the mesh can be unwrapped in InstaMAT Studio using a node in an Element graph called the Mesh UV Unwrap node. Here’s a quick example of a graph that takes a mesh input, unwraps the UVs and then provides a mesh output.

You can drag your mesh from the Package Management panel into the graph to provide it as an input, then connect it to the Mesh UV Unwrap node to create the UVs.

Once unwrapped, you can view the mesh output by clicking on the output pin of the Mesh UV Unwrap node to show it in the viewport and click the
CleanShot 2024-03-29 at 08.53.18 Export Viewport Scene button to save the new version of the mesh. You can then re-import the model and use it in your Layering project.

What’s great is that once you create this graph to unwrap your UVs, you can re-use it for any mesh that needs to be unwrapped. If you set the output node as shown above, you can use the CleanShot 2024-03-29 at 08.55.50 Image and Data Output Export window as another way to export the mesh data. All you need to do is change the input mesh.

I’ve attached the updated package with the Unwrap UVs Element graph and the updated model in the Layering project.

Let me know if you have any further questions! Thanks!

1 Like

Hey, thanks so much! I had to tinker with it a little but I learned a lot and eventually was able to do it myself.
I can see now that the UVs were the problem. I’ve had issues with them for a while in blender and that’s why I decided to try instamat.
I think my cave mesh is too big for the textures I want on it. Originally I scaled the UVs in blender way out of bounds in order to get a repeating pattern, but I had the same result as the mesh without UVs.
Not I managed to put the UVs on the mesh, but there is still one adjacent issue:

This is how it looks in the brush preview:

And this is how it looks once painted:

The textures I paint on it look very low resolution. I’m aware this is not a bug or related to my original problem, but I’d appreciate if someone knows what is the proper way of painting an asset like this.

Additionally, I’ll mention a couple of questions I had while using the software:
first, is there a way to navigate up and down (in addition to forward, backwards, left and right) while holding right mouse button? That type of first person navigation is very convenient but I couldn’t find how to do that movement.

Lastly, I noticed that the mesh doesn’t update until I try to paint on it or apply/move a mask. Is that intended behavior? Like, when I add a material on a layer it just doesn’t update until I do something else. Or maybe it’s just loading… sometimes it’s loading a material and I cannot tell. Maybe it would be possible to show an indication that the viewport/preview is updating?

Anyway, thanks a lot for your help so far, it’s been really useful! :slight_smile:

1 Like

You’re welcome @Ignawesome! Glad I could help! From what I can see regarding the resolution of the texture on your mesh, it has to do with the amount and size of the UV shells in a single 0-1 UV tile. One option would be to break the environment up into multiple material sections, or unwrap the mesh for a UDIM workflow. Both workflows are supported in InstaMAT.

If you’d like to break up the mesh into multiple materials, InstaMAT has a powerful asset texturing workflow called Multi-Material (Unified). It provides the UDIM workflow for meshes that have been set up with multiple material sections assigned. InstaMAT provides one layer stack for the entire scene.

This way you can break up your mesh’s UVs into multiple UV tiles so that they have bigger shells resulting in textures that have more detail, while still working with one layer stack.

Regarding your questions:

is there a way to navigate up and down (in addition to forward, backwards, left and right) while holding right mouse button?

Currently this is not possible, however you could create a feature request in the InstaMAT > Feature Requests category. Just be sure to follow the Feature Request post template which is provided automatically when a post is made in that category.

As a workaround, I usually switch between the first person navigation and either the MMB or Cmd/Option + Left Click (I’m using a Mac in this case) to adjust my elevation.

I noticed that the mesh doesn’t update until I try to paint on it or apply/move a mask. Is that intended behavior?

Could you provide a quick screen recording of this behavior? It might be that the material is loading. There is a progress bar in the bottom right corner of the UI that indicates when processing is in progress.

1 Like

I’m back! I was able to solve the issue thanks to your feedback :smiley:

Separating the cave mesh into different objects and assigning different materials for each. But I also had to change the projection mode of materials to UV, as it was Triplanar by default. So in each material go to Element Layer → Layer Projection → Projection Mode → UV.

This is the result in InstaMAT:

Then I imported it to Godot and it looks like this:

It’s waaay better than before, even if it lost some quality, arguably due to texture resolution.
These are the best results I’ve had yet, so I’m definitely sold on this method :slight_smile:

As a workaround, I usually switch between the first person navigation and either the MMB or Cmd/Option + Left Click (I’m using a Mac in this case) to adjust my elevation.

This worked wonders and is very intuitive too!

And regarding my previous complaint about the mesh not updating. I had already recorded the issue when I noticed this happened because of the little lock on the top right which was locked by default. The preview mesh now updates instantly.

So everything is solved! Thank you so much for your time and sorry for the delay :sweat_smile:

1 Like

That’s really great to hear @Ignawesome! Thanks for the update! Your cave is looking great!

Please don’t hesitate to ask if you have any further questions. :blush:

1 Like