Unreal Engine 4.26. Alembic Hair. Q&A Part 3. Official answers from the community.

Nov 17, 2020 09:33 · 4678 words · 22 minute read linked also faced houdini 37

Hello everyone! With you - Andrey Krivulya Charly And this is the third part of the official responses from Epic Games Regarding “Alembic Hair” and “Grooming Plugin” in “Unreal Engine 4”. In this video - we will talk about how to: Dye the hair bundles and their ends in different colors - in Ornatrix. Import this into “Unreal Engine 4”. Fix “alembic scripts” error for “Xgen” hair export. Draw “Vertex Paint” in Xgen. Fix the “Roughness” problem. Fix chaos on eyebrows and other hair on the face. Use animated alembic with “Groom Plugin” And export hair from “Houdini”.

00:39 - Also, if you want to support this channel, then: Write a comment and like this video. Subscribe and share it on your social media. This is very important for its growth. Buy any of the plugins from the links in the pinned comment. Also, buy any of the models from my CGTrader, Artstation Or buy any of the prints - there. So. This video was released with the support of Alexey Savchenko, Olesya Primakhina, Andrey Dronin, Stas Starykh Charles and the whole “Unreal Community” + Simon Barrionuevo and Nick Rutlinh.

01:12 - So, if you are actively developing something in “Unreal Engine” and you have questions about licensing, development of your projects or cooperation with Epic Games, then you can contact Alexey Savchenko. He has a Youtube channel, which I linked to in the pinned comment. There is a lot of useful information here on all these topics. Many interesting interviews and so on. Alexey releases videos every day. As for Olesya Primakhina, you can refer to her regarding the licensing of the engine for both games and an enterprise. The easiest way to find her is on Facebook. I also attached the link to the comment.

01:49 - Andrey Dronin is the editor of UE4Daily magazine. There you will find all the most interesting - with regard to this engine. Stas Starykh is the creator of the “VR Professionals” channel and a consultant on the “Unreal Engine 4”. Simon Barrionuevo shared scenes for answering questions. Nick Rutlinh has created a great hair and wool shader tutorial. Well? Are you ready to absorb some interesting information? Let’s go then! So. Let’s talk about: How to dye hair in Ornatrix without using maps and UV coordinates? Then we export it to “Unreal Engine”. Create a “plane” of any size and rotate it that way. I do this so that you can see that I am not just drawing on a plane using “Vertex Paint”. And I use a direct selection of hair and their coloring.

02:40 - Is it possible to do this in “Xgen”? I do not know for sure. When I asked about this on Facebook, in the CG Grooming Artist group, my colleagues Michael and Frankino gave this answer. As far as I am aware xgen core does not support painting on hair strands, The paint tool is UV based (Not vertex based). Expressions can be used to blend multiple maps alone the hair length though. With xgen IGS you can “Paint” things like scraggle on hairs but its more of a fancy sculpt brush than actually painting attributes As far as I know, with Xgen-core Is not possible to paint directly on the primitives as you did in your video.

03:19 - Probably it can be done using seExpress, but I’m not that good with the xgen scripting language. So guys - I’m showing it in Ornatrix. So, first we install the latest build of Ornatrix v3. It just came out recently and a lot of cool features were added there. Naturally, the interface has changed a bit, but I will not dwell on an overview of all the functions now, since the lesson is not about that. So, in short, you need this tool to draw guides and create hair.

03:51 - Before starting this task - do “Freeze Transform”, “Reset Transform” and “Delete History”. Then select the tool and draw the hair. Just before that - be sure to remove the selection from the object. We draw several clumps with which we will work. Next, open the Ornatrix modifier stack and add a “Clump” by guides. Remove “Flyaway hairs” as we don’t need them now and will only distract. I say right away that this is just an example for lesson and not a full-fledged hairstyle. Then go to “ChangeWidth”. And change the value of the “Width” parameter to 0.1 In order to avoid flickering in the “Unreal Engine”. Set 100% hair display to “Viewport”. 10,000 hairs will be enough for this tutorial, so don’t change this value. Then on top of the “Clump” add another “Edit Guides”.

