cubic mapping

hey !

I have one more problem I couldn’t solve yet…

how can I define Cubic Mapping for my _MainTex (=^ texture channel 2)?

Background: I use my primary UV set for the lightmap (Cinema exports one UV map only) which is texture channel 1.

I tried out all TexGen modes in the _MainTex properties and all BindChannels options but it doesn’t work right.

I need that cubic mapping to get correct corner transitions for a brick wall.

All suggestions welcome!

What do you mean by “cubic mapping”? Is that something about cubemaps, or do you just want to texture each face of the cube separately?

I need the latter - but the faces may be textured the same way (same tiling and offset)

The texture should be equally wrapped around my cubes. like this:

http://michaelsklenarik.de/unity/1.jpg

But Unity uses the UV coordinates by default which looks like this:

http://michaelsklenarik.de/unity/2.jpg

Due to the UV set the corner bricks don’t match…

Then do the UV map the way you need on your own cube. Or write a script that generates the UVs you need on the builtin Unity cube, whichever works better for you. You should have the UV map you need somehow in the mesh, so this has nothing to do with the shaders.

I have used arbitrary UV sets modeled in my 3D app without any problem. Are you sure you are exporting it right ?

.ORG

Yeah, the export works just fine.

The thing is that Cinema 4d lets me export one UV map only (that I use for the lightmap).
This UV set has UV polygon borders to avoid lightmap seems at the edge of my geometrie. Therefore that one UV set can’t be used for my brick texture.

And as all 3d apps support cubic mapping I thought there must be one way to realize that in Unity/Shaderlab using TexGen mode or BindChannels…

Cubic mapping is a little complicated i think, it’s not easy coding the tools you use in 3D apps that seems so intuitive.

A workaround would be to have the same object repeated with the different UV sets you want, with no performance penalty since drawing an object twice is the same as drawing two objects once each.

Or to merge the lightmap with the texture.

.ORG

Cubic mapping refers to the type of mapping you’re doing (cubic), not what you’re mapping it onto. It’s normally used for putting fake reflections on objects (which can be anything, not just cubes). It definitely won’t help you in this case…you either need 2 UV sets, or find some other solution (1 huge texture with the lightmap baked in…).

–Eric

couldn’t you just unwrap your model so that your uv islands are continuous wherever you don’t want a seam? (you’ll have some seams to use your texture space effectively but you can hide some of them in the shadows of the lightmap or behind other architectural details)

then in the lightmap shader, set your brick texture scale to the proper repeat size leave the lightmap as is.

this won’t work in all cases, but particularly for walls (e.g. vertical surfaces only) if you uv carefully build your geometry with this in mind, it works fine with only one uv map.

i busy atm but if you want i could throw together an example for you a little later.

@Eric5g5: I’m still waiting for Maxon to work on the fbx exporter. And baking it all into one texture is suboptimal since some of these walls are so huge that it’d get too blurry.

@drJones:
I’d really appreciate a little sample of what you mean.

But don’t hurry, in my timezone it’s time to go to bed now - so I’ll be back in 10 …uuuuh… okay 5 hours.

Thanks @ all !

here’s a simple rough example. you could slightly shift the verticies in the uv map that make up the corners to get a more realistic turn in some places. also you’d probably want to have, say all your brick objects be combined with one material LM image etc., i just threw it all together here.

38290–1432–$lm_387.unitypackage (8.36 MB)