Creating a new material for existing mesh

So, I am not really sure how to communicate what I am trying to do, so I will just start and hopefully it makes sense.

I have a 3d mesh in my Unity Scene that I want to create a material for. The material will be of an image that I want to create that will hopefully fit the mesh perfectly.

How do you “export” (for lack of a better term) the mesh face at the right scale, that I can pull into some paint program (GIMP or other) so that when I assign the image to a material that I am going to create for the mesh, it fits at the same resolution that i created it as?

Sorry. Not sure how to explain it.

YOu need to look up how 3d models are made and specifically “texture unwrap”.

To simply change the surface texture of your model, you need to drag it into substance painter or similar software and simply make a new texture. You can also paint a new texture in a 2d editor (gimp, photoshop, whatever), but that may be more difficult, depending on UV/texture layout of the model.

Altering UV of a model would require re-texturing it in a 3d program, like blender.

I use 3ds max often. I am familiar with unwrapping.

My question is with regards to creating a custom texture that has the same size of a 3d mesh that I did not create, but that I want to get the exact size of.

If I have a race track from the asset store that I want to overlay board game spaces on it for a dice based roll and move game. I need to be able to pull out the track at some scale, and then import that into an image editor to create the spaces I need.

After that, I will apply that image as a texture/material onto the track mesh.

The question is how to get the track mesh OUT of unity in a form that I can use in an illustration program.

Textures have no concept of “size”. They only have resolution. You can stretch them over any model. Doesn’t matter how big or small. 1024x1024 could be stretched over one square kilometer or over one square millimeter.

You do not put a 3d race track into a 2d image editor.

You can only edit its texture (if it has one) or replace the texture, if you edit the model in a 3d editor.

Thanks for your help! I think I am just not explaining it correctly.

I will approach the question a different way. I have a 3d model of a race track that was created for driving games. I want to use that track for a top down, dice rolling board game. Instead of the player driving the car, the players rolls dice, makes some decisions, then moves the car to the correct space.

I am trying to get spaces on the track surface. How would you go about doing that?

Thanks!

Can you rephrase that?

1 Like

Not sure what you mean.

“How do you suggest I add lines that represent board spaces onto the surface of the track model in Unity?”

Below is an example of what I actually have managed to get done. But it needs work.
6745138--777571--upload_2021-1-20_11-8-34.png

Didn’t we already answer that question here?

https://discussions.unity.com/t/824114/3

What else do you need to know?

The question from that thread was how to create gameObjects that represented those spaces that I could use in script. This thread was very helpful in how I am going to manage the spaces as game objects. Thanks!

This is basically an illustration/material editing question. How best to create an image with an illustration program that I could overlay onto a mesh object in unity.

The problem is you are making up your own terminology so nobody can make sense of it.

This is technical work. In order to communicate clearly with others you have to use the correct terminology. Otherwise it’s just a guessing game.

WHen asking to rephrase your question I am asking you to put it in precise terms so I can figure out what the right programs and workflow would be. But what you are asking is so vague as to be useless. Even your picture descriptions are not useable.

1 Like

I have no idea how else to word that to make it more clear what I am trying to do. Maybe images will help.

I am trying to take this unity model in my scene:
6745249--777574--upload_2021-1-20_11-40-33.png

and add spaces like this:
6745249--777580--upload_2021-1-20_11-41-23.png

Sorry! This is why I prefaced my OP with “So, I am not really sure how to communicate what I am trying to do”

The image I posted a few posts above (with the blue lines)…was created using GIMP. I imported the 3d mesh into AutoCAD and grabbed the outline of the track and pit road. Then I published those lines to a PNG file at 3500x3500 (pixels)…I brought that into GIMP where I just deleted out the background so all I had were the lines as a test.

In Unity, I created a 3d plane that I applied the PNG to.

I am wondering if there is a better way. The lines are not well defined.

So, removing the jargon from this, what you want to do in real world terms is go onto the asphalt and paint white lines, right?

In that case, editing the texture already associated with the model would be the thing to do. That can be done a variety of ways which have already been described. But without a bit of training you won’t understand.

If you do already understand how UV’s and textures work together, then you can easily accomplish the goal using MS paint, photoshop, gimp, substance painter, marmoset toolbag, or probably a dozen other applications. You can just locate the color texture assigned in that models material node, open it in whatever app you want, edit it, save, and reload in unity, and you’ll be set.

2 Likes

YES! Sorry it took me so long to get there.

That’s fine.

You are probably going to run into some issues based on the way the model’s UV layout might be. But we don’t know the situation until you get to it.

In order to solve those issues yourself you’ll need to be pretty familiar with how UV’s and textures relate. It’s not rocket science - running through a few beginner “UV and texture process” tutorials will get you familiar.

1 Like

Totally Agree. I think my original question was with regards to the SIZE of the GIMP image. GIMP deals in Resolution units. Unity is in SIZE units (right?). My end goal is to create an image that fits the track without needing to be resized. I am struggling with this part.

Resizing an image when using it in an unwrap/uvWrap situation usually results in loss of image quality. Unless the image was created at the same size of the objects its getting wrapped onto.

Another thing you can do is just make some cubes. scale them so that they’re long and thin and then place them over top of the track.

The texture is like shrinkwrap over a hot dog.

Imagine I paint a picture on the shrinkwrap. It has lots of pretty details. I wrap it around a medium hotdog. You can see all the pretty details.

But if I take that same shrinkwrap and wrap it over my house, all the details are stretched out, right?

So your situation is like this: you have a model that already has a texture. This texture is already the appropriate resolution to show the details you need, right?

Then all you need to do is add the extra paint job, save, and you’re good. When you open the texture in your application it will remain the same size unless you changed it purposefully.

The technical term you want to familiarize yourself with here is texel density.

There is also good chance this model is making use of tileable textures and overlapping UV’s. That will make what you want to do a little more complicated. You will need to understand common practices for modular environment art texturing.

I am actually using your hidden cube idea as a way to create GameObjects that I can store properties for each space in. Things like whether the space is occupied already, or if the space offers any bonuses to the next roll. But, the cubes also store data for the placement of the player token game object and its transform properties when in that space.

Here is a screenshot of the track surface. It appears it has 4 shader’s applied:
6745396--777595--upload_2021-1-20_12-11-28.jpg

There is also this texture applied over the top of the track to show tire marks:
6745396--777598--upload_2021-1-20_12-13-21.jpg

You are saying to start with one of these as its already sized properly?

You need to determine which one has the texture you want to edit.

Quick way is change the albedo tint on each material and see in the viewport who it is going to.

1 Like