05:14 - This is to enable editing of the resulting hair, not the guides. That is, here you can already do all operations with full-fledged hair, and not with guides. So, for hair coloring - you need this tool. Select it and immediately turn on the option in “Tool Settings” - “Affect Selected Only”. Then go down below and in the “Target Channel Name” enter “groom_Color”. This will create a special “RGB Channel” that will be used by the “Unreal Engine” to convey the color of the vertices. And now, to start drawing on the selected clump - you need to select it in “Edit Guides” Activate the painting tool again. Choose the color you want and start painting. Then choose different color and paint the tip. Now it may seem to you that something is not working.

06:24 - But in reality, the color is just different because of the highlight. If you invert it, you will see the natural color you painted with. Then we start painting the remaining clumps. For example, I’ll make them yellow, and the tips will be different colors. Thus, we get the following result. And now the question. How do you export all this to “Unreal Engine”? So, firstly - you can see which channels were created in Ornatrix for export.

07:49 - To do this, select “HairShape” and open the “Viewport Hair Display” tab. And here we see 3 channels. They are exactly what will be used in the “Unreal Engine” to convey color information. Secondly, to export this hair to “Alembic” - select “HairShape” and go to the “File” menu. There we select “Export Selection”. In the window that appears, in “File Type” - “Ornatrix Alembic”. And at the very bottom of the list of options - be sure to enable “Unreal Engine Export”.

08:16 - Next, click on the “Export Selection” button. I will name this object “test_Color_Ornatrix”. With this amount of hair, the export will be quite fast. Now I will remove the hair and export the plane to normal “FBX” format. That’s all we need. Now open up the “Unreal Engine”. I will show version 4.26.P.4 as it is the newest version at the moment and it has many changes regarding the grooming plugin. For the final version - the developers showed such a list of the changes made. That is, it will be 100% out of beta and there will be a final release of the “groom plugin”. Lots of improvements for performance, rendering quality and usability. Generation of lodes for strands, cards and meshes. New grooming editor. In a pinned comment - I’ll post a link to this video.

09:26 - And you can find out all the details regarding the new products for this plugin. So, let’s start importing the plane and “Alembic Hair”. When importing grooming, I leave all the default settings for now. Place the plane in the scene. In its settings - we reset all coordinates for the “Location” parameter. Next, add the “Groom” component. Assign the Nick Rutlinh material that I showed in the previous tutorials. And in the “Groom Asset” drag the imported “Alembic”. As you remember from the previous tutorials - “Ornatrix” and “Xgen” the hair is imported with the wrong axes. In this case, so that I have everything right, I entered a value of 90 for the “Rotation X” axis. “Rotation Y” = 180. And “Scale X” = -1. As a result, I get the same object. As in Maya. Now you can re-import with these values. I think that you all remember from the past lessons - why we are doing this. And in 4.26 they promised to fix the error with “Scale X” = - 1. Now let’s check this moment.

10:53 - After import, we reset all the values ​​that we changed. As a result, we see that everything is OK. Now, in order for “Unreal” to see the colors that we painted in “Ornatrix” you need to go to the “Master Material” and add another “Switcher” node named “Use Vertex”. Connect it to “Base Color”. But that is not all. If you remember, in the previous lesson - we added a group of “Albedo Texture” nodes. Which was responsible for loading the regular texture into the “Albedo” slot.

11:42 - Now, connect the “Lerp” node that belongs to this group to “False” the “Use Vertex” nodes. That is, when you turn off the “Use Vertex” option, you will turn on the use of the “Albedo” texture. When you enable this option, the opposite is true. The “True” mode is activated for you. For it, we create a group of nodes of this type. First, copy “Lerp”. For it, the “Texture Blend” parameter is also useful. And of course - we duplicate the “Hair Attributes” node. But for the “Vertex Color” we do not need the “Root UV” slot, but the “Base Color”. It is precisely this slot that reads all the information from all the channels that we have created in Ornatrix. We connect this slot to “A” of the “Lerp” node. And in “B”, as usual - “Use Dye”. That is - the same connection as in the last lesson.

12:50 - Thus - you add another parameter to the “Instance Material”, which can be activated. Then in the “Viewport”, you will see all the colors that we painted - after compiling the shaders. That is the same result that we see in “Maya”. How to do the same in Xgen? I already said that I don’t know. Because even with the “Vertex Paint” channel - I didn’t get what I wanted. Maybe I am doing something wrong and I have already asked this question to the developers. Now, I want to show you how to activate “Vertex Paint” in “Xgen”. And how to finally get “alembic scripts” to work through the command line. The same ones that I showed in the previous lesson. I was finally given an answer on how to fix the export and import error.

