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 Jackseno View Post
    The biggest problem I'm having at the moment is the jittery rubberbanding I'm having when my ship is moving. (As this video should hopefully demonstrate https://youtu.be/dx5p_3fJtYg?t=741 at around the 12:20 mark) Any idea what's causing this or how I'd go about reducing it? Whilst I'm not the lead blueprint guy for my project, I should still be able to answer any questions about it. We're not using the same propulsion system that is included in the ocean project, although I think the one we have is similar.
    I have mention this problem plenty of times in this thread, it's one of the reasons why I haven't worked on the ships in a while since they are kinda unusable with this problem.
    However I have since found the source of the problem, it has to do with tick ordering, basically the pawn ticks before the ship physics and so it ends up a frame behind (or something along these lines , this might not be perfectly accurate).
    Try changing the ship's tick group to PostUpdateWork, that seems to do the trick most of the time.
    At some point you will also need to code a custom character movement component to fix other relative problems.

    I will eventually update the ships and the sailing physics, I have lots of cool stuff in the works.


    Originally posted by Nsomnia View Post
    I've meant to ask this for a while. When I posted a development log video I got a copyright warning saying the waves sound was owned by someone. Were you aware we cant distrubute the ocean wave sound loop?
    Yeah same here.. the problem here is the (incredibly stupid) detection system youtube uses.
    Apparently if someone uses the same sound file (which is from a free sfx library btw) in a copyrighted song/video then it automatically flags every other video that uses that sfx.
    We should probably find some other sfx.. the current one is fairly common it seems.

    What you can do for now is counter the copyright warning by explaining it's from a free library that literally everyone can use, that's what I have been doing but more and more copyrighted content which use that sfx is released so you will keep getting these from time to time.. seriously though! what a ridiculous system at this rate copyrighting will end up doing more harm than good, someone needs to stop this madness!

    4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
    WIP Interactive Water Shader, WIP 2D Water Sim
    WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

    Comment


      Just a thought cause this logic came to me today making test fleets that I needed to populate quickly. A bool added to the buoyancyforceComponent for bAutoBuoyancy which takes the root static mesh bounding box and sets 4 test points to the max and min x,y x,-y -x,y -x,-y with the test radius as the max y * 2 / numTestPoints.

      Makes for nice quick testing of boat meshes in single for prototyping and especially for many for flkeets. Just plunk them in, change them out, put them in a spawning actor etc.
      Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

      Comment


        4.12.2 + High Accuracy Sun/Moon Positioning

        Hey all,

        I'm releasing the latest code changes for the new Skydome I'm working on in stages. I want to make sure this first part's accuracy is rock solid before adding additional parts, as they will be dependent on sun/moon positions during the day & year. So this is the first of a series of upcoming skydome changes.

        This update is the high accuracy sun & moon positioning, based on the input latitude, longitude, UTC offset, and local time. The calculations for this are very complex, and boring, so I'm only going to go over the values shown in the Debug HUD.

        First, what you will see when you open the project, and how to set it all up for your desired location:

        When you open the project, you will be in a demo level named dcSkyTestMap, which is a copy of the Island Map level with the skydome added. (if you don't want to use the new skydome, the Island Map still has the old one). These 2 arrows will show you the direction of the Sun/Moon (yellow/gray) and will update themselves appropriately, and the compass is set to North == +X axis (has not been rotated, default world placement).
        Click image for larger version

Name:	Arrows.JPG
Views:	1
Size:	41.1 KB
ID:	1108144

        To change the date & time, select the BP_Sky reference in the World Outliner, and expand the small arrow beside Local Time in the Default section. Here you will also find the controls for Latitude, Longitude, UTC Offset Hours, whether to allow Daylight Savings time, and a Time Scale Multiplier which allows you to speed up (or slow down) time. By default this is set to 10 which means 10 seconds of game time goes by every 1 second in real world time.
        Click image for larger version

Name:	DebugTime.JPG
Views:	1
Size:	71.1 KB
ID:	1108145

        The values are automatically clamped in code to the maximum number of seconds in a minute (59), max hours in a day (23), max days in the current month (28 to 31), etc. I had clamped the sliders to not exceed these values, but for some reason it won't allow you to change the value with it turned on, so just be aware that values greater than min/max do not have any effect.

        Finally we have the Debug HUD, this will look very confusing to most people, but is as simple as I could make it while still providing the necessary information. Here's what it looks like, the values are broken down below:
        Click image for larger version

Name:	DebugHud.JPG
Views:	1
Size:	140.1 KB
ID:	1108146

        The best way to verify this data is to use this website and enter in the date/time, latitude & longitude info into these boxes (or use the map, but make sure the lat/long are correct):
        Click image for larger version

Name:	Position Website.JPG
Views:	1
Size:	31.5 KB
ID:	1108147

        With that entered, all of the other fields will populate themselves with data. The values in game vs the values on the website will vary slightly (0.1 to 2 degrees average) and are not meant to be exact, calculating the exact position is not feasible (or necessary) for a game / simulation. Using approximations allows high accuracy, without performance concerns.

        Now, what these values mean:

        SUN
        - Time Correction Factor (TCF): The number of minutes to add/subtract to account for the variation in Solar Time within a given time zone.
        - Equation of Time (EOT): An equation that corrects for the eccentricity of the earth's orbit and axial tilt for the given date/time.
        - Hour Angle (HRA): Converts Solar Time to the number of degrees the sun has moved. 0 == sun's highest point, so the value will be negative in the east (morning) and positive in the west (evening)
        - Declination: The earth's axial tilt for the given date/time vs the sun. This varies from -23.4397 (northern hemisphere winter) to +23.4397 (northern hemisphere summer).
        - Altitude Angle: The vertical angle of the sun in the sky measured from the horizontal, 0 = sunrise, 90 = highest point of the sun that day (time varies) **NOTE: For this value to work in UE4 coordinates we need to subtract 180 from the result, this is why the value differs in the actual rotator' pitch value.
        - Azimuth Angle: The horizontal compass direction of the sun. At solar noon this angle will be exactly due south (-180) (local time varies)
        - Current Rotator Value: The current rotation of the Sun's Directional Light.

        References used for solar positioning:
        http://www.pveducation.org/pvcdrom/p.../suns-position
        http://www.stjarnhimlen.se/comp/tutorial.html#5
        http://www.powerfromthesun.net/Book/...chapter03.html


        MOON
        - Approximations L/M/F: These are approximations for the location of the moon in it's orbit around the earth, including the inclination of the orbit, orbital eccentricity, arg of perigee, and longitude of ascending node
        - Ecliptic Longitude: The longitude location of the moon on the celestial sphere.
        - Ecliptic Latitude: The latitude location of the moon on the celestial sphere.
        - Mean Distance (km): The distance of the moon from earth, in kilometers.
        - Declination: Similar to the solar declination, this is the angle of the earth's axial tilt, but also takes the inclination of the moon's orbit into account.
        - Right Ascension: Angular position of the moon measured eastward along the celestial equator. Both right ascension and lunar declination are found by converting from ecliptic to rectangular coordinates (x/y/z), rotating to account for earth's axial tilt, then converting back into spherical coordinates.
        - Sidereal Time: A time scale (measured in degrees) based on the rate of earth's rotation relative to fixed stars, rather than the sun. This is a constant value that varies only by location (not time), which differs from the actual definition of Sidereal Time, we only use it as a reference.
        - Hour Angle (HRA): Similar to the sun HRA, however is measured against sidereal time instead of solar time. The number of degrees the moon has moved from time 0 (0 to 360 degrees).
        - Altitude Angle: Same as the sun, vertical height of the moon. Value is found by converting Ecliptic (celestial sphere) coordinates to geocentric (observer to sky) coordinates.
        - Azimuth Angle: Same as the sun, horizontal compass direction of the moon. Value is found by converting Ecliptic (celestial sphere) coordinates to geocentric (observer to sky) coordinates.
        - Current Rotator Value: The current rotation of the Moon' Directional Light.

        References used for lunar positioning:
        http://aa.quae.nl/en/reken/hemelpositie.html
        http://www.braeunig.us/space/plntpos.htm
        http://www.stjarnhimlen.se/comp/tutorial.html#7


        There is an excellent video explaining the basics of how we calculate the time of day, calendar systems, and the earth's rotation in the following video (which came out the day after I posted this). Highly recommend watching it to get a good idea how this works:
        https://www.youtube.com/watch?v=IJhgZBn-LHg


        All of the above calculations are implemented in the plugin to ensure there are no performance issues. The blueprint BP_Sky is based off the TimeManager class (in the plugin) and uses it's functions to calculate the sun/moon/moon phases in the base class. This makes the blueprint much easier to read, and reduces it's complexity considerably. These functions could be used by any actor, such as a custom skydome system, by either adding the actor as a child, or inheriting from the actor and calling the Calculate xxx functions.

        Please try it out, let me know how it works for you, and whether you have any problems. I have been testing the system out and so far it seems to be working great, but feedback would be much appreciated!

        This is now available in the 4.12 branch on GitHub.
        Last edited by DotCam; 06-15-2016, 10:06 AM.
        Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

        Comment


          cool

          Comment


            Wow DotCam thanks. Now i have a billion other things to mix and mat(c)h together for some dynamic fun stuff. Appreciated I see time since 2000 JulianCal. Will that still work negative as in 1900's?
            Last edited by Nsomnia; 06-12-2016, 05:23 PM.
            Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

            Comment


              Hey Dotcam,

              That all sounds awesome, just what I've been waiting for

              Couple of questions (of course!):

              1> If I already have 4.12 in my project and I want this new stuff, do I have to go through all the steps to install the plugin, or can I just overwrite the relevant files?

              2> I'm struggling to get the landscape modulation working (for the coastline stuff) on my custom landscape. Do you have any tips for this? The two important bits seem to be turning it on with the tick box, choosing your 'landscape' and choosing your heightmap texture, all of which I have done and it makes no difference for me. However, I have just noticed that when I choose my landscape from the drop down it doesn't accept it. As in, it syas empty even after selecting it so something isn't right?

              Thanks,
              Daz

              Comment


                Originally posted by dazuk1978 View Post
                Hey Dotcam,

                That all sounds awesome, just what I've been waiting for

                Couple of questions (of course!):

                1> If I already have 4.12 in my project and I want this new stuff, do I have to go through all the steps to install the plugin, or can I just overwrite the relevant files?

                2> I'm struggling to get the landscape modulation working (for the coastline stuff) on my custom landscape. Do you have any tips for this? The two important bits seem to be turning it on with the tick box, choosing your 'landscape' and choosing your heightmap texture, all of which I have done and it makes no difference for me. However, I have just noticed that when I choose my landscape from the drop down it doesn't accept it. As in, it syas empty even after selecting it so something isn't right?

                Thanks,
                Daz
                As long as you've made no source code or blueprint changes to the default files, overwrite and good to go.

                The other, I dont do coastlines at least not close enough to care what they look like so cant really help.
                Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

                Comment


                  Originally posted by Nsomnia View Post
                  Wow DotCam thanks. Now i have a billion other things to mix and mat(c)h together for some dynamic fun stuff. Appreciated I see time since 2000 JulianCal. Will that still work negative as in 1900's?
                  Hey!

                  The days since 2000 (it's actually the Julian Day 2000 epoch, which is 01/01/2000 @ 12:00:00 (noon)) is used for the calculation of the moon rotation, and the phase calculation uses the JD1900 epoch (the last time a new moon fell on Jan 1st). The further from those dates you go, the less accurate it will be, but it's very minimal for dates within a couple centuries. The approximations help reduce the potential error, but it's still not perfect.

                  But yes, you can go +/- 2000 by 800+ years before noticing any issues, and the calculations can be re-based to a closer epoch without much difficulty. I'll add that to the blueprint in the next release.

                  The sun is even more accurate, doesn't matter the year (limited to 0000 to 9999 though), the position is accurate within a degree or two at the equinox's.

                  Originally posted by dazuk1978 View Post
                  Hey Dotcam,

                  That all sounds awesome, just what I've been waiting for

                  Couple of questions (of course!):

                  1> If I already have 4.12 in my project and I want this new stuff, do I have to go through all the steps to install the plugin, or can I just overwrite the relevant files?

                  2> I'm struggling to get the landscape modulation working (for the coastline stuff) on my custom landscape. Do you have any tips for this? The two important bits seem to be turning it on with the tick box, choosing your 'landscape' and choosing your heightmap texture, all of which I have done and it makes no difference for me. However, I have just noticed that when I choose my landscape from the drop down it doesn't accept it. As in, it syas empty even after selecting it so something isn't right?

                  Thanks,
                  Daz
                  1) There are changes to the following files:
                  \ShipsAndExamples\CustomThirdPerson\ThirdPersonGameMode (modified)
                  \ShipsAndExamples\CustomThirdPerson\TP_HUD (modified)
                  \ShipsAndExamples\CustomThirdPerson\ManOWar\BP_ManOWar (bugfix)
                  \Sky\BP_Compass (New)
                  \Sky\BP_Sky (New)
                  \Sky\M_Sky (New)
                  \Sky\WB_Sky_HUD (New)
                  \Sky\Textures\Sphere_N (New)
                  \Sky\Textures\T_Moon2_D (New)
                  \Sky\BP_Skydome --> moved to --> \Sky\Old\
                  \Sky\Materials\M_Sky --> Renamed to M_Sky_Old
                  \Ocean\Materials\M_Ocean_Versions\M_Ocean_Depth (bugfix)

                  and the plugin of course! don't forget to copy that over. There were a lot of code changes.

                  Easiest way to do this is to open the demo project, right click on the new files and select Asset Actions -> Migrate, and then select your project's content folder as the destination. This can sometimes overwrite other files, so be careful and read the list of files after clicking migrate to ensure you don't overwrite something you customized. In this case it should be ok though.

                  2) First thing I would check is the format of the file (RAW works best since it's uncompressed, but png will work too) and that the file has a 1:1 aspect ratio (as in 2048x2048 for example, length and height are equal). If both those are ok, if you're able to, PM me the heightmap file and I'll see if I can get it to work for you.
                  Last edited by DotCam; 06-12-2016, 06:48 PM.
                  Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                  Comment


                    If you've added anymore precision your crazy the calculations were as good for time date etc as paid stuff. Went through centuries with only the odd solar cycle it seemed.
                    Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

                    Comment


                      Originally posted by Coniunctiolight
                      I get this bug .--. please help

                      [ATTACH=CONFIG]97397[/ATTACH]
                      Check your gamemode in the world explorer is set to the proper gamemode, something is not getting references to a blueprints functions, either your missing files which those errors wouldnt look like that most likely or youve got a dialog box set to the wrong blueprint or such. Just throwing thisout there but you seem to have alot of issues multiple times a day, whats your blueprint and basic coding (python, javascript etc) abilities like? You will lose hope on your project and self destruct if you cant click on the return node hotlinks to see exactly whats going on and being able to debug at that level.

                      I gaurentee once you see why one of those "bugs" is happpening they all dissapear and you can move onto the next one.

                      Download the whole github project and try running it completely fresh. Any problems? Start there.
                      Last edited by Nsomnia; 06-12-2016, 07:44 PM.
                      Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

                      Comment


                        thanks already solved xD I had forgotten

                        Comment


                          Awesome what was the cause
                          Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

                          Comment


                            something simple xD
                            thank you for your help

                            Comment


                              Hey Dotcam,

                              I have been using your new Sky and running into some problems with lighting.
                              In my own very basic day/night cycle i modified it so that at night the sun light was turned off and vice versa which meant no weird shadowing and such during the cycle but it seems with your BP_Sky this is still an issue?

                              I'm finding it very hard to get properly dark nights, and if I do get it so it looks okay (through messing with the skylight captures etc) then during the day the shadows are too dark. If I get the daylight shadows looking nice, then the night is too bright again.
                              The only way to get around this it seems is to either settle for some middle ground where it looks 'OK' in night or day (but not exactly what we want) or to script it to get the right effect, which is a shame in such a cool system as you have here.

                              Any ideas? Through some searches I have seen a lot of people mentioning this over the years so I know at least it's not just me

                              Thx,
                              Daz

                              Comment


                                I noticed with the latest update (4.12) your reflections seem off? Is there anyway to tweak them?

                                Comment

                                Working...
                                X