Models workflow - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10) +--- Forum: Xonotic - Editing and Concept Art (https://forums.xonotic.org/forumdisplay.php?fid=11) +--- Thread: Models workflow (/showthread.php?tid=5665) |
Models workflow - Justin - 07-12-2015 Hello. Due to upcoming competition and interest in modeling and designing I decided to create a tutorial on modeling workflow. I had already created one long time ago but as time has passed I learned new tricks that I would love to share with the community. Its you who are the real authors of the following tutorial as involvement in this community basically made me a designer. I hope that it will prove to be helpful (even or perhaps ESPECIALLY for my competitors) Before I begin:
Let me begin. MAP MODEL REFERENCE: Firstly It's important to know that you can export your map or just a part of it as an .OBJ file and import it to any modeling software. You might ask " Why would I want to do this?" For scale reference and exact matching your model within the environment you are making - visually and structure wise. Obviously some models can be done without that special step. The option can be found in the build menu and its called "convert to .OBJ for modeling apps". Mind that your map has to be surrounded by caulk cage and has to have info player death match entity (don't ask me why. Nobody knows that) As you have your .OBJ file saved safe and sound in your data/maps folder you might want to open it with modeling software and create a basic draft of what you want to have in your scene. On the screenshots you can see the tree log and rock basic shapes. MODELING: At this point the modeling part comes in where you add vertices to your mesh and sculpt the final asset. During that process you need to adjust the model based on the environment that you had previously imported. The potential goal is to create two versions of each asset you work on: The high definition and the low definition version. For some models you won't need that. Take for example simple box model made of wood. You will be modeling it low poly and never go into high definition sculpting (unless you want specific effect like cracks, hinges, irregularities that couldn't be achieved in a different way). If that's the case you might want to skip to the next part of this tutorial The reason behind creating two versions is to render the high quality and details of the high poly model onto the low poly one. Take a look at the screenshots: UNWRAPPING: Once you have two models prepared unwrap the low poly one. Unwrapping is basically a process of cutting your model into pieces and placing them on flat surface in a way that each polygon is distorted as little as possible. We do that to apply textures which are essentially two-dimensional. This screenshot shows how looks relaxed (unfolded) surface of the cylindrical shaped tree log on the UV space. THIS MODEL AIN'T YET LOW POLY (its just lower then what it was in sculpting definition). I'm uwrapping it at this point for my workflow allows me to optimize it later on! While unwrapping keep in mind these things: Unwrapped faces can't cross the boundaries of the UV space, unless you are using the seamless texture which is going to be tiled. Save as much texture space as possible. Good for optimization - reduces the amount and sizes of textures and increases texture quality. Don't overlap faces on the UV space, unless you want them to have exact same texture, I don't know exactly how it affects lightmap in Darkplaces for a model but it might have a negative effect. Some faces of the model might be in dark or barely visible in game. You can scale them down in UV space (or even remove them entirely) to save some space for "more important" faces. RENDERING TEXTURES: Let's say you have unwrapped your low resolution model. Now you can use rendering capabilities of modeling software to produce textures. It might be "render to texture" (hotkey 0) in 3dsmax or "extract texture maps" under the "uvs & maps" in mudbox. There is quite a few programs having this amazing feature, some of them free (like Blender) some not (like ZBrush, Mudbox, 3DsMax) Once you have your textures generated you might want to throw them into 2D software like Gimp, PS, Paint... If you are using PS I strongly recommend buying cheaply NDo2 for texture generation (If I recall correctly it costs around 50 USD). It allows to create normal, specular, ambient occlusion, height maps as well as convert ones into others. Not only it does that but shows you the REAL TIME PREVIEW which is always a nice feature (we kinda lack it in Netradiant, don't we?). On this screenshot you can see how I converted normal map that was generated within modelling software into ambient and cavity maps. On the next one you see the model in mudbox with all textures (spec, bump, diffuse...) Surely I could render all maps within 3D sftware, but NDo2 has sliders that allow me to quickly adjust maps and gives much better output. Keep in mind that You need some base map to begin with. Of course you could make normal map from nothing (Ndo2 as well as other software for map creation allows that). If you don't want to pay for this kind of map creation software you can use the free ones like Crazy Bump. TEXTURING: For complex models rendering your textures is a very good way to save your time. Having those maps inside your painting software allows you to paint directly on them, use them as a reference, add them as layers with different blending options... For less sophisticated assets I recommend taking time to draw maps inside 2D editor or even directly on your model in 3D editor. Mudbox, 3DsMax, Blender allow you to paint directly on your asset. Cool, huh? VERTEX PAINTING: There are dozens of tutorials about vertex painting all around the internet. I want to point out several important points to keep in mind while and before as well as after vertex painting
OPTIMIZING: Xonotic runs on Darkplaces that can't cope with high definition models. This is why you have to keep in mind vertex management throughout the whole process of creating the asset. Your models HAVE to be low poly to save performance but at the same time good enough to look real. On this screenshot you can see how much I optimized the tree log model (keep in mind that high poly version with bark sculpted on had over 4 million polygons). There are scripts inside meshlab (free), 3DsMax (not free), Zbrush, Mudbox... that let you optimize the model. On the screenshot you can see the result of optimizing script written by Abhishek Subba for 3DsMax called LOD creator. Its advantage is that it preserves UV map unchanged! So you can unwrap the model before optimizing it. It is in fact a golden feature (LOD) which is used by many engines. However in meshlab you can get satisfactory results and give your model parts "weights" that you want to be left almost unchanged. Not only the geometry can be optimized! I already mentioned how crucial it is to maximize UV texture space while unwrapping your model. It is also possible for you to considering lowering the quality or size of textures. If your texture doesn't have an alpha channel you might save it as .JPG instead of .TGA for instance. There might be a way to tell the engine to use the same normal map for different textures. I didn't find out how yet. The lightmaps which netradiant generates for your map as you build it might be .jpg instead .tga. The less size of the map the faster it loads and works! EXPORTING AND SAVING FINAL ASSET: While doing so keep in mind very important things like:
PLACING YOUR ASSET INSIDE EDITOR: To do that your model has to be stored in data/models/[map_name_of_your_map]. Once your Models are inside Netradiant they can be scaled, rotated, moved, animated however they cannot be mirrored! FINAL: As you can see I decided to add additional branches to my tree. Unfortunately I had to make a new texture for them. The good thing is that you can combine as many textures as you want on the model. So I merged them into already existing log. The only thing is that the more textures you get the bigger size of your map is going to be. Especially if you intend to make gloss and norm for each one of them. Worth mentioning might be the fact I took time to actually go outside with my camera, find the god damn forest and make photos of textures in nature. This way I do have a full control over my asset. All the best to all designers! Now go and Make your assets! If anyone need clarification on anything: Pls Let me know. RE: Models workflow - Smilecythe - 07-13-2015 Little note from me: You should also aim to make floors player clipped as flat as possible, especially in level areas like that spot with 100 armor. Rough terrain with bumps makes movement namely circle jumps and ground acceleration difficult, this is due to the nature of the movement physics in Xonotic. You easily whiz off the ground when there's downward going brushes or leveled up ramps ahead, which ultimately could make you lose control when you're avoiding shots for instance. It's ok to make grounds to appear bumpy as it adds to the eye candy considerably, but covering it with a flat player clip makes it more tolerable for an arena shooter like movement. You should also be careful with making walls too bumpy. Maps with rough nature like terrain aren't often popular in competitive play and most arena shooter maps appear blocky for a reason. RE: Models workflow - aa - 07-13-2015 Smilecythe, looks like competitive players don't have any brain calculation capacity left to process brought terrain. This is a great tutorial Justin (is it?), it gives a good idea of the general workflowen and explains a good bit of nuances. Howether, I can see a few holes here and there, particularly concerning materials, their implementation into xonotic is not explained, as well as the vertex painting nor being fully explained, such as the reason for doing it is absent. This might be missing due to significant differences between various software? RE: Models workflow - Smilecythe - 07-13-2015 (07-13-2015, 12:32 PM)aa Wrote: Smilecythe, looks like competitive players don't have any brain calculation capacity left to process brought terrain.It's just a matter of what kind of game Xonotic is, it simply plays much better with flat terrain. If Xonotic had physics that kept you glued to the ground like in most modern games it would not be a problem to have free terrain like this everywhere, but I'm afraid that's not the case. Have you ever tried circle jumping from a down going brush? You can't, your feet dash off the ground and your footwork is screwed. Terrains like this are full of brushes like that. It makes even the most intuitive and common movement like strafe dodging difficult. Player clipping them flat does more good than bad in the long run for casual and competitive players alike. RE: Models workflow - Justin - 07-13-2015 Smilecythe is actually right. I must admit I didn't put enough attention to proper clipping on my maps and often there are bumps. The truth though is that players like when the ground has height differences as well as additional ramps and stairs and fancy trickjumps. It's cool for designer to keep that in mind: Players like to dance. Especially hardcore players. AA, What exactly would you want to hear about material implementation? Ok, let me try to explain basics of how to create material for previous examples (tree log and rock): What you see here is a basic idea behind creating material, below you can see the layers in the software. For darkening I will probably use "multiply" or "darken" or "overly" blending or just add an "adjustment" such us Brightness or levels. Cool is that you can mask those adjustments to affect only a part of your texture. When creating more complex textures you will have to group your layers so you don't get lost in the huge amount of them. "Wood files" is a base for my texture "Moss" is masked (applied to the bottom of the tree) "Definiton" Contains highlights and shadows (AO, Cavity, painted highlights and darkness) "Spec" is just a bunch of adjustments such as Desaturation, contrast, curves... In "Normal" I combined duplicated normal map with overly to enhance bump in some spots Then its about placing ready textures in your textures/data/map_[map_name] folder and writing simple shader for them. I don't know much about shaders apart from basics of basics so... All right... This is the shader you have to place like so: data/scripts/map_[map_name].shader Code: textures/map_[map_name]/tree-bark About the specular and gloss: High values for specular map mean reflecting light (white or colorful highlights) while gloss kind of defines how spread these reflections are going to be. For instance value of 1 (white) for specular and value of 0 (black) for gloss will give you very spoty (is this a word?) highlights. I think. Although if I were you I would ask Morphed or Sev, they know this stuff. Sorry, Its 4.30 am and I.., I will probably update and edit this post when I wake up. RE: Models workflow - poVoq - 07-14-2015 Thanks for making this guide! RE: Models workflow - sev - 07-14-2015 Very nice tutorial, lots of things to learn. Also thumbs up for using your own texture sources. One addition from me: It can help performance if you keep complex models non-solid, and instead put a simpler weapon-clip around it. I did that with the arches in Xoylent. RE: Models workflow - CuBe0wL - 07-17-2015 Awesome know-how, thank you for sharing! RE: Models workflow - Justin - 07-21-2015 Thank you for positive reactions. Driven by it I decided to make part two: Ok, this is the second part of the models workflow tutorial. This time I will go more into details, but don't worry, it won't be boring as I prepared some screenshots and I'll try to keep it short: Imagine you have an idea for the cylindrical shaped like industrial model. First you picture it in your mind, try some sketches, look for photos of already existing assets like your idea. The next step is using 3D software to build the model from basic primitive. Here you can see basic primitives. We need cylinder. On the next screenshot I have made basic model only extruding, removing some faces and creating few new ones. That part usually is the easiest and the most fun when unwrapping and texturing might be pain in the... Its important that I make model and unwrap it before I start texturing not after to make sure texture fits model in the best way. Some models (like plants and decals) will have it the other way around: First comes texture of leaves, then you render it on surface which is then shaped in 3D program. In this tutorial I will be using already created textures to make new one. Whole point of unwrapping before texturing is to render the UV texture and moving it to your painting software with blending to it, so only white lines are visable. You can also select all the blacks (color select feature) and simply remove them. I suggest to keep the UV map as a top layer and name it somehow so I don't paint over it. Now comes fun step of defining metal panels. At first just paint white blocks on the black background. Make sure the blocks are on different layer (you can collapse them at the end if you need to). Now you can use NDo2 or free program (but much more limited) - NJOB http://quixel.se/ http://www.polycount.com/forum/showthread.php?t=68860 (free) In NDo2 you will want to have your white panes on separated layer and convert the brush (white) itno normal. Using sliders and different falloffs. If you use njob you have to remember to set normal map x an y inverted! Having normal map you are half way through. Based on the normal map you might want to render AO and Cavity (highlights) maps but you don't have to (for that you can use of course any program among them those two). At this point you will put different textures together, painting over them and adding adjustments. Most of the time each texture will be on different layer with mask. To get the masks properly you needed UV map which should be on the top layer. If you have two screens I suggest having your model opened on one of them and painting on the other, saving frequently and seeing changes real time on the other screen. When you are finished don't forget to save gloss, normal and diffuse maps seperatedly
To export model you have to set smoothing groups and align the pivot point properly. Remember that pivot has to be set according to model and then the whole model with its pivot have to be moved to 0 0 0 position (pivot point). When you import model to editor its origin has to be WITHIN map space! Otherwise it won't compile! Setting things such as "force meta", then "lightmapscale" to a 0.5 or less if you want higher quality. (I left it at default). And clipping (thanks to what Sev said: for mor complex models its good to make them unsolid and add colision brush) The biggest problem with modeling for this engine is that you can't see the results quickly (you have to recompile map) that's why you should use other software for that reason. There is quite a lot of programs having the real time preview. You can see the basic sample of how your model will look like alone. However you won't know how it plays within the map until you compile it. Mabye its worth building just a part of your map containing that model...? |