13:58 - It was in Artstation that Nick Shepperd asked a question regarding the use of this script on large scenes. When the usual methods that I showed in previous lessons do not help in this situation. You can read about what Nick encountered by the link in the pinned comment. But then, when he wrote this post - I did not know the solution to the export problem using the command line. And now I will tell you how to solve it. But before that, I’ll show you how to use “vertex paint” using the method I learned about.

14:29 - And maybe then the developers will tell us how to export it. So, I will be showing the same scene that I showed in the previous lessons. Basically, it doesn’t matter now what you create for your tests. Then go to “Preview Output”. Go down below and you will see the “Custom Shader Parameters” tab. Here you can add a custom mask or “vertex paint” channel. And then I thought, what if I create the same channel with the same name as in Ornatrix. Opposite “name” select “Color” and write groom_Color. Then click on +. As a result, you will have a parameter in which you can activate “vertex paint”. Next, click on this icon. In the window that appears, go to the “Samples” tab. Then in “Global-UI”. And in the list that appears, select “map_vertexcolorpaint” As a result, you will automatically have an “expression” added, which will add drawing by vertexes. After that, we press “Accept”. Now you have this icon.

15:35 - If you click on it, you can draw in vertices. By the way, I still haven’t figured out how to delete other created channels. After we painted the color - click on the save icon, which is next to “vertex paint” And logically, all “Expressions” with the shader that we create - should be exported to “Unreal”… But no… Now you will see for yourself. I don’t know, maybe I am doing something wrong. Just about this - I’m waiting for a response from the developers.

16:13 - In the meantime, save the scene and start fixing the error during export in the script - via the command line. Then, as usual, run the command line as an administrator. We indicate the disk where the scripts are located. I think you remember this from the previous lesson. After that, as usual, we insert the path that I attached to the archive with scripts. Since I saved the scene in Maya 2020, I’m changing 2018 to this version. Move the blinking cursor to the end of the path and press “Enter”. As a result, the script has been launched, and now, please repeat all the steps after me VERY CAREFULLY. In the “Project Directory” specify the path to the “workspace.mel.” In Scene File and Model File, the path to your Xgen scene. Click “Refresh”. And now please - LOOK VERY CAREFULLY.

17:30 - We have compiled and now “description1” appears in the “Guides” and “Interpolated” fields. If you called your “description” something else - this name may be here. And what did we do in the last video? Highlighted and enabled the “description1” in “Interpolated”. And it was precisely because of this that the error occurred. Because this option creates two groups. And in this case, we need one group. The developers did not explain why to enable this option, since this is not an official script and there is no documentation on it yet.

18:01 - For experiments are underway to find the best solution. Therefore, at the moment, so that everything is imported correctly, they recommend disabling this option… but be sure to make it selected. That is, select “description1” in “Interpolated”. Select the same one in “Guides”. Then we indicate the path - where we want to save “Alembic”. We write the name of the file. After that - we press export and in the end - everything will pass without errors.

18:32 - The desired “id” will be assigned and so on. That is, everything should now work. Let’s check this point in “Unreal Engine”. Add the same plane that we used with this “Alembic”. Then we connect the “Groom” component to it. Drag the exported “Alembic” into the “Unreal Engine” and see that the error has disappeared in the status: “valid”. Which allows us to import this file without errors. Click “import” and drag this file to the “Groom Asset”. Then we assign “Hair Shader”. As a result, we see that “Vertex Paint” was not imported. But that’s another problem. Perhaps not even in “Unreal Engine”, but in “Xgen” itself. Of course, I asked this question to the developers and of course I am waiting for an answer to it.

19:37 - But something tells me that the problem is clearly not in “Unreal”. After all, “Xgen” has not been supported since 2016. Therefore, it is possible that what we did in “Ornatrix” will not work in it. By the way, in the new 4.26 the “Groom” settings window has slightly changed. And we will definitely talk about them - in the next videos. Also, the color from “Albedo” works without problems. I remind you to enable it - you need to go to “Instance Material” and turn off the new option. I also remind you that in “Master” these nodes are not needed for “Xgen”. That is, just plug the “Root UV” into the “UVs” “Albedo” slot of the texture. But I have already shown this in previous videos.

