Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im currently trying to texture a (transparent) cylinder. I want the texture image to wrap sideways around the cylinder but not the top and bottom faces, they are supposed to just stay untextured (so transparent, in this case).

So what I did (in Blender) is UV unwrap only the side faces and leaving the top and bottom faces as they are.

However, this method doesn't seem to work very well, because when I import the .obj in Unity the top and bottom faces are mapped to a "random" place in the texture and therefore have color.

My current workaround is to map the top/bottom faces to areas in my texture that are transparent, however, this only works when textures have a transparent place, which isn't always the case.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Whether or not you take manual control of a given face's texture coordinates, it will have texture coordinates. Anyway "untextured" isn't transparent, it's the color of the material applied (perhaps a default grey or white.) So this is why as you've noticed it doesn't make faces transparent when you don't directly assign their texture coordinates.

The workaround you describe is, well, pretty much how texturing is done. Thus the word "workaround" is misleading here. Now the fact that this approach doesn't fulfill your needs isn't a problem with that approach, it's just that your needs are more specific.

First off, do you need the cylinder to have a top and bottom face? If they're just going to be transparent anyway, why even have them? Perhaps you need to have a closed surface for physics calculations or something, but you didn't specify.

Now assuming that you can't simply delete the top and bottom faces and actually need those polygons, then you could exclude them from the texture on the sides of the cylinder by assigning them to a separate texture. I'm not sure multitexturing is supported by .obj, but it's certainly supported by Unity.

Another approach would be using vertex colors. I'm not sure Unity supports alpha in vertex color, but I know it supports RGB vertex color so maybe. This approach has the advantage over multitexturing that it doesn't require a new material. I mean, just one additional material in the scene is probably no biggie, but if you don't need a new material then that's better.

share|improve this answer
    
The vertex color approach sounds very cool but it seems that it would require a custom shader in Unity. However a seperate transparent material also works just fine and I'm currently sticking to it. Thanks –  Thommy M May 26 '13 at 18:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.