AssetGen addon (old thread)

AssetGen is a free addon addon (MIT License) that automates the tasks to get a game assets ready for video games from an High Poly model. While it takes several hours to get an asset ready from an high poly, this addon does that in a matter of few clicks. It is ideal for all your static assets.

== Download AssetGen addon ==

AssetGen (for Blender 2.79 only): https://github.com/Linko-3D/AssetGen
It is developed by Srdan Ignjatovic aka zero025 ([email protected]) and surpervised by Danyl Bekhoucha aka Linko ([email protected]).

Bonus Unity realistic startup scene: https://github.com/Linko-3D/Realistic-Unity-Project
A version with the best looking scene I was able to create in Unity.

== Installation ==

Go to “File > User Preferences…”, open the Add-ons tab at the bottom and click on “Install Add-on from File…”.
Import the whole .zip. In the search bar search for AssetGen and enable it. Don’t forget to click on “Save User Settings”.

== Introduction ==

This addon is very useful for generating all your static meshes. For meshes that have to be deformed like characters you should use your own LP.
Sometimes the addon doesn’t work very well on models with a lot of tiny parts, in which case you must adjust your high poly by keeping the decimation in mind to use the addon. Even if you use your own low poly you can still use this addon to bake the maps and generate your textures. AssetGen provides tools to help you generate your albedo map, everything will be explained here.

Model from the Mobile game character tutorial of Pluralsight with 24.5 millions decimated to 20k tris and generated all the textures in few clicks and minutes:



What AssetGen does for you automatically:

  • you have access to surface details to add micro details on your high poly’s shader, ex. rock effect, wood, etc. The details will be visible on your textures.
  • the addon generates your low poly including all your LODs at the desired polycount. It will try to remove all intersecting meshes to improve the low poly quality and UV’s texels.
  • it will unfold your UVs, it can unfold half or your low poly for symmetrical models. You can set the cage, edge padding, etc. The best settings are set by default.
  • it will bake all your textures, you can choose which texture to bake. The most important ones are enabled by default. You can choose the texture resolution.
  • it will save your texture to allow to continue your work later. It will use the name you have entered for your asset and will add the _LOD# suffix for each.
  • it creates a Blender Render shader and nodes for Blender Cycles and creates the lighting to see what the low poly looks like directly after it is generated.
  • it helps you to create your albedo texture by providing settings to generate a grayscale texture and help you create your gradients. Results are shown directly in the viewport.
  • you can add texture effects like dust deposition and grunge very easily and adjust the amount and color.
  • you have access to a tool called “Export asset” which will export your LODs and reset their locations at the path you have specified. It will also export your albedo, normal and AO map in the same folder or in a subfolder (called “Materials” by default to match Unity).

The addon also provides a set of tools allowing you to make a tileable texture, create the silhouette of a weapon and more.

== How to use it ==

Note: Hovering the mouse on a setting displays a dialog box with an explanation.

Game Asset Generator panel:

Requirement:
You need a high poly mesh.
The script can convert multiple high polys into one low poly, you just have to select all the meshes you want to include in your low poly. Don’t worry your high polys wont be touched, you will keep them separated with their names and modifiers.

Important note: your high polys must be in layer 0 when generating the script. Also the script will delete everything in the layer 1 (this layer is used to display your low poly and to bake the textures).

Texture resolution:
The first setting is the texture resolution, the settings are indicated in a square (1K = 10241024). To work with it, I suggest to use at least a resolution of 2K (20482048). Modern games use this resolution aswell when display their textures.

Selected to active:
Enable this option to use your own low poly. You must select your high poly first and then your low poly (active selection) to use it. If your low poly has no UVs the addon will do use the Smart UVs settings in the advanced settings menu. You can generate a LOD1 and LOD2 from your low poly.

LODs polycount:
Those settings are very important, it is the LODs’ polycount in triangles. The LOD0 is the game asset that will be displayed at a close range from the camera. Each new LOD is the model shown further from the camera. You can keep the other LODs at 0 triangles to not generate them.
You have to test and see how the asset looks with a low texture resolution, if it’s too deformed and black spots appear (it could also be the cage size too low or intersecting in concave shapes) you can increase the polycount. If a lot of details are captured you could try to reduce the polycount and see how it looks to optimize your game. Generating a game asset takes in average 10 seconds with an 1K texture (ideal for tests) and 1 minute in 2K.

Bellow you have access to the Advanced settings and Texture settings. Their default settings should work with most assets.

