Detail texture using second UV set

Does anyone know if it is possible to do detail texturing (diffuse + detail) on the iPhone using a second set of UVs in a single pass (using combiners)? I know you can do it using the built-in diffuse+detail shader, but my problem there is that it uses the same UV coords as the diffuse. I need something that works more like the lightmapping shader that allows separate UVs for the detail map.

I wasn’t sure if this was possible without multiple passes.

Yes, both StarTrooper and Warehouse demo are using second UV set for lightmaps.

I realize this is already built-in for lightmaps. What I was wondering is if this can work for detail maps as well. Or… can I just specify a detail texture as the lightmap and get the same visual result? I hadn’t considered that…

I would also would like to use second UV set for Decals (not details), and afaik the standard Decal shader VertexLit, which is not supported on the iphone?

Should I be looking at StarTrooper and Warehouse demos for clues about this? Thanks - I’m a noob about shaders.

Interesting, I hadn’t considered it, but the lightmapping shader works just the same as a detail texture - you just use set the UVs accordingly. Plus, the regular diffuse+detail shader I tried didn’t work on the iPhone (did work in Unity though - I probably didn’t have it set to emulate the iPhone rendering). But no matter, the lightmapping shader works just fine!

Thanks!

Oh yeah I see now how it’s done in the warehouse demo in LightmapOnlyShader.shader.

Though I really need the second texture to be RGBA though to make a semi-transparent decal. Time to learn Shaderlab!

If both the textures (main and detail) are square, a second UV is probably not needed: you can use the same UV and just increase the number of times the texture is repeated for the detail texture. This saves quite some work (no need to map a second UV) and also gpu work.