Can I see the 3D object's UV map in Godot
Asked Answered
O

10

0

I Know Godot takes UV maps from 3Dprogram (eg.Blender). But If I did not have any UV map in Blender or did not connect UV map node to my object, what would UV map of my imported object look like in Godot?

Just played around with placing transparent texture on object using shader and having difficult time adjusting coordinates xy for my texture.

Should I make UV map for every material on the object in Blender first?

Osmond answered 6/3, 2023 at 5:6 Comment(0)
T
0

I think you can see the UV map when you have a MeshInstance selected. If I remember right there’s a Mesh button on the top tool bar and and option to see the UV. I don’t think there’s anyway to unwrap in Godot though. I always just unwrap in Blender first.

Thermosphere answered 6/3, 2023 at 5:45 Comment(0)
O
0

Thanks,
Just quickly test you can view UV with Mesh > View UV1, 2 but if I didn't import UV from Blender it just pops up "There no UV in Layer 1,2". There is an option for unwrap in UV2 though, just need to make the mesh unique first.

Now I wonder what Godot "sees" when it places texture on a no UV Sphere mesh for example.

Osmond answered 6/3, 2023 at 6:17 Comment(0)
D
0

You basically have to author the content outside Godot. There are some limited tools, but in general everything needs to be done in blender or gimp, etc.

Diverticulosis answered 6/3, 2023 at 6:42 Comment(0)
E
0

Osmond Now I wonder what Godot "sees" when it places texture on a no UV Sphere mesh for example.

Object are usually created with default UV mapping, simple mapping like for a box, each side have (0,0) coord. is top left, or another corner, (1,1) is on the opposite bottom right, so putting a texture on a it will display it plain on each side according to aspect ratio of the object and the texture.
That's why we could put a simple texture on a plane to make a ground without worrying about UV coord.

Ectoderm answered 6/3, 2023 at 8:6 Comment(0)
O
0

Not too bad I suppose LOL. I use the old extra polys in front of head mesh for face method.

Brows = Shader texture2D animation
Eyes = Shader texture2Darray, eyeballs control by code
Mouth = AnimatedTexture

Diverticulosis Ectoderm Yea I was just being lazy and see if I could get by without making UVs in Blender. 😆

Osmond answered 7/3, 2023 at 17:12 Comment(0)
O
0

BTW Is it possible to swap ALBEDO with different types of texture?

for example:

shader_type spatial;

uniform sampler2D tex;
uniform sampler2DArray tex_1;

void fragment() {
	ALBEDO = ...; // Swap this between tex/tex_1
}
Osmond answered 8/3, 2023 at 3:2 Comment(0)
D
0

Yeah, you can do basically whatever you want in the shader.

Diverticulosis answered 8/3, 2023 at 3:59 Comment(0)
O
0

Diverticulosis
Do you have example code of how to do it?

I would like to be able to use set_shader_parameter to swap between those textures.

Osmond answered 8/3, 2023 at 4:32 Comment(0)
D
0

It may be easier to just change the albedo texture in GDScript on the material. That will likely be faster than doing it in a shader.

Diverticulosis answered 8/3, 2023 at 5:56 Comment(0)
D
0
your_mesh_instance.mesh.surface_get_material().albedo_texture = some_texture
Diverticulosis answered 8/3, 2023 at 5:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.