20:16 - These nodes are only needed for the “Ornatrix” hair. So, the issue with the script is resolved. That is, this is the answer to this huge question. Also, I want to show a specific official answer from the developers. As usual, this is the answer from Charles and it sounds like this. Unfortunately, there is no other method in vanilla UE to produce these root UVs data. This something we could do in a future release. To which I answered in this way. So, as I understand it, you will improve the script and share it in the “Unreal Engine Docs”. Will you also improve the importer in the next releases? Charles further responded in this way. No. There are no plans for this. We might improve things to make it easier (no needs for special export), but we have no concrete plan at this stage. So don’t plan according to that.

21:10 - I think that it will become known when the official version 4.26 is released. So, let’s move on. So I think you remember this boy scene by Simon from the previous videos. And there I talked about the “Roughness” problem. This does not work exactly the same as in “Arnold Renderer” and I was finally given a few more answers regarding this problem. Also, I follow the progress with Simon. At the moment, his team is getting such a result.

21:37 - It was when he threw this video to me that he said that he had found one setting that helped improve the result a little. + my answers gave a certain boost. Also, he showed two such screenshots. The first shows that “Roughness” is working as it should. And the second is the settings for this shader. He found these settings at Tsabasa Nakai. I will definitely link to them in the comment. This is the same shader from “Nick Rutlinh”, so by repeating these settings, you will get a nice working version.

22:37 - But, I have official developer answers regarding the “Roughness” problem. I think you remember my conversation about how I sent a video demonstrating “Arnold Shader” to the developers and comparing it to “Unreal”. And the first answer from Charles goes like this. Just to give a quick update on this. A while back I did some tests with your scene. By settings the base color to black, I was able to get some reasonable black hair.

23:07 - Here are the result with a single light (with different roughness) In these images, we can see that black is working and with “Roughness” everything is ok. But Charles tested black (one of the problems described) But the main problem is colored hair. He also wrote the following text for these images. Part of the issue seems to come from your material setup, as it looks like quite lighter when I used the original material. That said, the more light you add, the more direct reflection highlight you get, and the lighter the hair will be come.

As well, the more rough the light will be the lighter the hair will become. I continued the dialogue with this message. So is this a problem in my material or version 4.25? I still didn’t get it. If in my material, what do I need to fix? How to improve it so that the result is close to “Arnold Renderer”? How to avoid losing hair color with a lower “Roughness” value? Charles replied, “There are probably several problems.” On one hand, in the example I show you can achieve some black appearance.

24:12 - So it means that there are probably some thing in your shader which prevent the color to go to pure black. I don’t know, you will have to investigate yourself. On the second hand, it won’t be possible to achieve the exact same look as Arnold at the moment for quite a few reasons, but mainly because of approximation we make in our hair shading. To get a bit more context, (I don’t have maya/Arnold locally so I can test your scene), but how do you setup your hair material in Arnold? Do you have a diffuse component? Would you be able to post a screenshot of your shader setup to give me an idea how it looks like? Of course, I showed such screenshots, explained everything, recorded a video. Also shared the “Unreal” project. In general, I wrote a lot of useful text, which, I think, helped to understand all this.

25:02 - And the next answer from Charles was like this. I don’t have a good answer to this problem, unfortunately. The specular highlight will be less dominant in the next release, and maybe we will add more control about the ‘diffuse’ part. But this is not sure yet. So the answer is - wait for the fixes in the official hair shader and everything will be fixed in 4.26? We did some slight change related to shading in 4.26, especially regarding the reflection term. The ‘white’ look should be less strong.

25:35 - In general, we are all waiting for the official release, since I think you remember the screenshot that I showed with the list of changes. And in this version - there will be a lot of cool improvements. Then I received a notification that the ticket was closed and I asked why it was closed. This message was answered by Kevin and the answer goes like this. This ticket had 21 days of inactivity and Charles last response indicates that your material setup contains changes that possibly interfere with the expected result.

26:08 - So I’ll have to talk to Nick Rutlinh about this and ask him to see the settings. And maybe he will also fix some points in his shader and understand what the main problem is. So Nick, I’m talking to you. After watching this video, please see what can be changed in the shader. I only recommend doing this in the official version 4.26. Further, Kevin’s message goes like this. We don’t have the resources to develop complex materials for each customer, but we’re more than happy to respond to bugs you find them.

