How To Get Smooth Clean Normal Map Bakes In Blender Cycles
If yous happen to be new to the baking procedure in Blender see the end of the commodity (problem five!) for tips on generating a unproblematic normal/bump map from both a shader and another object.
Hi, Aidy Burrows here, bump map creation can itself be a bumpy ride and as for normal maps? Who can say what normal really is anyhow?!
Well, actually in this context probably a mathematician could easily tell us BUT! The signal is from an artist's point of view at that place are some bumps to navigate so the process tin can exist smoother (gotta love a 3D pun to go us started!)
BEWARE! Before nosotros let our guard down subsequently some slick puns allow's not forget why we're here! The dangers of crash-land/normal maps are that we don't directly see them like nosotros would a color map, instead we come across more how the light billowy off the surface has inverse because of them.
That ways it isn't always immediately obvious what the problem with the bump/normal map might be, where the problem stems from or how to gear up information technology. So to immunise ourselves to all of this we're going to agree these bug betwixt tweezers for inspection!
CONTENTS
Problem 1 – Default image settings
Problem 2 – Colour Spaces in multiple menus
Problem iii – File types
Trouble four – Oversharp bump artifacts
Problem 5a – Baking from a shader
Problem 5b – Baking from an object
Trouble i: The default epitome settings i.e. 8 bit images aren't optimal for normal/bump images.
Here are our default new image settings below, observe the unchecked 32 bit float checkbox meaning our new image volition be 8 bit.
If we leave everything every bit is and bake with this default lower bit depth, we tin can get problems such as these…
Observe the strange swirly mosaic tiled look to the middle cube. Those artifacts aren't there without the normal map (on the left) or on the high resolution mesh that was used to bake the normals from (on the right).
Here's some other example using an 8 fleck bump map on a simple plane…
On the left is the texture we're using as a bump map for the plane in the viewport on the right. Over again we can see the 'banding' artifacts.
We are request a lot of our textures here though seeing how the object is so clean, smooth, defined and shiny. If on the other paw your material is actually quite rough and/or grungy oftentimes nosotros can hide these banding artifacts on the normal map…
Higher up is that aforementioned central cube from before simply instead of a very depression roughness setting of only 0.05 hither nosotros're hiding a lot of the artifacts in the 8 chip image with a roughness value of 0.4
And so in conclusion for proper versatility make certain we have that 32 chip float checkbox enabled for crash-land/normal maps!
Now nosotros take the bit depth out of the way let's move on to…
PROBLEM 2: In that location are unlike 'color spaces' which can be gear up in unlike editors that we demand to brand sure we get right (again the default settings don't help us here).
Hither in this next epitome y'all'll run across 2 editors on top of each other. On top nosotros take the paradigm node selected in the shader editor and below the normal map texture existence used in the image editor. This is what the cube was using earlier to show the viii bit texture problem.
Find in each of those editors we accept the properties console open (toggled with the 'Northward' shortcut key) and highlighted is where we can set the 'colour-space' of the image.
Let's ask ourselves, volition this be plugged into any color sockets on our shader? The answer is – NO! So we need to remember this is 'non-colour' data.
viii BIT
For an 8 bit image, Blender will probably default the color space hither to 'sRGB'. Which means that the image is not being treated as merely data, so we need to counteract that. Luckily that's pretty easy to do because in the epitome editor we have a pulldown menu that we can ready to 'non-color'.
The thing to bare in mind at that place is that in gild for this normal map to shade properly we need to explicitly tell Blender in the shader editor that this prototype should NOT be treated as a typical color image. That whatever values are stored in the red, green and blue channels accept been altered (by the sRGB contour) to something we don't desire.
You lot might be wondering WHY are they altered? Well, very basically this is because information technology makes the texture more than useable for the monitor and more than pleasing and intuitive to the human being heart.
Every bit we know though this texture isn't to be directly seen by the homo eye, this is for altering normals, so we want to reverse the changes of that color space. That's what the 'not-color' option on the paradigm node is doing!
PRO TIP!
If we want to command this manually ourselves we tin simply add a gamma node ready to 0.454 (linear to sRGB) or 2.ii (sRGB to linear) instead of switching that non-colour setting.
I final note on this (which may change down the line if this is a bug!) if you switch the color space in the image editor from sRGB to 'not-colour' at that place. Then you may notice that switching the colour/not-color toggle on the image node in the shader editor actually has no upshot at all. (If this isn't a bug maybe greying out that selection to indicate it isn't relevant in that case could assistance clarify things)
32 BIT
Here it'southward probably worth mentioning that there may be a couple of things that stop up being inverse by the developers or potentially (and understandably) there are some bugs in the electric current two.80 beta ointment. Whatever the instance, what follows here should exist the most robust and consistent mode of working with 32 fleck images to go what we need.
For a 32 chip float image, blender will probably default the color space to 'linear' instead of 'sRGB'.
It is fine to use linear color space only as I mentioned in that location are some bugs lurking, i've had it sometimes flip on me where instead of setting the image node to 'color' i've needed to fix information technology to 'non-colour'. Spooky! So I recall seeing how not-color space is intended for textures like normal/crash-land maps anyway permit'due south just stick with that!
Note: If nosotros change the color space in one editor it'll reverberate that modify in the other editor.
So utilise non-colour space for 32 bit, simply yous may discover (for now anyway) that the non-color/color toggle of the image node might and then not do annihilation.
Here's how a baked normal map will show up in 32 fleck non-color infinite.
Remember as mentioned before if we want to control this manually ourselves we tin just add a gamma node prepare to 2.2 (sRGB to linear) or 0.454 (linear to sRGB) instead of switching the image node from 'color' to 'non-color'. In fact, the color/non-color pulldown on the epitome node actually doesn't currently do anything now that nosotros've set the color infinite in the paradigm editor to 'non-color'. Again I suspect this issues may well exist sorted any moment.
One interesting affair to notation is that the 32 bit normal map looks a flake stake and lighter than we're used to. Information technology would exist useful to be able to view information technology in the more than typical darker shades like we had with the 8 scrap prototype and I wouldn't be surprised if that choice returns soon too.
And so in decision, this is fairly elementary to recall as we're setting the image itself to non-color and the prototype node that goes into the normal map in the shader editor to 'non-color'. The only exception i've found is that when near to bake and generate the normal map itself, the paradigm node that y'all have selected to tell Blender to bake to that image can be left at its default 'colour' setting.
Subsequently we've created our working normal/bump maps, we'll probably want to save them so that leads us to…
Problem three: Which file format/settings are best to use to save the crash-land/normal maps externally?
Equally nosotros know, for an ideal texture nosotros need the full bit depth. But what images can we salve to and still look to keep all that information in practiced shape?
After we've generated our normal map, from the image editor we'll want to go Image > Relieve a copy… (don't utilise 'save as' because if yous choose the incorrect filetype there's no going back!)
That will prove us all our potential filetypes…
Annotation we're just using 'RGB' so we'll be saving using that, 'RGBA' would be required if we also desire to save out the alpha channel which we're non doing in these examples.
In the below comparison, allow's take a look at using the same normal map that was baked for the cube above (the unsaved generated 32 chip version) compared to the results of saving that out as 8 bit and 16 scrap PNGs….
(note : if the gif image above seems to be skipped over, this may exist a Firefox effect)
Every bit we can encounter the 8 bit PNG image shows those artifacts nosotros've spotted before, only the 16 scrap PNG seems to be well-nigh identical to the full 32 bit generated bake.
I did some farther tests and noted some filesizes below. Information technology seems pointless to upload the images and display them here as all 16 bit or to a higher place tests looked identical to the generated 32 fleck broil also!
(all examples are for a 1024 x 1024 texture size)
8 bit png = 117 KB
xvi flake png (default xv% compression) = ane,080 KB
16 chip png (0% compression) = half dozen,156 KB
xvi bit png (100% compression) = 792 KB
32 bit (Full bladder) OpenEXR (no codec) = 12,305 KB (Largest!)
32 bit (Full float) OpenEXR (Zip lossless codec) = 4,350 KB (Smallest lossless option)
32 fleck (Total float) OpenEXR (Pxr24 lossy codec) = 637 KB (Smallest lossy pick! Not including 8 bit)
Note for OpenEXR there are even more codecs to attempt in the pulldown carte, so if space is a business concern y'all may find different codecs clasp that image file down even smaller and with no noticeable loss of what you need that paradigm to do. Get chase the all-time of both worlds!
For the PNG xvi bit file compression can exist useful here. The aforementioned results but differing filesizes, depression compression generates a faster file but at a larger size (nearly ten times larger!), and vice versa for high pinch, something useful to blank in mind if generating lots and lots of frames in an animation as that compressing time can add together up!
If for some reason we need the texture in the highest possible fidelity nosotros tin possibly salvage out to, and so this is where OpenEXR comes in for full 32 chip juicy potential. Again there is a price to rest as the filesize is double the size of the uncompressed PNG.
For the codec selection nosotros can have 'none' for the raw info just that will be the largest filesize bachelor. I'd recommend trying Pxr24 to come across if you can become abroad with a much smaller filesize. I've tried this previously and had duplicate results from the raw version at a fraction of the size. In fact in this case that ends upward existence the smallest filesize of them all! (Not including the eight flake paradigm of grade!)
PROBLEM 4: An undesirable sparkly/jagged overly sharp blitheness
Sometimes the crash-land node has a kind of wait to the shading in Eevee that can be problematic in animations. So we may demand to know in those occasions how to swap those bump/elevation textures out for a normal map instead.
On the left of the comparing in that location you should be able to make out that sparkly overly sharp await when compared to the correct side, especially in the final few seconds. The best bet is to watch in full screen and make sure information technology's set to playback at the highest resolution. Otherwise compression might be obscuring the truths!!!
So every bit shown a height map used for a bump node and that same pinnacle map converted to a normal map and so plugged in a normal map node volition shade differently. That is something we may need to bare in listen, to the point where nosotros may want to tweak the shader settings, the specularity of lamps and the bump force to make them look more like to each other.
And so in conclusion, despite the extra care sometimes needed to alter settings and have the normal map give a closer overall result to what we were already getting with the crash-land node, information technology's yet worth it for the especially helpful way it tin eliminate that overly sparkly/jagged/abrupt look.
PROBLEM 5: How to fifty-fifty bake a normal or a bump map anyway?
There are 2 methods I'd like to become over for baking some simple normal or bump maps.
METHOD 1 – BAKING FROM THE SHADER
Get-go let's accept a wait at what is probably the simplest. Here I've got a simple 2nd plane, on that plane is a whole network of procedural textures such every bit racket texture nodes working together to create the top map going into the bump node for this shader.
Instead of all those nodes (which create that texture on the right) I want to bake all that bump information down into just 1 single texture.
1. UV Unwrap
We may have some UV's already which you can check in the UV prototype editor. Yet, assuming we don't for some reason, or they need to be changed let's caput over to the 3d view. While in edit way, press A to make certain everything is selected and so press 'U' for the unwrap carte (come across below), for a elementary aeroplane several of these options will requite us what we demand.
For 3D geometry the 'Smart UV project' option is a good one (again which too would work fine for the 2D airplane), and then if unsure give that a try.
Here notice i'1000 in the UV Editing workspace and in the uv editor on the left we tin meet the orange selected outline of the uv'south filling the entire grid infinite. A simple plane clearly won't waste matter any texture space!
two. Create an epitome to broil to
There are several ways to create images in Blender, let's exercise information technology this time from within the shader editor. I'll switch the workspace (from UV editing) back again (every bit the previous workspace had the shader editor on the left) and then I'll zoom in to get a better look at the nodes and go Shift A > Texture adding in a new 'Prototype Texture' node.
Click 'New' on the image node…
and from in that location we tin name it, set the resolution and choose '32 bit Float'.
One time the new image is created, open up up the properties sidebar with 'N' and find the 'properties' department, here we can change the color infinite from 'linear' to 'non-color'. Note we can confirm this is 32 bit past looking at the checkbox next to 'Float Buffer'.
The image node doesn't demand to be hooked up to anything it simply just needs to be present in the shader editor and so that we tin select information technology and let Blender know this is the image nosotros want to overwrite when we hit the bake push (in a moment!).
3. Bake
Ok, nosotros're ready to bake! Eevee doesn't have options to broil as I write this so in our principal properties window on the return settings tab we'll make sure our render engine is gear up to 'Cycles'.
Also on the return tab at the bottom we'll find the bake settings themselves.
Note also the samples in the sampling section are simply set to '1', that'll be useful in a moment just not relevant while blistering our normals.
NORMAL
If I want to bake the bump information of the shader into a normal map, I can keep the shader setup as information technology is. In the broil settings only select 'Normal' as the bake blazon.
Then with a quick glance that the right image node is nevertheless selected in the shader editor (the ane i've chosen 'broil to me' two images ago) we hit the bake push.
That's it!
All's that's left is to save the result somewhere. (Meet Trouble 3!)
Crash-land
If instead we want to bake the crash-land data, then we create an emission shader and claw what is going into the bump node up to that emission shader and that would need to hook into the main material output.
In the bake settings nosotros can so select 'Emit' equally our bake blazon and then every bit before we're ready to striking the bake button!
Note: Something to keep in mind is that the rendering process for the Emit pass (and several other passes for that matter (but not the normal pass!)) will take the render samples into account. Then since we only need 1 sample for the emit shader to requite us everything nosotros need, to save needlessly wasting baking time we can set that down to just one pass in our render sampling settings.
METHOD ii – Baking FROM Some other OBJECT
The first 2 steps are the same equally baking from the shader. So meet to a higher place for more details.
1. UV Unwrap
ii. Create an image to broil to
three. Bake
Hither's where things start to diverge a petty, to broil from some other object we'll need to enable 'selected to active' in the baking panel and set up the ray distance. In this example about 0.2 seems to piece of work just fine. Though if afterward baking it doesn't expect quite right, attempt irresolute this ray distance setting to a higher value.
To really perform the bake we demand to select the object we want to broil from (typically some college resolution mesh) and so shift select the object we'll be baking to (so that it becomes the active object and therefore our target mesh).
Then as before make sure we have the correct image node selected in the shader editor and and then hit that bake button!
It may feel like we've covered a lot, I call back we should congratulate ourselves on putting in the time to read through all this. Sit back, relax and as a reward I suggest reminiscing about the good old times, like all the stuff we came across in this article. The master takeaways forth this adventure were these :
- 8 flake (i.e. the default option) needs to be changed if nosotros're to become normal/bump maps that are useable in the bulk of cases (i.east. shiny and clean and not grungy and rough surfaces)
- When generating your 32 bit bladder textures for your crash-land/normal maps, set up them to non-color in the image or node editor
- When ready to non-colour in the paradigm editor colour space, the colour infinite setting of the image node in the shader editor can be ignored. This maybe a footling buggy though so continue an middle on this.
- If you want the about information of all saving into your image texture then use an openEXR format (Float Full) – Sometimes you tin can salve a lot of space if you try a lossy codec such as Pxr24.
- If relying heavily on crash-land nodes in Eevee and detect at that place is a lot of undesirable sparkly/jaggedness to the animation then try swapping the crash-land map out for a normal map.
- Reference for a couple of easy means to broil out normal/bump maps.
Encounter you out there on the open road to endless 3D possibilities!
Aidy on Twitter – game development veteran and overenthusiastic tutorial maker using a whole lot of Blender and UE4.
Source: https://www.creativeshrimp.com/normal-map-blender-tutorial.html
Posted by: jonesearand1988.blogspot.com
0 Response to "How To Get Smooth Clean Normal Map Bakes In Blender Cycles"
Post a Comment