Advanced settings:
Those options will allow to have more control for baking and textures. By default the settings work on almost all assets.
The settings are:

  • Cage size: this option increase the size of the low poly during the baking to capture every detail. A value too high could generate intersections with concave shapes resulting in black spots.
  • Edge padding: also known as margin, it is the number of pixels that goes above your UV seams. This allow to not reveal (otherwise lines will appear).
  • UV margin: it is the space between the UV islands. If the UVs are too close the edge padding wont be able to extend enough, this could reveal the seams.
  • UV angle: because the addon uses Smart UVs, it allows to define at which angle of the mesh to add a seam. Lower value = more chunks (bad performances), higher value = potential overlapping and lose in texel space.
  • Samples: this value is only used for the Ambient Occlusion, other maps use 1 sample. More sample will remove the noise but will take longer to bake.
  • Create envelop: with this option enabled the script will perform an Union boolean between each meshes by loosing parts, in other words most of your intersecting parts of your low poly should be removed. This will allow to get more triangle for the visible parts of your asset and also to not waste UV space. Caution however, this options doesn’t work on models with a lot of tiny meshes and meshes that doesn’t intersect enough to allow the Union boolean to work correctly.
  • Unfold half: use it if you have a symmetrical asset, this will generate the UVs for half of your texture to double the texel of it. It is particularly good on a mobile game with limited texture resolution.
  • Ground AO: this option will generate ambient occlusion for the grid, it is useful for static assets that lays on the ground in your game.
  • Remove undergound: it will remove the parts under the grid before doing the decimation in order to get more details from the visible parts.

Texture settings:

  • Mask: this option will allow you to later apply the gradient on areas that have the same color baked. You must define the colors with the diffuse color of your model. Use saturated colors and and hue far from one another to make sure that the masks read correctly (two colors close will be interpreted as the same color mask).
  • Albedo: enable this option if you already have a texture on your high poly. It is better to generate it on your low poly, but this can be useful if you had a texture from a 3D scanned object.
  • Normal: the normal is used to capture the details of your high poly. If you don’t want to use it for a mobile game with hand painted texture you should still enable it to generate a curvature map from it.
  • Ambient Occlusion: generates shadows on parts close to each other so it will work on any lighting condition. In a PBR game the ambient occlusion is added separatly in an Ambient Occlusion slot in order to make the AO on the parts that doesn’t receive lighting in the game scene.
  • Curvature: the curvature is a map generated from the normal map (so you need to bake it). It will highlight in white the convex parts (peeks) and darken in black the concave parts. The rest will use a middle grey color. It will be used as a base for your albedo texture. This effect gives a slight hand painted look to your texture. You have two options: width for the width of the lines and blur to remove aliasing.
  • Pointiness: it is a vertex based curvature map that is generated from the geometry. The details of this map will depend on the amount of vetices on your high poly.
  • Bent: this map will look at your faces orientation compared to the world’s scene, this will allow to use effects like dust and snow deposition on your mesh for your albedo.
  • Gradient: this map is used on stylized games and especially on MOBA with characters seen from above. It will generate a ramp with dark values at the bottom and bright at the bottom.
  • Opacity: most game engines can use the alpha of your albedo but if it’s not supported you can use this map. It will show in white the visible parts and in black the fully transparent parts of your asset
2 Likes

I like dis.
Will try.
I always love to see cool UI setups!

It’s good to see this kind of projects, but I think that maybe there are too many windows for stuff that don’t necessary happen while you’re sculpting. When I’m sculpting it’s only the 3D Viewport + Properties Editor+Outliner, with the 3D view maximized.

I try to maximize my space the most for the sculpture itself and I’d give my left hand for a setup or addon where I can move stuff from the “T Tab” to the “N Tab” so there’s not so much vertical scrolling. Not sure if everybody agrees, but that’s a just suggestion and I guess everybody works differently :smiley:

Although I don’t really do much sculpting, I do like the idea of a Blender optimised for game asset creation, since that’s what I use it for myself. I am really hoping that the workflow release will go some way to improving the defaults for a lot of things (e.g. edge/vertex slide correct uvs is not on by default for example, default snap is useless grid offset snap) as well as actually moving things around to improve worlflows for various tasks and the movement between them. Dark Blender could hopefully give some good ideas for better game/sculpting workflows, but I personally prefer to stick to the main releases of Blender, as The Blender Foundation haven’t disappointed me with any release since I started using it, and I love always being on the latest version :slight_smile:

Hide these menus like I have in the image below.


Thank you for your feedback!

  • New Base Mesh added
  • You can now maximize the view and keep a reference in the background for Full Screen sculpting and modeling
  • Absolute Grid alignment turned on


How can i add edge/vertex slide corrected in the UVs? Tell me if there is another setting(s) i should change.

John Lancaster: they depend of the screen resolution maybe, they are hidden on my version. I am on a 1920*1080 display.

Edit 17/10: i have finally understood, i have hidden the menus thank you. :slight_smile:

How can i add edge/vertex slide corrected in the UVs? Tell me if there is another setting(s) i should change.
Add Edge slide to the Input settings, then enable ‘Correct UV’s’ and save settings


Search the input settings for ‘slide’ to find the vertex slide option

I like this idea a lot.
#1. Thank you for packaging this the way you did.
#2. Thank you for listing all the settings/changes you made so that they can be applied/thought of without even setting up the add-on.

I haven’t installed it yet, will try it tomorrow, but if you haven’t already, you might want to change the FPS to 30 (in the camera tab), blender defaults to 24 and that’s a film standard, not a video-game standard.