26:37 - In this case I recommend that you start removing things in your material to find the root cause of the issue and report that as a new ticket if you find an actual problem. The best repro cases are the ones with nothing but the problem showing, that eliminates the possibility of other things being at fault. If you need more info on materials in UE4, there are plenty or resources online, including https://docs.unrealengine.com/en- US/Engine/Rendering/Materials/index.html Keep in mind that Hair is an Experimental feature in 4.25 and therefore there is limited documentation available publicly. You would have to wait until 4.26 if you want more public resources on the topic.

27:18 - This is what the official response from Epic Games is about the Roughness problem. I hope that Nick will find a solution to it too. But as I said, it seems to me that we should first wait for the official release of 4.26. And see what material Epic Games does themselves. And on the basis of this - already make your own material or use what they will have by default. On this issue - I have everything. Move on… The next question was asked in Artstation by Christian Hecht. He gave a link to his post on the “Unreal Engine” forum, I will also pin it in the comment. The problem is that when applying “Bound to Skeletal Mesh” on eyebrows and other facial hair A bug appears that distorts the entire shape. In the same place on the forum - Christian indicated links to other users. Who also faced this and that this problem even exists in version 4.27.

28:11 - The official answer from Charles from Epic Games is as follows. Unfortunately, this is a known issue. This is because we are storing strands position data in 16bits which means limited precision. To compensate for this we express these positions relative to a reference point. This reference point is the center of the bounding box of the groom by default. However, when the groom is attached to a skeletal mesh we use the center of the skeletal mesh.

28:42 - If the skeletal mesh is large, its bounds center could be far from the groom, which would cause this kinds of artifact. For hair on character one workaround is to have a separate mesh for head, and for body. This way the head bounds is relatively close to the hair, and it will improve hair position precision. The next question was from Flavio under my previous Youtube video. It sounds like this. I tried to export a specific rig from “FBX” to “Unreal”, but it didn’t work as expected. So I had to export it as an animated “Alembic”. Q: Can I attach the “groom” in Unreal to an animated “Alembic”? I asked why it doesn’t work with FBX. To which he replied. This is a complex rig of a cat with facial expressions and when I tried to export it to “Unreal” I saw a lot of errors. Any suggestions on this? I did not solve the issue with FBX, as I was answered in “Epic” about “Alembic”. And the official answer from Charles is. Yes it is possible. Make sure to enable “Import as Skeletal Mesh” when importing the “Alembic” file.

29:49 - After import, it will look like a regular “Skeletal Mesh” that works with the “Groom plugin”. The next question from Gabriel on the Facebook group is about the export from “Houdini”. I will also link to it in the pinned comment. There you can read this text. Also there below - Gabriel and Nick are in dialogue And they found some solution to this issue and you can read everything by clicking on the link. I passed this correspondence to the developers and received such an official response. Anousack Kitisa answered it.

30:18 - Most of our grooms are from Xgen with a custom exporter. We’ve worked with Yeti and Ornatrix, but not Houdini. Someone will try to look into a setup for Houdini. With respect to the groom specification, it is currently at version 1.5 so that are the values you should pass for the version_minor/versionmajor attributes. Also, only the attributes listed in the specs are supported; you can’t just prefix groom to Houdini attributes to make it work as you tried with skinprim and skinprimuv. They should be named to what they correspond to in the specs. I think your Nick and Gabriel have figured it our for the most part. 1) Grouping curves together is indeed the way to go as it is much more efficient to process. 2) For the UV attribute, a colleague pointed this tweet out to me: https://twitter.

com/hannover_bloss/status/1315860394162810883 31:10 - You can try mapping the Additional UV Attributes to groom_root_uv. 3) I don’t know Houdini so I don’t know if it’s required to convert to nurb curves. Но характеристики “Groom” говорят, что он использует “Alembic::AbcGeom::ICurves” But the groom specs say that it’s using Alembic::AbcGeom::ICurves. Friends, that’s all I wanted to show in this video. As I said - I try to make small videos in order to upload them to Youtube faster. Therefore, let’s dwell on this for now.

31:43 - I am naturally waiting for new answers from developers and I think that on this topic - I will always have something to tell and show. If you have any more questions - write them in the comments. Thank you for watching and wish you a good mood. .