Trying to understand material functions. Does anyone know of any in depth video tutorials on this? I've tried You Tube but only found a couple videos on this.
Well, what do you want to know? They're basically just a bunch of nodes compressed into one custom node. The main difference between making/using a material function to doing everything in one material is the use of functioninput nodes for values you want to control (and then plugging parameters into the inputs). Otherwise, they're just an easy (and more efficient!) way of doing things that you want in multiple materials.
Thanks for the response! I'm just confused with the inputs like the vectors. scalar, etc and how they work. I know how Break materials and Make Materials work though.
Looks like you are using the default gradient blending between vertices to define which texture is shown where.
To get variation in your blending at its very base level, you'll need to multiply your Vines Alpha Map with the Vertex Colour node before plugging it into the 'Alpha' slot of your LERP function.
Thanks dude ill try that but I wanted the the black spaces in the vines to be transparent. Any way to do that? One more thing. Does anyone know why I keep getting this error "error X-4510 maxium ps_5_0 sampler register index (16) exceeded". I get it when I use two vertex blending materials at once using a material instance. I use UE4 $.6
I think the distance field GI in 4.7 is supposed to be screenspace only. Probably not worth using just yet. If you want some quick GI so you don't have to wait on Lightmass diffusefromprobes is probably a better bet right now.
Put something else reflective in the scene, or just assign a different reflective material. See if it reflects similarly. If so, its reflecting correctly, but the environment its sampling from isn't what you're wanting.
Alternatively, what does your roughness map look like? The post processing and lighting intensity in game tends to be very different than in the material editor preview window. If your roughness is similar to the pattern you're seeing there, perhaps turn it down a bit.
The preview window is just that, a preview in a very simple light environment, so its best to start there, but build in such a way that you can tweak your settings in game, since that's the end result you'll be seeing.
Ok, so it might be a noob question and I'll start watching tutorials on Unreal tommorow but why my shadows dissapear after building lighting? I did some search and tried to adjust lightmap resolution up to 1024 but still no luck.
Hey guys, can someone link me the proper workflow for generating normal maps from 3ds max and xnormal that yeld flawless resoults inside UE4?
The official documentation I followed didn't yeld good resoults,I think those infos are outdated... :poly141:
4.7 preview is actually synced with XNormal. Make sure every UV seam is a hard edge before you bake, because UE4 likes to make UV seams hard anyway. And make sure you triangulate your mesh before baking. Then make sure the smoothing groups in UE4 look correct after importing the lowpoly before you even apply a normal map. Obviously make sure that the green channel is flipped either in xNormal settings or after you bake.
Ok, so it might be a noob question and I'll start watching tutorials on Unreal tommorow but why my shadows dissapear after building lighting? I did some search and tried to adjust lightmap resolution up to 1024 but still no luck.
Lightmap resolution of what? The ground under the table?
Hi guys,quick question : I made my terrain inside Worldmachine with the size of 14km. When I import the Heightmap into UE4, how can I tell UE4 that I want the landscape to be 14 km?! (which btw should be 1.400.000 engine units I think)
I'm lost because I don't see a way to specify a precise Landscape size,help pls
Hey is there any way I can change the buffer visualization to show smoothness instead of roughness? In my material I have a 1- node right before my map is plugged in so I'm always working with smoothness because I find it more intuitive but when I use the view mode its backwards from what I'm used to and its really annoying.
4.7 preview is actually synced with XNormal. Make sure every UV seam is a hard edge before you bake, because UE4 likes to make UV seams hard anyway. And make sure you triangulate your mesh before baking. Then make sure the smoothing groups in UE4 look correct after importing the lowpoly before you even apply a normal map. Obviously make sure that the green channel is flipped either in xNormal settings or after you bake.
I'd like to add to this that you should make sure to not export tangents and binormals with your lowpoly, because if you do that Xnormal will read your 3ds Max tangents and then your normal map will be synced to 3ds Max instead of Mikk.
If you always have the Unreal import settings set to "Import normals and tangents" you basically don't need to worry about it (well, unless you have some regions where the normal map is repeated or mirrored) because both UE4 and Xnormal will read the tangents if they're there and calculate them if they're not there. That said, I think it's better to make sure you don't export tangents from Max.
I'd like to add to this that you should make sure to not export tangents and binormals with your lowpoly, because if you do that Xnormal will read your 3ds Max tangents and then your normal map will be synced to 3ds Max instead of Mikk.
If you always have the Unreal import settings set to "Import normals and tangents" you basically don't need to worry about it (well, unless you have some regions where the normal map is repeated or mirrored) because both UE4 and Xnormal will read the tangents if they're there and calculate them if they're not there. That said, I think it's better to make sure you don't export tangents from Max.
Hmm, I know for a fact I did export tangents and binormals from max and imported in UE4 4.7 using "Import Normals" and was able to get the synced image above. So xnormal is overwriting?
OK, here are my results. These are all 128x128 bakes for MAXIMUM SPEED so ignore the ugliness please.
First up I have a normal map baked in 3ds Max with Render to Texture, applied to a mesh that had tangents included, imported with Import Normals:
Obviously not synced. Here's the next one. This is the same mesh exported with tangents to Xnormal and baked there.
Again, obviously not synced. The errors are different, but still present.
If I put a normal map that was baked in Xnormal against a mesh with no tangents exported from Max into the material I get this. (Of course I have triangulated, checked Calculate Binormal in Pixel Shader, the whole nine yards.)
If you look past the resolution there aren't any artifacts that would result from a lack of tangent space synchronization.
Let's look at the normal maps themselves.
On the left we have the normal map from Max. In the middle we have the normal map that Xnormal renders when you export the mesh with tangents. On the right we have the normal map that Xnormal renders when you export the mesh with NO tangents. If you compare the two Xnormal renders, you'll notice that a few of the faces are the same and a few are different. That's 2, 3, 4, and 5 that differ, and 1 and 6 that stay the same. If I look at cube face 1 or 6 in Unreal on the bake that had exported tangents, it actually looks fine, but the bake is incorrect.
Since tangent space calculation depends on UV layout, I'm willing to hazard a guess that the reason your bake looked correct in Unreal is because you had every face in its own island. This is more likely to give similar results between different tangent bases, but it's also not sufficiently representative of a real mesh to be useful as a test.
Just for fun let's import the tangents on the lowpoly mesh and see which normal maps look right.
Here's the Max bake:
Here's the Xnormal bake with MikkTSpace-computed tangents
Blech. And finally, here's the Xnormal bake with the tangents imported:
So to summarize: Always bake in Xnormal. I'm not super experienced at working in Max so maybe there's something that I'm missing, but the normal map didn't seem to be correctly synced to either the mesh with exported tangents or the mesh without exported tangents. You shouldn't export tangents with your FBX because Xnormal will read them and use them to override the calculated tangent basis, giving you a bake that's synchronized to that tangent basis instead of Mikk. If you *do* export tangents with your FBX, be sure to import them into Unreal as well, because then you'll get a normal map that's synced to the tangent basis of the program that exported the tangents. But it's better to *not* export tangents with your FBX and let both Xnormal and Unreal calculate the tangents, because it means that bakes are reproducible regardless of Max/Maya/Modo preference, since you always bake in Xnormal with the tangent space supplied by Xnormal.
This stuff can be really confusing and really easy to get wrong, so it's important to test your pipeline thoroughly and make sure that stuff is working as expected. This means that it's important to test the normal bakes with various UV layouts that are similar to how you would lay out your UVs in a real situation, and inspect as many sides as possible for correct synchronization, because the tangent space might break subtly and if you don't look carefully for it you're toast.
TL;DR instructions: Export your low-poly model with FBX from Max with smoothing groups checked, split per-vertex normals checked if you used an edit normals modifier, tangents and binormals unchecked, and triangulate checked. Bake the normals with XNormal. In the XNormal options for the MikkTSpace plugin, make sure that Compute Binormal in Pixel Shader is checked, and make sure that you bake the tangent space normal map with X+Y-Z+ swizzle. When you take your mesh into Unreal Engine you should make sure that "Normal Import Method" in the import options is set to "Import Normals." When you take your normal map into Unreal Engine you should make sure that the texture compression is set to "TC_NormalMap" so that the engine can read the normal maps correctly. Then you should be able to enjoy 100% mathematically correct normal mapping, no sweat (lol).
If you're exporting your mesh from Blender you should have the FBX options set to Smoothing: Off as this will export custom normals. Unreal will complain at you for not exporting smoothing groups but you can safely ignore it as of 4.7 because the reference MikkTSpace implementation doesn't depend on smoothing group data to compute the tangent basis. It doesn't matter whether you check "Tangent Space" or not because the tangent space Blender exports is the same as Xnormal would calculate. So you may as well leave it unchecked to save some disk space.
So in general with any application or file format, it should be this?
- Export as an FBX or OBJ with no tangent information included, but do export normals
- In Xnormal, make sure the MikkTSpace plugin has Compute Binormal checked, bake in tangent space as X+Y-Z+.
- Make sure Import Normals is checked when you import the mesh into UE4, and the normal map is set to TC_NormalMap. You may get an error that you didn't include smoothing groups.
Pretty much. Note that while you shouldn't export tangents you should export normals in some form, whether that's smoothing groups, Maya hard edges, or custom normals. Also make sure you've taken care of all the usual suspects--for instance put a triangulation modifier at the end of your Blender modifier stack because Blender doesn't have any options to triangulate on export, and of course you should make sure that all parts of your mesh have UVs, and you should probably bake to 16 bits because it's good. If I'm just putting a bake straight into Unreal I'll usually save the bake from Xnormal as a 16 bit floating-point DDS because Unreal unfortunately can't read tifs.
What if I use Modo to bake an OS and then Xnormal to convert to TS? Should I follow these instructions as well so in the converter window when Xnormal asks for low poly mesh mine should be without tangents and binormals etc. ?
Thanks for going in depth JedTheKrampus..really helpful!
Yes, that's correct. Modo can't export its tangent basis yet so you don't really need to worry about that particular thing. Remember to triangulate though (Ctrl+T I think, it's been awhile since my Modo demo ran out)
Yes, that's correct. Modo can't export its tangent basis yet so you don't really need to worry about that particular thing. Remember to triangulate though (Ctrl+T I think, it's been awhile since my Modo demo ran out)
Shift - T. Pipeline IO has an option to triangulate on export if I remember right.
I am having a problem with my skylight. I have a directional light in my scene with a skylight and BP_sky_sphere. In the view port i can see the skylight but when i drop into game it's just using the directional light. Do i have to do something else to get the skylight to work?
Replies
To get variation in your blending at its very base level, you'll need to multiply your Vines Alpha Map with the Vertex Colour node before plugging it into the 'Alpha' slot of your LERP function.
Check out Chris Albeluhn's Vertex Blend Tutorial for some good explanations of the basics.
(Granted this is for UDK, but the concepts still apply.)
The material looks right in preview but totally broken in the main window.
Alternatively, what does your roughness map look like? The post processing and lighting intensity in game tends to be very different than in the material editor preview window. If your roughness is similar to the pattern you're seeing there, perhaps turn it down a bit.
The preview window is just that, a preview in a very simple light environment, so its best to start there, but build in such a way that you can tweak your settings in game, since that's the end result you'll be seeing.
The official documentation I followed didn't yeld good resoults,I think those infos are outdated... :poly141:
Lightmap resolution of what? The ground under the table?
I'm lost because I don't see a way to specify a precise Landscape size,help pls
the table itself. Should the landscape have lightmaps too?
Good to know, thanks! :thumbup:
I'd like to add to this that you should make sure to not export tangents and binormals with your lowpoly, because if you do that Xnormal will read your 3ds Max tangents and then your normal map will be synced to 3ds Max instead of Mikk.
If you always have the Unreal import settings set to "Import normals and tangents" you basically don't need to worry about it (well, unless you have some regions where the normal map is repeated or mirrored) because both UE4 and Xnormal will read the tangents if they're there and calculate them if they're not there. That said, I think it's better to make sure you don't export tangents from Max.
Hmm, I know for a fact I did export tangents and binormals from max and imported in UE4 4.7 using "Import Normals" and was able to get the synced image above. So xnormal is overwriting?
First up I have a normal map baked in 3ds Max with Render to Texture, applied to a mesh that had tangents included, imported with Import Normals:
Obviously not synced. Here's the next one. This is the same mesh exported with tangents to Xnormal and baked there.
Again, obviously not synced. The errors are different, but still present.
If I put a normal map that was baked in Xnormal against a mesh with no tangents exported from Max into the material I get this. (Of course I have triangulated, checked Calculate Binormal in Pixel Shader, the whole nine yards.)
If you look past the resolution there aren't any artifacts that would result from a lack of tangent space synchronization.
Let's look at the normal maps themselves.
On the left we have the normal map from Max. In the middle we have the normal map that Xnormal renders when you export the mesh with tangents. On the right we have the normal map that Xnormal renders when you export the mesh with NO tangents. If you compare the two Xnormal renders, you'll notice that a few of the faces are the same and a few are different. That's 2, 3, 4, and 5 that differ, and 1 and 6 that stay the same. If I look at cube face 1 or 6 in Unreal on the bake that had exported tangents, it actually looks fine, but the bake is incorrect.
Since tangent space calculation depends on UV layout, I'm willing to hazard a guess that the reason your bake looked correct in Unreal is because you had every face in its own island. This is more likely to give similar results between different tangent bases, but it's also not sufficiently representative of a real mesh to be useful as a test.
Just for fun let's import the tangents on the lowpoly mesh and see which normal maps look right.
Here's the Max bake:
Here's the Xnormal bake with MikkTSpace-computed tangents
Blech. And finally, here's the Xnormal bake with the tangents imported:
So to summarize: Always bake in Xnormal. I'm not super experienced at working in Max so maybe there's something that I'm missing, but the normal map didn't seem to be correctly synced to either the mesh with exported tangents or the mesh without exported tangents. You shouldn't export tangents with your FBX because Xnormal will read them and use them to override the calculated tangent basis, giving you a bake that's synchronized to that tangent basis instead of Mikk. If you *do* export tangents with your FBX, be sure to import them into Unreal as well, because then you'll get a normal map that's synced to the tangent basis of the program that exported the tangents. But it's better to *not* export tangents with your FBX and let both Xnormal and Unreal calculate the tangents, because it means that bakes are reproducible regardless of Max/Maya/Modo preference, since you always bake in Xnormal with the tangent space supplied by Xnormal.
This stuff can be really confusing and really easy to get wrong, so it's important to test your pipeline thoroughly and make sure that stuff is working as expected. This means that it's important to test the normal bakes with various UV layouts that are similar to how you would lay out your UVs in a real situation, and inspect as many sides as possible for correct synchronization, because the tangent space might break subtly and if you don't look carefully for it you're toast.
TL;DR instructions: Export your low-poly model with FBX from Max with smoothing groups checked, split per-vertex normals checked if you used an edit normals modifier, tangents and binormals unchecked, and triangulate checked. Bake the normals with XNormal. In the XNormal options for the MikkTSpace plugin, make sure that Compute Binormal in Pixel Shader is checked, and make sure that you bake the tangent space normal map with X+Y-Z+ swizzle. When you take your mesh into Unreal Engine you should make sure that "Normal Import Method" in the import options is set to "Import Normals." When you take your normal map into Unreal Engine you should make sure that the texture compression is set to "TC_NormalMap" so that the engine can read the normal maps correctly. Then you should be able to enjoy 100% mathematically correct normal mapping, no sweat (lol).
If you're exporting your mesh from Blender you should have the FBX options set to Smoothing: Off as this will export custom normals. Unreal will complain at you for not exporting smoothing groups but you can safely ignore it as of 4.7 because the reference MikkTSpace implementation doesn't depend on smoothing group data to compute the tangent basis. It doesn't matter whether you check "Tangent Space" or not because the tangent space Blender exports is the same as Xnormal would calculate. So you may as well leave it unchecked to save some disk space.
- Export as an FBX or OBJ with no tangent information included, but do export normals
- In Xnormal, make sure the MikkTSpace plugin has Compute Binormal checked, bake in tangent space as X+Y-Z+.
- Make sure Import Normals is checked when you import the mesh into UE4, and the normal map is set to TC_NormalMap. You may get an error that you didn't include smoothing groups.
Is that right?
Thanks for going in depth JedTheKrampus..really helpful!
https://www.unrealengine.com/blog/ue4-is-free
Get some!
Shift - T. Pipeline IO has an option to triangulate on export if I remember right.
[ame]www.youtube.com/watch?v=0zjPiGVSnfI[/ame]
[ame]https://m.youtube.com/watch?v=0DG51glKipU[/ame]
I have just started playing around with UE4.
I am having a problem with my skylight. I have a directional light in my scene with a skylight and BP_sky_sphere. In the view port i can see the skylight but when i drop into game it's just using the directional light. Do i have to do something else to get the skylight to work?
Not sure how to embed Youtube on Polycount?
www.youtube.com/watch?v=clakekAHQx0&feature=youtu.be&t=14m42s
Anything else or extra and it won't work.
[ame]http://youtube.com/watch?v=clakekAHQx0[/ame]
When things they show in in it will be fully implemented and available for everyone. Somethings will be in U4.8 but I suppose not everything.