And most of this can be transferred back to ordinary Blender builds just by editing the startup .blend and saving a new set of preferences (no need to wait for the initial poster to update his version).

I’m not sure how many actual code changes there are (ie. done in C as opposed to Python), but if there’s some especially useful ones for general purposes then it would be nice to see those submitted to the patch tracker or the review tracker.

Use separate screen layouts for sculpting and modelling. As as been mentioned previously for sculpting make the workspace as large as possible, you don’t need to have all the other smaller panels visible taking up half of your monitor. If you have separate screen layouts you can just flick between the two layouts

I didn’t know you could edit the individual tool defaults in the input settings. That’s so useful!

I don’t mind having lots of visible windows, since you can maximise the one under the cursor with shift + space, but separate layouts make sense for sure. However, sometimes I wish the outliner and properties panel could be pinned so that they stay when maximising another panel with shift + space.

Normalized coordinates in the UV editor would be a good addition I think. I have to be honest that I haven’t yet tried Dark Blender, but I didn’t see that mentioned in this thread, and normalized coords are sooo much easier than those based on image resolution. The default Blender config should probably also use non-normalized, since it’s the industry standard, and is easier because you know the coords are always within 0-1 range, rather than dependent on the image in the uv editor.

This is great, lots of fun to play with. I love the fact that you listed all of the individual settings changed, so that we can apply them in other scenes (and actually learn/understand what is going on), if you do more, please keep it up with that list, it’s awesome.

I’m having an issue (and maybe it’s not a setting but a bug fix) where I am getting pretty good performance as like 16+ million poly multi-mesh sculpts but (and not sure if these are related) the interactive brush size using default hotkey “F” is really laggy so I have to just use the size slider on the brush panel, AND at these high poly stages there is a bit of lag when I lift up the brush. Like when I start a stroke and keep the brush held down, it’s smooth, but when I let go, even though the stroke is done already, there is an annoying lag that I have to endure before starting the next stroke. If there is a way to get rid of this bit of lag, my old/mediocre machine, would be capable of doing 16 - 30 million poly sculpts in Blender, fairly smoothly! Any ideas?

Richard Marklew: like Mr_Flamey said you can maximize the view with space + shift, it is recommended because you can import a reference in the perspective view it’s normally impossible.

Cancer: have you tried the Optimize button in Dyntopo? Driver update?

Update:

  • UV Normalized Coordinates enabled (don’t knew this feature thank you :slight_smile: )
  • UV Stretch turned On
  • Noise brush added
  • Update date in the bottom-right corner
  • bakeMaterial added
  • UVs: Display options in the “n” menu at the top to access Normalized and Stretch
  • Symmetry turned On for painting
  • Stroke Spacing at 5 % for painting instead of 10 %

Todo list to increase productivity (once i’ll understand how the Input tab works), i will provide a Key configuration file to import:

Sculpting:

  • 1 key: clay strips
  • 2 key: scrap
  • 3 key: crease
  • 4 key: noise brush

Painting:

  • 1 key: TexDraw
  • 2 key: Soft
  • 3 key: Hard
  • 4 key: Fill
  • Shift key: Soften brush (to “smooth” your color blending)

Modeling:

  • Enable Slide Edge UV Correct
  • Alt + F will be replaced by “Bridge Edge Loops” instead of “Fill” because “Make Edge/Face” (F) does the same already
  • Ctrl + M will be replaced by a “Mirror modifier” instead of applying a mirror effect, could be good to have another shortcut for Clipping if possible

UVs:

  • Z key: toogle On and Off the Stretch mode

Linko: If you just re-name the brushes in the pallete and just put a 01Draw, 02ClayStrips etc. just put a number in front of the name, and save it with the default scene file, you don’t have to even screw around with key-bindings, it will just work.

““Cancer: have you tried the Optimize button in Dyntopo? Driver update?””
Sorry to even have put the request here because it’s not even related to your updates. I’m making progress changing settings in the system tab (requires restart to test each one).

Ok it’s updated. :slight_smile:

Thanks a lot for this, makes things a lot easier!

Thanks! very helpful! I add some changes to this UI, Here how it looks like for me :slight_smile:


Floki you should explain why you made those changes.

I have updated the UI based on some feedback, some said that they were too much windows and the 3D view not maximized. It Looks like that:


Fix:

  • the background image is displayed correctly in Maximized View (Shift + Space) on a 1920*1080 display

Change:

  • You start with an empty scene (base meshes moved in other layers)
  • Vertex Slide preserve the UVs, use it for your edge slide for now.
  • Face snapping change the orientation + individual projection for Kit Bashing
  • Drag Dot brush added
  • Texture Mode is Shadeless
  • Unwrap margin at 0.07
  • Game Assets Creation Guide added

Added to the todo list:

  • The Vertex Groups should be “Sorted by Name” by default

I came to this thread expecting another blender fork

Instead it was UI pack

But still awesome