Hello all, I been learning Blender for a few days and I have made my own Blender model Tree ( low poly style ) and I used materials in Blender to make this! I noticed when importing to Unity it converts it to the Standard Shader, but this is not good as I use my game for android and it needs to use Mobile Shaders. Also I noticed I had multiple materials attached and research says I should only have 1 material on an object. After doing some more research I found out I should be using a combined texture in 16byte format?
I am extremely confused on this whole process and how to do it with the least amount of draw calls ( I know research on static batching ). I cant seem to find any good tutorials on this. I figured I could make a texture with a colour palette of several colours and pick and choose those colours in Blender to colour my model and export that? I am confused on the combining textures part and how to use with Unity Shaders properly and actually colour my models using this style.
Any help would be greatly appreciate, or if I can bug you on skype for a bit that would also be greatly beneficial.
Each software have their own material library. Unity’s default shader is Standard Shader. You can then change the shader into other shader you want. The setting will store in metadata then.
Yes if only your model contains 2 or more materials. Check your model and apply the correct material carefully to make sure there’s only 1 material applied. Select the whole object and apply in 3D software. Be careful not to select all faces and apply. It’s a different story. If your main workflow is in 3D software. Make sure the naming is 100% correct or another materials or objects will created. You can also ignore material import if your main workflow is in Unity. Then only do material organization in Unity while providing model from 3D software.
There are a lots of way to optimize draw call from basic to advanced. The most basic is to batch all static objects. If all your static objects use same material. Combine them together into 1 mesh when playing via code if you want. Make as no real-time lighting as possible in your scene. Use light probes for non-static object lighting transition. Use blob shadow or just a normal texture for shadow.
This technique is called texture atlas. The key is to put several objects UV into 1 texture so that they share same material. It would be a 2x2 items texture. 4x4 items texture. 8x8 items texture and so on. Or random. It’s depend on you. Usually it’s planned before doing modeling for which one will be in this atlas and that. For project which is not mobile (1 model per texture) and needed to convert into mobile platform for the texture atlas method. There have plugins that done this job in 3D software and then import into Unity. In additional, I believe there have tools in Unity Asset Store can do this. Good luck.
Thank you for the advice! It didn’t really assist me much as was mostly defintions, thanks though! I don’t understand why I can’t just make a colour palette and assign certain faces to certain colour palette spots…and use same colour palette for everything?? Or does this HAVE to be UV mapping?
Anything modeled out needed to do UV in order to texturing.
In your case. If you want to just assign colors onto certain faces.
You can use vertex paint which done on 3D software and import to Unity.
Thanks for the response it helped push me into the right direction! I tried out vertex colouring and did a lot of research on that and I eventually settled on UV mapping.
A new question I have is, lets say if I make a texture/image that was 64x64 in photoshop and it had some different colours in squares like (4x4 red, 4x4 darker red, etc). In my Blender I was able to assign the UV mapping to certain squares in that colour palette and works perfectly fine! Since I use low poly a face would only be assigned one colour. Now would it matter if i made these blocks 2x2 and make the total size 32x32 (smaller), what would be the difference other than file size?
Could I in theory make a 1024x1024 and keep following different colours of 4x4 blocks in this 1024x1024, which would allow me to have an insane amount of colour options on one texture/material, and allow me to use this texture on every single one of my assets in the game (assign their UV mapping to certain squares) if I can fit all the colours I want on there? Making my draw calls in technically 1 for all my assets on the scene??
Would the downside be each object would have a giant 1024x1024 texture on it, what would be the problem with that?
Yes. You can make a smaller texture with different colors and match UV on it.
At least didn’t have any gradient / design on the color. You won’t see the different.
I recommend you make a larger size since you can scale down the size on build.
Make the most quality one in your project and scale down on image settings.
If whole scene only contain 1 basic shared material with all static objects.
It should be 1 draw call.
Sure you can have any gradient in the texture.
Just to make the UV very small or collapse into dot.
So you didn’t see gradient on your faces.
If you want the face is just a flat color. =)
Why, exactly? If you are just using UV mapping to assign solid colors, that just adds one extra level of indirection. Instead of assigning the color directly, you’re using a UV to index into a look-up table and get the color from there. It would be easier and more direct to store the color in the vertex directly. Textures are useful because there can be extra information in the texture space between the UV coordinates, but if you are using it for flat shading, there is no reason to use UV mapping at all.
There would be no difference as long as you disable mipmaps and use point filtering. Those are used by default to minimize aliasing in regular textures, but you want a clean return value so turn off all filtering. If you do that, you can use a single 1x1 pixel for each color with no problems.
That would give you about a million colors that you’d have to manually create a UV-to-color mapping system to use. You already have all 16 million colors in the per-vertex in the color property. Using the color property directly is both more efficient and a simpler work flow.
Just a bit of extra memory use, but if you use the same texture everywhere for all your materials it will always be in a fast part of memory so it shouldn’t be a noticeable performance bottleneck. But, as I said, with flat shading it is unnecessary.
Don’t waste texture memory coloring your faces, but save all it all for baking high quality light maps for your scene.
Thank you for the very detailed response, I understand much better now! The reason I got off vertex shading was my inexperience with unity shaders and the options that come with vertex shaders. Also if I don’t like one of my colours and wanted to change it…it would be a pain to change it all with vertex painting, compared to UV map I just open up photoshop and paint a new colour once.
Actually my current biggest problem that I haven’t been able to solve after many days is with vertex painting and I try to bake the scene using Baked GI, everything turns extremely dark and horrible looking, even when I change intensity it doesn’t change much. If I don’t use any baking, the scene looks great normally with all my lighting. When I try to bake using new shaders on the UV mapping ( mobile/diffuse i think), it gives me huge black artifacts everywhere…so baking doesn’t work at all on anything.