Using LightmapUVs in Material

Is it possible to apply (multiply) AO in a material the way Lightmass is doing it?
I generated lighmapUV’s and a AO texture in an external program. Now I want to apply this AO texture in my material using the AO UV’s.
There is a material node called LightmapUVs but it always returns 0,0.
Just to clarify, I am trying this approach because I have overlapping uv’s.


You can set the coordinate index of a texture coordinate node to the index of your lightmap UV’s. Then plug it to your AO texture’s UV input.

Question do you have separate materials for the uvs, that’s the easiest solution. Then you can bake, otherwise there’s an ambient occlusion Channel you can plug into with an AO map, or you could always fake it and overlay areyo map in Photoshop. But if the uvs are overlapping and you’re on a single material channel you have the same issue. UV 2 is where it’s baked if you’re doing a single material channel I would suggest you make sure that UV channel doesn’t have overlapping uvs. You don’t know how to do it when you import the model you can have unreal lay it out for you.

Sorry on my phone, light maps are created on UV 2. Make sure those uvs aren’t overlapping where have unreal do it on import.

Thanks for your answers.
I better describe the scenario a bit more.
I have three stones. Out of these three stones I build a whole staircase in my 3D app. The stones are turned around to give the whole thing some variation. Means the AO on a certain stone is always on a different location, depending where its placed in the staircase.The staircase is a combined mesh in the end.

I am using one material.
UV Channel 0 is overlapping (caused by multiple use of a stone in the staircase)
UV Channel 1 is not overlapping.
I want to multiply the ao to make it look like dirt, so the ao input in the material is not an option.

I know, I am horrible in describing the scenario, but hope its a bit more clear now.

Thanks again

Can you use real time lighting, and not do baked lighting? That’s how I do it because my objects are created on the fly so I have no choice but to not use baked lighting on my current project. Do you want to fake dirt and stuff randomly over them I would suggest using ao map as a mask in the main material channel and then add a vector 3 to control the color. When I get home I can link you my material network for my rocks see if that could possibly work for you.

A video I did that shows the material network towards the end.

Jacky, thanks. Did not know about the index feature in the texture coordinate node. Still did not find a solution to apply a texture with lightmapUV’s to the mesh.

Comatos, Thanks for the video but I don’t see how you material solves the overlapping uv problem. Do I overlook something?

It works now, overlooked something. The missing piece was the index property of the texture coordinate as Jacky said. Thanks again