Announcement

Collapse
No announcement yet.

Hair Rendering Simulation test

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Hair Rendering Simulation test

    Hi Guys,

    Thought it might be time to start sharing some screenshots from my latest experiment. Hair Rendering. Theres not a lot to look at for now. Mainly just rendering the strands of hair. The input file consists of 160 control strands that are then tessellated to produce around 40,000 strands of hair. Currently it does take a fairly hefty hit to the rendering, but this is mainly because it is highly unoptimized. There are a lot of places I can improve.

    Click image for larger version

Name:	HairSoFar2.jpg
Views:	1
Size:	132.1 KB
ID:	1134881
    Primary strands only

    Click image for larger version

Name:	HairSoFar.jpg
Views:	1
Size:	389.8 KB
ID:	1134882
    Wireframe view of primary strands

    Click image for larger version

Name:	HairSoFar3.jpg
Views:	1
Size:	233.1 KB
ID:	1134883
    Primary and Secondary strands

    Currently using UNLIT lighting so thats why there is no real detail. I will probably have to code in a new lighting mode to get good lighting on the hair, also struggling with Aliasing.

    Plans for the future:

    - Simulation of hair - Using a similar approach to APEX cloth.
    - Hair editor within the Unreal Editor to allow individual tweaking of things such as Baldness, Density, Color, Curliness, etc.
    - Lighting model for the hair

    I will continue to update this thread with new pictures and videos as I make progress.
    FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
    TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

    #2
    Nice work Ehamloptiran!
    Isaac Nichols
    Game Developer & Music Producer - Threaded Pixel Studios
    Currently working on Drones & Ruins a Sci-Fi twin-stick shooter.

    Comment


      #3
      Implementing realistic hair is probably one of the most difficult things you could've chosen All the weird reflections, refractions and interactions of light with every single hair. Not to mention the physics. My computer graphics professor once said, if you managed to implement a hair sim that was robust, flexible, looked and behaved realistically and run with good performance you'd either get a ton of money or recognition, or both

      Good luck and keep us posted!
      Join us on IRC! We are on #unrealengine @ freenode.org

      Comment


        #4
        Nice man! Please make it happen
        Check out UNREAL 4 Lighting Academy
        https://forums.unrealengine.com/show...ng-like-that-)

        Comment


          #5
          This is very cool!

          Hair is something we're struggling with right now so I'm excited to see what you come up with

          Comment


            #6
            Originally posted by unrealguy View Post
            Nice work Ehamloptiran!
            Originally posted by Daedalus51 View Post
            Nice man! Please make it happen
            Originally posted by Zooch View Post
            This is very cool!
            Thanks.

            Originally posted by Bajee View Post
            Implementing realistic hair is probably one of the most difficult things you could've chosen All the weird reflections, refractions and interactions of light with every single hair. Not to mention the physics. My computer graphics professor once said, if you managed to implement a hair sim that was robust, flexible, looked and behaved realistically and run with good performance you'd either get a ton of money or recognition, or both

            Good luck and keep us posted!
            Haha I know, I am sucker for punishment it seems. But it has also been a good learning exercise. There is still a lot of work to be done, even just with the rendering. Alot of chances to optimize too since I haven't been worrying about speed at this time. In the end there will be an aggressive LOD implementation as things will start to get very slow if you have multiple characters will full hair setup (or fur). Where it will reduce the number of strands being draw while simultaneously increasing the size of strands to hide any gaps, then eventually swapping it out with a low poly hair model when distant. This should help with speed greatly.

            Originally posted by Zooch View Post
            Hair is something we're struggling with right now so I'm excited to see what you come up with
            I am hoping that I can get this released as a plugin someday, but it will require a few additions to the engine that will need to be accepted by Epic before this would be able to become a plugin. Especially if I go down the route of a separate lighting model just for the hair.
            FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
            TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

            Comment


              #7
              Looks pretty nice. Probably going to need special/better anti-aliasing than UE4 has now. This should work: http://www.humus.name/index.php?page=3D&ID=89 so hopefully when they get to supporting transparency/different lighting models the above will be included (different lighting models should be able to be supported without a plugin, theoretically). Nice work so far though!

              Comment


                #8
                Originally posted by Frenetic Pony View Post
                Looks pretty nice. Probably going to need special/better anti-aliasing than UE4 has now. This should work: http://www.humus.name/index.php?page=3D&ID=89 so hopefully when they get to supporting transparency/different lighting models the above will be included (different lighting models should be able to be supported without a plugin, theoretically). Nice work so far though!
                Good find, thats some nice AA. I will take a look at that when the time arises.
                FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                Comment


                  #9
                  Have you looked into Tress FX? ATi put the entire code repository up on their site and it probably would help you out a lot. Let me know if you have any questions about it and I will see what I can do to help.

                  Comment


                    #10
                    Originally posted by Samsterdam View Post
                    Have you looked into Tress FX? ATi put the entire code repository up on their site and it probably would help you out a lot. Let me know if you have any questions about it and I will see what I can do to help.
                    Thanks I'll take a look at that, especially considering its a deferred solution.
                    FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                    TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                    Comment


                      #11
                      Hey Ehamloptiran, this is awesome - between this and the fluid surface actor contributions, well the community is in your debt. Although, I for one would love to see realistic beard physics before undertaking significant AA changes.

                      Comment


                        #12
                        Originally posted by Havoc View Post
                        Hey Ehamloptiran, this is awesome - between this and the fluid surface actor contributions, well the community is in your debt. Although, I for one would love to see realistic beard physics before undertaking significant AA changes.
                        Agreed, AA is a long way off, the sample that Frenetic Pony pointed to, looks great and i have put that into my research folder for later investigations and integration, right now, simulation is top priority. I have looked at the TressFX code linked to by Samsterdam and its great, I should be able to integrate a lot of that while keeping the tessellation for finer details, which will actually simplify the input format, allowing for a lot more flexibility like beards and full body fur to be created easily, even from within the editor (Considering the algorithms they use are essentially game ready).

                        Hopefully I will have some nice surprises by the end of this weekend.
                        FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                        TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                        Comment


                          #13
                          My humor doesn't come across very well over text, but the fact you're jumping into this with both feet in earnest, well.. if you're ever in the bay area, let me know, I'll buy you a few pints

                          Comment


                            #14
                            Update, partially implemented AMD's TressFX hair system. It can make very nice looking hair running at very sensible frame rates, but has some very limiting factors making it hard to integrate into a plugin, I've already made a number of additions to the engine to allow for it, and due to the way it renders it essentially has to be the last object rendered in the scene, making it very hard to put into a component.

                            The screenshot below is basic rendering, no lighting (As this will require a custom lighting path due to no depth information, which will come next). It utilises OIT (Order Independent Transparency) to ensure that fragments are rendered back to front for correct blending. There is no anti aliasing in place yet (TressFX has built in support for that, using a similar way that Frenetic Pony linked to earlier. Just need to implement). But even at 57,000 strands it still renders a lot faster than the previous implementation I tried and I still have the choice to utilise Tessellation to improve the quality of the hair.

                            Click image for larger version

Name:	HairSoFar4.jpg
Views:	1
Size:	107.1 KB
ID:	1050931
                            FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                            TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                            Comment


                              #15
                              Very interesting!
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment

                              Working...
                              X