Announcement

Collapse
No announcement yet.

Project: FluidSurface Plugin

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

    #31
    Originally posted by JamesG View Post
    Woah, that sounds amazing! I was actually about to ask if you had thought about going down that path Do let me know if there is anything I can do to help get it into shape to review.
    At the moment the code is very unoptimized and a mess, but afterwards I wouldn't mind a review on the rendering process, like am I doing it correctly, or are there better ways, etc.

    Originally posted by JamesG View Post
    How are you doing collision at the moment? I would think just treating it as a thin box for collision purposes would be fine.
    For now I have created an AggGeom box based on the bounds (Its about 5 or 10 units thick) which is used for tracing, otherwise I check overlapping actors per tick (Probably not very efficient).
    FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
    TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

    Comment


      #32
      FluidSurface Plugin Release v0.0.2

      FluidSurface Plugin Release v0.0.2

      Link: Fluid Surface Plugin v0.0.2

      Version 0.0.2 has been released to github. I have a new branch "FluidSurface" which contains the source code. You'll need the following files/folders for it to work:

      - Engine/Plugins/Runtime/FluidSurface/* - Main plugin code
      - Engine/Shaders/FluidSurfaceShader.usf - Compute shader to perform simulation
      - Engine/Shaders/FluidSurfaceVertexFactory.usf - Vertex factory shader for FluidSurface rendering
      - Engine/Shaders/FluidSurfaceVertexFactoryCommon.usf - Common code for vertex factory
      - Engine/Shaders/FlatTessellation.usf - Had to make a small change to this to allow the FluidSurfaceVertexFactory to modify the world displacement prior to the material (Will explain further down why)
      - Engine/Shaders/PNTriangles.usf - Same as above.

      It is very important to get the shaders. The plugin will not work without them.

      The plugin contains the following new features:

      GPU based simulation
      The simulation has moved from the CPU to a Compute Shader and vertex shader/domain shader additions. This allows for larger areas to be calculated quicker. I have been able to run up to 2048x2048 tiles (About 491m wide with standard grid spacing) at realtime.

      New tessellation modifications
      If you enable tessellation, it will actually reduce the number of vertices/indices in needs to store in the buffers, and then uses the tessellation world displacement to offset the fluid surface (Rather than vertex world offset). It actually runs faster on larger surfaces to have tessellation enabled. New options have been added to the editor:

      - Build Tessellation data: This will tell the component to use the new algorithm to build the surface. If you don't apply a tessellation material, you will see a very low quality simulation, this is because of the reduced triangle count.
      - Tessellation Ratio: This allows you to tweak the amount of triangles to use for tessellation, the value can go from 0.1 - 2.0 (Max is twice the normal tessellated resolution, not recommended. The recommended value is 0.125)

      As stated above, I had to add some code to both FlatTessellation.usf and PNTriangles.usf (So these are mandatory for execution) which can be found wrapped within the USE_FLUIDSURFACE macro to allow the Vertex factory to apply displacement prior to the material.
      FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
      TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

      Comment


        #33
        FluidSurface Plugin Release v0.0.2

        FluidSurface Plugin Release v0.0.3

        Link: FluidSurface Plugin v0.0.3

        Version 0.0.3 has been released to github. Moved pling calculations onto GPU and increased compute shader thread count. With tessellation and the right material setup, can now render 4096x4096 cells at realtime. Speed of all other cell counts should be increased.

        Material used to blend tessellation by distance:
        Click image for larger version

Name:	DistanceTess.jpg
Views:	1
Size:	132.0 KB
ID:	1050456

        Credit goes to DaveTheFreak aka David Scholze for the material setup. Can be found here Distance Based DX11 Tesselation - Video
        Last edited by Ehamloptiran; 05-04-2014, 10:12 PM. Reason: Giving credit
        FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
        TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

        Comment


          #34
          Originally posted by Ehamloptiran View Post
          FluidSurface Plugin Release v0.0.3

          Link: FluidSurface Plugin v0.0.3

          Version 0.0.3 has been released to github. Moved pling calculations onto GPU and increased compute shader thread count. With tessellation and the right material setup, can now render 4096x4096 cells at realtime. Speed of all other cell counts should be increased.

          Material used to blend tessellation by distance:
          [ATTACH=CONFIG]1785[/ATTACH]

          Credit goes to DaveTheFreak aka David Scholze for the material setup. Can be found here Distance Based DX11 Tesselation - Video
          Download link returns 404.
          DO contact me with questions about Blueprint or other Unreal features! I don't bite! Or charge money! Just press that blue Skype button and fire away.

          Project Culverin - Open Ended First Person Shooter

          Comment


            #35
            Originally posted by Ray Jones 312 View Post
            Download link returns 404.
            You need to be logged into your Git hub account to access it.
            FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
            TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

            Comment


              #36
              As per ufna's advise. I have moved the code to a new repository, it can now be located at <Link Removed>. All future updates will be to here.

              UPDATE: Due to the fact that this plugin contains original code from the engine, I have removed the public repo. All future updates will remain in https://github.com/Ehamloptiran/Unre...e/FluidSurface

              Please refer to the following AnswerHub topic for information: https://answers.unrealengine.com/que...ored-in-a.html

              I apologise for the confusion.
              Last edited by Ehamloptiran; 05-07-2014, 11:08 AM.
              FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
              TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

              Comment


                #37
                Absolutely great work Ehamloptiran, a great plugin already and would really be awesome if integrated in ue4 (i think thats what is meant by pull request, im a bit of a noob when it comes to development nomenclature)

                Comment


                  #38
                  Does it work with 4.1.1? Because when I copied this to my UE4 folder, when trying to generate visual studio project to compile the engine, I got many errors in CMD command.
                  Please an installtaion tutorial would be appreciated. Thanks.

                  Comment


                    #39
                    Originally posted by DarkInfiktrator View Post
                    Does it work with 4.1.1? Because when I copied this to my UE4 folder, when trying to generate visual studio project to compile the engine, I got many errors in CMD command.
                    Please an installtaion tutorial would be appreciated. Thanks.
                    Hi, I have had no issues running it with 4.1.1. Are you able to post some of the error messages? Also yes I am working on a more thorough installation tutorial, I will also provide some prebuilt binaries for the more common engine versions at some point.
                    FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                    TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                    Comment


                      #40
                      Originally posted by Ehamloptiran View Post
                      Hi, I have had no issues running it with 4.1.1. Are you able to post some of the error messages? Also yes I am working on a more thorough installation tutorial, I will also provide some prebuilt binaries for the more common engine versions at some point.
                      When I put 4.1.1 files and everything required, then I place into /Engine/Plugins/Runtime directory and I place shaders into /Engine/Shaders directory
                      Then I compile, I get those errors:

                      Erreur 3 error : Failed to produce item: C:\UnrealEngine\Engine\Plugins\Runtime\CableComponent\Binaries\Win64\UE4Editor-CableComponent.dll C:\UnrealEngine\Engine\Intermediate\ProjectFiles\ERROR UE4
                      Erreur 2 error LNK1120: 1 externes non rÚsolus C:\UnrealEngine\Engine\Plugins\Runtime\CableComponent\Binaries\Win64\UE4Editor-CableComponent.dll UE4
                      Erreur 1 error LNK2019: symbole externe non rÚsolu "private: static class UClass * __cdecl UCableComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UCableComponent@@CAPEAVUClass@@PEB_W@Z) rÚfÚrencÚ dans la fonction "public: class UCableComponent * __cdecl FPostConstructInitializeProperties::CreateDefaultSubobject<class UCableComponent,class UCableComponent>(class UObject *,class FName,bool,bool,bool)const " (??$CreateDefaultSubobject@VUCableComponent@@V1@@FPostConstructInitializeProperties@@QEBAPEAVUCableComponent@@PEAVUObject@@VFName@@_N22@Z) C:\UnrealEngine\Engine\Intermediate\ProjectFiles\Module.CableComponent.cpp.obj UE4
                      Erreur 4 error MSB3073: La commande "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" s'est arrêtée avec le code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 UE4

                      Comment


                        #41
                        Originally posted by DarkInfiktrator View Post
                        When I put 4.1.1 files and everything required, then I place into /Engine/Plugins/Runtime directory and I place shaders into /Engine/Shaders directory
                        Then I compile, I get those errors:

                        Erreur 3 error : Failed to produce item: C:\UnrealEngine\Engine\Plugins\Runtime\CableComponent\Binaries\Win64\UE4Editor-CableComponent.dll C:\UnrealEngine\Engine\Intermediate\ProjectFiles\ERROR UE4
                        Erreur 2 error LNK1120: 1 externes non rÚsolus C:\UnrealEngine\Engine\Plugins\Runtime\CableComponent\Binaries\Win64\UE4Editor-CableComponent.dll UE4
                        Erreur 1 error LNK2019: symbole externe non rÚsolu "private: static class UClass * __cdecl UCableComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UCableComponent@@CAPEAVUClass@@PEB_W@Z) rÚfÚrencÚ dans la fonction "public: class UCableComponent * __cdecl FPostConstructInitializeProperties::CreateDefaultSubobject<class UCableComponent,class UCableComponent>(class UObject *,class FName,bool,bool,bool)const " (??$CreateDefaultSubobject@VUCableComponent@@V1@@FPostConstructInitializeProperties@@QEBAPEAVUCableComponent@@PEAVUObject@@VFName@@_N22@Z) C:\UnrealEngine\Engine\Intermediate\ProjectFiles\Module.CableComponent.cpp.obj UE4
                        Erreur 4 error MSB3073: La commande "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" s'est arrêtée avec le code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 UE4
                        Thats an issue with the compiling the Cable Component plugin, not my plugin.
                        FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                        TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                        Comment


                          #42
                          Originally posted by Ehamloptiran View Post
                          Thats an issue with the compiling the Cable Component plugin, not my plugin.
                          but I got this issue when compiling the source files I got from your plugin. I will try to only copy your fluid plugin inside plugin/runtime and see if it works.

                          Comment


                            #43
                            Originally posted by DarkInfiktrator View Post
                            but I got this issue when compiling the source files I got from your plugin. I will try to only copy your fluid plugin inside plugin/runtime and see if it works.
                            Under the releases tab on my private fork is a zip containing only the required files for the FluidSurface plugin. Get that, and place into your own project, or the plugins directory for v4.1.1 of Unreal Engine (And place the shaders into UnrealEngine/Shaders directory). My Private Fork is not up to date with the latest code (So theres a good chance it doesn't even compile, and probably why you recieve those errors), I just placed the FluidSurface code in there as per my above comments (Not allowed to be in public repo because of shared code with Epic).
                            FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                            TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                            Comment


                              #44
                              Originally posted by Ehamloptiran View Post
                              Under the releases tab on my private fork is a zip containing only the required files for the FluidSurface plugin. Get that, and place into your own project, or the plugins directory for v4.1.1 of Unreal Engine (And place the shaders into UnrealEngine/Shaders directory). My Private Fork is not up to date with the latest code (So theres a good chance it doesn't even compile, and probably why you recieve those errors), I just placed the FluidSurface code in there as per my above comments (Not allowed to be in public repo because of shared code with Epic).
                              I put the plugin plugins/runtime and then copied shader to engine/shaders. The 4.1.1 window pops up saying compiling shaders WorldGridMaterial and immediately shuts down and the engien does not start , so I copied the 4.1.1 source shader folder back, and then the engine lanched and when i enabled fluid plugin, when restarting, I got the same message on launcher pop up window shaders WorldGridMaterial nad the engine launched and was compiling some shaders. Did I make the plugin work correctly by only copying the plugin in plugins/runtime and then copying back 4.1.1 shader folder thus deleting the shaders you uploaded or do I need your shadre folder that does not work?

                              Comment


                                #45
                                No you need my shaders for it to work as the FluidSurface uses them, the editor immediately shutting down during compiling shaders, sounds like an issue with the shaders. What are your system specs? This will only work on a DX11 Windows machine (The version of OpenGL used does not support Structured Buffers), if thats what you have, can you please upload the UE4.log of an execution where you have my shaders in place (Which should be under Engine/Saved/Logs) - Which will hopefully contain the reason why it shutdown.
                                FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
                                TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

                                Comment

                                Working...
                                X