Announcement

Collapse
No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Ethandale View Post

    I tried moving the character that is default in the scene, and unfortunately, that did not fix the problem. I'm hoping there's a way to change that in the blueprint or something! Thanks for your response!
    OK, but Did you create a separate camera inside Sequencer to take the shots or used the character one?
    Nilson Lima
    Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
    Join us at Discord: https://discord.gg/uFFSEXY

    UE4 Marketplace: Cloudscape Seasons
    supporting: Community FREE Ocean plugin

    Comment


      Hi everyone;


      The ocean did not come
      I get too many errors Is there a video about adding to the project?

      Comment


        Originally posted by ShaNexxx View Post
        Hi everyone;


        The ocean did not come
        I get too many errors Is there a video about adding to the project?
        In the post 2368 above there is a complete set of steps on how to add it to a project. First thing thou is download it from GitHub and be able to successfully run it.
        Nilson Lima
        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
        Join us at Discord: https://discord.gg/uFFSEXY

        UE4 Marketplace: Cloudscape Seasons
        supporting: Community FREE Ocean plugin

        Comment


          Originally posted by NilsonLima View Post

          I have checked the code and everything for the landscape modulation is there and the code is sound, but for it to work you need to feed the heightmap texture inside the Ocean Manager section in the BP_Ocean blueprint... beware that there are two heightmaps asked for the blueprint, the 1st one are for the waves, the second which is inside the Ocean Manager section is the correct one.
          I ended up getting it to work by copying the ocean from one of the example maps and replacing the heightmap with my own. And it seemed to work
          However, I have been doing some editing on the landscape heightmap since then, so now I replaced the old one with the new one, but the update don't show in the wave modulation. It's basically the same problem I had before. I could try to copy the ocean again from the example map and hope that workaround works one more time, but that is kind of a hassle and I'd have to redo all my custom settings again.
          Something seems off.

          Comment


            Originally posted by Sir_Manfred View Post

            I ended up getting it to work by copying the ocean from one of the example maps and replacing the heightmap with my own. And it seemed to work
            However, I have been doing some editing on the landscape heightmap since then, so now I replaced the old one with the new one, but the update don't show in the wave modulation. It's basically the same problem I had before. I could try to copy the ocean again from the example map and hope that workaround works one more time, but that is kind of a hassle and I'd have to redo all my custom settings again.
            Something seems off.
            Did you play with the modulation settings?

            - Enable modulation checkbox
            - Modulation Start Height
            - Modulation Max Height
            - Modulation Power (it is a Power node exponent)
            - Landscape (landscape asset created)
            - Heightmap Texture (your landscape heightmap)

            Start Height, Max Height and Power should do the adjustment trick. Also the texture size should be the same as the landscape preferably in PNG since it is a lossless format. Don't use JPEG.
            Nilson Lima
            Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
            Join us at Discord: https://discord.gg/uFFSEXY

            UE4 Marketplace: Cloudscape Seasons
            supporting: Community FREE Ocean plugin

            Comment


              Originally posted by NilsonLima View Post

              Did you play with the modulation settings?

              - Enable modulation checkbox
              - Modulation Start Height
              - Modulation Max Height
              - Modulation Power (it is a Power node exponent)
              - Landscape (landscape asset created)
              - Heightmap Texture (your landscape heightmap)

              Start Height, Max Height and Power should do the adjustment trick. Also the texture size should be the same as the landscape preferably in PNG since it is a lossless format. Don't use JPEG.
              I have played with those settings before and they never really made any difference. But then I don't really have any reference to what Start Height/Max Height refers to. Is it height of the ocean? Height of the terrain? If so is it the height of the terrain below the waterline? Is it the heightmap? And if it's refering to the heightmap, shouldn't the values be between 0.0 and 1.0 in that case?

              I would never use a JPEG though Oh man that would be awful.
              What I did try once was to use an 8-bit version of my heightmap at a lower resolution. But that just crashed UE4 everytime I tried to run the game. That made me think that the settings are only applied once you run the game, but when I checked (with the proper heightmap), there was still no difference with an updated heightmap. It was as if the old one was still being used.

              So I'm still confused

              Comment


                Originally posted by Sir_Manfred View Post

                I have played with those settings before and they never really made any difference. But then I don't really have any reference to what Start Height/Max Height refers to. Is it height of the ocean? Height of the terrain? If so is it the height of the terrain below the waterline? Is it the heightmap? And if it's refering to the heightmap, shouldn't the values be between 0.0 and 1.0 in that case?

                I would never use a JPEG though Oh man that would be awful.
                What I did try once was to use an 8-bit version of my heightmap at a lower resolution. But that just crashed UE4 everytime I tried to run the game. That made me think that the settings are only applied once you run the game, but when I checked (with the proper heightmap), there was still no difference with an updated heightmap. It was as if the old one was still being used.

                So I'm still confused
                I will check the code and tell you how the Start Height and Max Height works.
                Nilson Lima
                Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                Join us at Discord: https://discord.gg/uFFSEXY

                UE4 Marketplace: Cloudscape Seasons
                supporting: Community FREE Ocean plugin

                Comment


                  Originally posted by Sir_Manfred View Post

                  I have played with those settings before and they never really made any difference. But then I don't really have any reference to what Start Height/Max Height refers to. Is it height of the ocean? Height of the terrain? If so is it the height of the terrain below the waterline? Is it the heightmap? And if it's refering to the heightmap, shouldn't the values be between 0.0 and 1.0 in that case?

                  I would never use a JPEG though Oh man that would be awful.
                  What I did try once was to use an 8-bit version of my heightmap at a lower resolution. But that just crashed UE4 everytime I tried to run the game. That made me think that the settings are only applied once you run the game, but when I checked (with the proper heightmap), there was still no difference with an updated heightmap. It was as if the old one was still being used.

                  So I'm still confused
                  This is the piece of code which handles the modulation. The function is supposed to return the WaveHeight for buoyancy purposes, which is in fact the real wave height at position x,y,z:

                  //Landscape height modulation
                  float LandscapeModulation = 1.f;
                  if (bEnableLandscapeModulation && IsValid(Landscape)) // Nilson-> Modulation only if you provide the actor asset and checkbox enabled
                  {
                  const FVector LandLoc = Landscape->GetActorLocation();
                  const FVector2D LandXY = FVector2D(LandLoc.X, LandLoc.Y);
                  const FVector2D LocXY = FVector2D(location.X, location.Y);
                  const FVector LandScale = Landscape->GetActorScale3D();
                  const FVector2D ScaleXY = FVector2D(LandScale.X * HeightmapWidth, LandScale.Y * HeightmapHeight);

                  if (LocXY > LandXY && LocXY < LandXY + ScaleXY) //optimization: don't calculate modulation if outside of landscape bounds
                  {
                  FVector2D UV = LocXY - (LandXY + ScaleXY / 2.f);
                  UV = UV / ScaleXY + 0.5f;

                  float height = GetHeightmapPixel(UV.X, UV.Y).R - 0.5f; // Nilson-> this is the function call where the heightmap texture are read for the given coordinates. The -0.5 is to correctly sign the height
                  height = height * 512 * LandScale.Z + LandLoc.Z;

                  LandscapeModulation = height - SeaLevel - ModulationStartHeight; // Nilson-> SeaLevel is the Z axis for the ocean actor plane
                  LandscapeModulation /= FMath::Abs(ModulationStartHeight - ModulationMaxHeight);
                  LandscapeModulation = 1 - FMath::Clamp(LandscapeModulation, 0.f, 1.f);
                  LandscapeModulation = FMath::Pow(LandscapeModulation, ModulationPower);
                  // Calculate the Gerstner Wave Sets
                  if (TwoIterations)
                  {
                  const FVector xy = CalculateGerstnerWaveSetVector(location, time * GlobalWaveSpeed, true, false);
                  const float z = CalculateGerstnerWaveSetVector(location - xy, time * GlobalWaveSpeed, false, true).Z;
                  return FVector(xy.X * LandscapeModulation, xy.Y * LandscapeModulation, z * LandscapeModulation + SeaLevel);
                  }
                  return CalculateGerstnerWaveSetVector(location, time * GlobalWaveSpeed, !HeightOnly, true) * LandscapeModulation + FVector(0, 0, SeaLevel);
                  }

                  The modulation value is a value between 0 and 1 (see the clamp above) and since it is calculated earlier based on terrain height - SeaLevel - ModulationStart, for me means the modulation is actuating at landscape level as reference. So in the OceanProject Map, the value for StartHeight = -500 (at least in my project it is) and MaxHeight = 200, I deduce it wants to start modulate 500 cm bellow ocean level to the max 200 cm above ocean level.

                  So, the return value in the end has the following components: The waveset height from Gerstner formula multiplied by the modulation and added to SeaLevel.


                  Tell me if you understand anything different, the discussion is good and very interesting for others which might follow it up in the future.
                  Last edited by NilsonLima; 04-24-2018, 09:58 AM. Reason: changed to actuating at landscape level as reference
                  Nilson Lima
                  Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                  Join us at Discord: https://discord.gg/uFFSEXY

                  UE4 Marketplace: Cloudscape Seasons
                  supporting: Community FREE Ocean plugin

                  Comment


                    Originally posted by NilsonLima View Post

                    In the post 2368 above there is a complete set of steps on how to add it to a project. First thing thou is download it from GitHub and be able to successfully run it.



                    .
                    It does not work , it gives this error ;

                    Missing OceanProject Modules

                    UE4Editor-OceanProject.dll
                    UE4Editor-OceanPlugin.dll


                    I started from visual studio, I reset the motors , transfer to another project etc. etc. but did not work..



                    On another project, the plugin says old and disabling..

                    Comment


                      Originally posted by ShaNexxx View Post




                      .
                      It does not work , it gives this error ;

                      Missing OceanProject Modules

                      UE4Editor-OceanProject.dll
                      UE4Editor-OceanPlugin.dll


                      I started from visual studio, I reset the motors , transfer to another project etc. etc. but did not work..



                      On another project, the plugin says old and disabling..
                      Could you please give me some time to upload a small video teaching the whole procedure?

                      Come back in 1 hour and I think it will be ready.
                      Nilson Lima
                      Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                      Join us at Discord: https://discord.gg/uFFSEXY

                      UE4 Marketplace: Cloudscape Seasons
                      supporting: Community FREE Ocean plugin

                      Comment


                        Originally posted by NilsonLima View Post

                        Could you please give me some time to upload a small video teaching the whole procedure?

                        Come back in 1 hour and I think it will be ready.
                        Thanks you very much man.. waiting...

                        Comment


                          Originally posted by ShaNexxx View Post

                          Thanks you very much man.. waiting...
                          I have just started the publishing process into Youtube and it might take a while since I don't have Adobe Premiere in this machine, so it won't go the easy and fast way. The link will be available here: https://youtu.be/1W6Z5XnUyAI in about 40-50min from this post.

                          Let me know if you got it right and share your success here!
                          Nilson Lima
                          Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                          Join us at Discord: https://discord.gg/uFFSEXY

                          UE4 Marketplace: Cloudscape Seasons
                          supporting: Community FREE Ocean plugin

                          Comment


                            ShaNexxx video is up with instructions to take the project from github, make it work and migrate everything to another project: https://youtu.be/1W6Z5XnUyAI
                            Nilson Lima
                            Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                            Join us at Discord: https://discord.gg/uFFSEXY

                            UE4 Marketplace: Cloudscape Seasons
                            supporting: Community FREE Ocean plugin

                            Comment


                              Originally posted by Grot13
                              Hi Nilson,
                              I use the plugin since UE 4.12 and each upgrade I had to redownload the project and migrate my stuff in it. Thanks to your procedure (I guess it was on last page or maybe before) I've finally succeed in creating a new one and it was easy and straightforward. My packages now have the game name and I think my project is cleaner now. Really thank you very much.

                              About landscape modulation I made a post on this thread months ago with pictures to explain, unfortunately the picture hoster no longer exists and my post has vanished...



                              It is also super usefull as material parameter, I made tries some times ago with the sea level parameter in a landscape material : https://youtu.be/hr7GVhHhClY
                              On the video you can see the caustic function also uses this parameter to constraint it under water. It follows the water volume (not the "physics volume" checked as water") that's great
                              Some shaders should react differently under water and it is possible with this simple float.
                              I deal with this plugin since Dotcam released it and as gratitude I help with support for everyone wanting to use it. It is great and teaches a lot.
                              Nilson Lima
                              Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                              Join us at Discord: https://discord.gg/uFFSEXY

                              UE4 Marketplace: Cloudscape Seasons
                              supporting: Community FREE Ocean plugin

                              Comment


                                Originally posted by NilsonLima View Post

                                I have just started the publishing process into Youtube and it might take a while since I don't have Adobe Premiere in this machine, so it won't go the easy and fast way. The link will be available here: https://youtu.be/1W6Z5XnUyAI in about 40-50min from this post.

                                Let me know if you got it right and share your success here!
                                Thanks. Can you migrate the calm ocean for me?
                                I am still missing the missing .dll

                                Comment

                                Working...
                                X