- Home /
Texturing Help
I have a bunch of photosourced tiles like this I also have a plain untextured layout of a lake house (not yet finished): So my question is, is there a way I can just assign textures to certain faces in blender and have them show up and tile correctly when imported into Unity? Or do I really have to UV unwrap the whole thing and texture it that way?
Answer by eses · Aug 20, 2018 at 03:19 PM
Hi @ninjakitty844
You'd be looking for some shader that uses tri-planar projection to place the texture patterns on the walls, instead of shaders that typically use UV coordinates for this.
Shader should have some sort of positional offset controls to allow you to align texture pattern with wall bottom level for example, and optionally should be scalable by world space units (1 tile pattern = 1x1m or something).
This would work for materials with surfaces aligned along main axis like here, but as it's projection, diagonal and curved walls / ceilings wouldn't work that well.
One example of this technique, if you are not familiar with the concept: https://github.com/keijiro/StandardTriplanar
But I'd just find / try to create some script that unfolds and aligned faces by their world space scale. There are many at least as plugins and script in other 3D software.
Well, the specific shader used there doesn't seem to scale the way I want it to. I'm not much of a 3D modeler and I've got no idea how to create a script like that. Haven't been able to find any useful scripts either.
Never$$anonymous$$d, that shader works under the right circumstances. However, some of the textures are rotated weirdly. On one wall, a texture will be right side up, right around the corner it'll be sideways. Not sure how to fix this.
Well, it is impossible to say if some or any existing implementation in Unity that you come across works as well as it should... You can always write a shader yourself.
Answer by Pinkuboxu · Aug 23, 2018 at 05:39 PM
The short answer would be that you do indeed have to unwrap anything when you are modeling. This leads me to suggest looking up some basic Blender tutorials but I may misunderstand your question. But when modeling buildings, you don't have to finish the whole build and then unwrap. You can create simplified individual building parts, unwrap and texture them then make your building. It's a bit like what they call Kit Bashing in modeling only you are making your own kit. Just be sure to try and use as few textures and materials as possible by Baking Texture Atlases. You can use big textures with the smaller ones baked in to make up for using multiple materials.
That brings me to a few things worth saying. If you are still prototyping, do your self a favor and don't worry about graphics. Get working systems in and then worry about graphics. But if you have the need or desire to work on the graphics and worry about the complexities, more so with having a scene with a lot of architecture (as well as a lot of variant characters) you want to have as few individual models as possible using as few materials as possible generally speaking. For example, you want to build your whole city in Blender and use as few objects as you can, combining the buildings into single meshes. OR you can combine meshes at runtime in Unity and also Bake your Atlases there to (but this requires code or a baking asset). Use one material per object as often as you can. Usually one PBR material has all of the parts you need. Even better, if you don't need PBR in your game just use a simple diffuse material setup. If you have complex character setups that require multiple, custom colors, or materials that require more than just the standard PBR type setup, having multiple materials is fine but you will incur more draw calls and lower the FPS when a lot of them are on the screen at once. Finding a custom shader for certain situations is often a good idea, but I do not think in your case this is the right call, IMHO.
I lied, the short answer is to hire an artist... but that isn't helpful. I do have to preach avoiding over generalizing until you are actually good at each thing you are generalizing in. I based my advice in this answer on the fact that you said you aren't much of a modeler. There is no easy way to make decent assets until you learn how to make decent assets. That's why I have to reiterate, during prototype focus on the game and use temporary assets.
I said photosourced, not photorealistic. The graphics are supposed to sorta resemble something made for the build engine (the engine on which Shadow Warrior, Duke Nukem, Blood, etc were made). I'm just making a simple lil something, it's gonna be mostly just sprites, and only the map is gonna be modeled (just some basic geometry) because it would be a pain to build it any other way.