Code Monkey home page Code Monkey logo

vaocean's Introduction

Welcome to the VaOcean source code!

Attn.! This branch contains archived version of plugin for UE 4.12 based on NVIDIA SDK sample "FFT Ocean". It's deprecated and lives here for history only.


VaOcean is the ocean surface simulation plugin for Unreal Engine 4.

The plugin includes:

  • Component that renders displacement and gradient (normal) maps in real time
  • Sample content, including water shader and grid meshes to be used on scene
  • Set of global shaders that perform FFT calculation and other tech stuff on GPU

Check the Wiki tab to know more about the plugin.

Current version: 0.4 Alpha 6 Hotfix 1

SCREENSHOT

Legal info

Unreal® is a trademark or registered trademark of Epic Games, Inc. in the United States of America and elsewhere. Unreal® Engine, Copyright 1998 – 2014, Epic Games, Inc. All rights reserved.

References

  1. Tessendorf, Jerry. Simulating Ocean Water. In SIGGRAPH 2002 Course Notes #9 (Simulating Nature: Realistic and Interactive Techniques), ACM Press.

  2. Phillips, O.M. 1957. On the generation of waves by turbulent wind. Journal of Fluid Mechanics. 2 (5): 417–445.

vaocean's People

Contributors

noahzuo avatar ufna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vaocean's Issues

RenderTarget source can't be reached in cooked game

I have to remove physics from SeaCraft alpha build because of this "feature". Unfortunately Source variable can be used with Editor only, so I should find another way to read the data.

Btw, as we have buffers, we can read data directly from them, isn't it?

a534ec661c045fde24624780de9b0cbc

Black dots with peak ocean params

For example, if we set ChoppyScale to 2.0 in default example, we'll get this view:

black_dots

I definitely should check what's the deal, because it limits stormy waves creation today.

Splashes as 3D directional spray

The idea by Jeremy Baldwin:

Brief overview:

  • Generate unique mesh (Tessellation friendly)
  • Generate Morph Target (Stages)
  • Store Morph Targets in Vertex Color
  • Create LOD's
  • Depending on Ocean wave velocity and collision, Orient Mesh
  • Select Custom Vertex Color (With Splash Deformation Stored Inside)
  • Blend Between Morph Target Stage Over Particle Life

I have also had a few other approaches where I do something similar but with flat sprites. Depending on wave velocity, generate a deformable sprite to inherite velocity and quickly ramp down. While at the same time play a spray "flipbook" on the sprite itself

It corresponds with my ideas, it will be great to write down tech stuff and discuss with him.

ue4 4.6.1 failed to compile with this plugin

tried with 4.6.1
got this errors:

"Error 7 error C2661: 'GetGlobalShaderMap' : no overloaded function takes 0 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanRadixFFT.cpp 31 1 ahsanGameArchive
Error 8 error C2512: 'TShaderMapRef<FRadix008A_CS>' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanRadixFFT.cpp 31 1 ahsanGameArchive
Error 9 error C2661: 'GetGlobalShaderMap' : no overloaded function takes 0 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanRadixFFT.cpp 43 1 ahsanGameArchive
Error 10 error C2512: 'TShaderMapRef<FRadix008A_CS2>' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanRadixFFT.cpp 43 1 ahsanGameArchive
Error 12 error C2661: 'GetGlobalShaderMap' : no overloaded function takes 0 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 283 1 ahsanGameArchive
Error 13 error C2512: 'TShaderMapRef' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 283 1 ahsanGameArchive
Error 14 error C2661: 'GetGlobalShaderMap' : no overloaded function takes 0 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 337 1 ahsanGameArchive
Error 15 error C2512: 'TShaderMapRef' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 337 1 ahsanGameArchive
Error 16 error C2512: 'TShaderMapRef' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 337 1 ahsanGameArchive
Error 17 error C2660: 'SetGlobalBoundShaderState' : function does not take 5 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 337 1 ahsanGameArchive
Error 18 error C2661: 'GetGlobalShaderMap' : no overloaded function takes 0 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 380 1 ahsanGameArchive
Error 19 error C2512: 'TShaderMapRef' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 380 1 ahsanGameArchive
Error 20 error C2512: 'TShaderMapRef' : no appropriate default constructor available Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 380 1 ahsanGameArchive
Error 21 error C2660: 'SetGlobalBoundShaderState' : function does not take 5 arguments Z:\UnrealProjects\ahsanGameArchive\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp 380 1 ahsanGameArchive"

Can't get VaOcean to work

Can someone help me? It seems I can't get the plugin to work correctly, it keeps on tell me I need to recompile it...
error1
error2
error3

Compile error in 4.15.0

When i compile this plugin in ue 4.15.0, i got following error.
'RHICmdList': is not a member of 'FRHICommandListImmediate'
'Clear': is not a member of 'FRHICommandListImmediate'

Seems like the function "RHICmdList.Clear()" has no longer existed in 4.15 version of UE.
But i didn't find a alternative to this function, so i just commented it.(after doing this, it works)

This is great

This is a cool plugin. Are you planning on continuing work on it?

Couldn't load shader file 'VaOcean_VS_PS' (crash on load project)

I'm using engine 4.3.1, and I got this crash message right after copy the new plugin files to my project plugins folder:


!Id:f79096c71186840aa1cfa0af4872b619

Unknown exception - code 00000001 (first/second chance not available)

Couldn't load shader file 'VaOcean_VS_PS'

KERNELBASE + 42141 bytes
UE4Editor_Core + 3009507 bytes
UE4Editor_Core + 1775850 bytes
UE4Editor_ShaderCore + 131453 bytes
UE4Editor_ShaderCore + 85076 bytes
UE4Editor_ShaderCore + 118825 bytes
UE4Editor_ShaderCore + 94610 bytes
UE4Editor_ShaderCore + 145412 bytes
UE4Editor!FEngineLoop::PreInit() + 9761 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\launchengineloop.cpp:1224]
UE4Editor!GuardedMain() + 236 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\launch.cpp:112]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\windows\launchwindows.cpp:207]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

How do you build this plugin.

i tried to add it to Engine/Plugins/VaOcean, and build branch 4.8-preview-1, but although no error is shown, there is no UE4Editor-VaOcean.dll file in Binaries. Please help :)

Querying Ocean Properties at a Point

Hey there - I know development on this plugin has slowed and that the direction has changed somewhat, but I've been working off of the pull request #46 for 4.19 compatibility, and as I understand it, ocean surface queries for collision, buoyancy, spawning spray, etc. were originally planned for VaOcean but largely unimplemented. I wanted to ask your thoughts on what method such an extension was originally going to use, and if it has not been added simply for lack of development time or if there was a roadblock that makes it infeasible.

It might just save me some time to know if it's impractical before I go too far down that rabbit hole myself!

As it stands, my first attempt was a simple read operation from the displacement Render Target. UE4's Render Target implementation doesn't make this a very viable option - such a lookup costs ~5.5ms of frame time on high end hardware, and ~9ms on low end hardware (although position lookups are very cheap after the flat cost of the read operation).

This can't really be pawned off onto the render thread in a non-blocking way either, as the write operation still has to happen every frame, and so must wait for a read to finish. Lowering the patch size to 256 and decreasing the Render Target color depth to 8 bit both help, but not nearly enough to justify the quality loss.

My only other idea is to try running a second FFT simulation on CPU (likely with a smaller patch size of 128) which is used only for position lookup, and not written to texture memory. The lower resolution is probably fine, as buoyancy simulation or particle spawning don't need full precision. I'll have to find a C++ FFT library, as I don't quite have the chops to implement such a thing myself.

My questions then are these:

  • Am I missing something obvious? Is there an intermediate buffer or something that I can more easily grab position data from than reading it from the displacement map?

  • In your work with this feature, does the nature of VaOcean's simulation just make position queries impractical, or has it just not been implemented?

Thanks in advance!

Cotents of archive_UE4.12 don't appear on UE4.12, but appear on UE4.13.

Hi, ufna.
Thank you for your VaOcean project. I am helped by it.

I installed archive_UE4.12 by your wiki instruction.
However, in VaOcean plugin folder at contents browser, all uasset files don't appear.

I opened each uassets file by text editor.
Then, text include "UE4+Release-4.13".

So I tried UE4.13, then they appeared and it seems everything is OK.

It might be better to describe that supporting UE4.13, not UE4.12.

When you try, you have to pay attention to this problem.
https://forums.unrealengine.com/unreal-engine/announcements-and-releases/115710-potential-issue-loading-ue4-with-the-new-windows-10-creators-update-build-1703
On UE4.13 and after Windows 10 Creators update (build 1703), you have to add -d3d12 to UE4Editor exe command.

Mesh collision

It will be superb to add dynamic simplified collision for ocean grid, because it connected at least with:

  • camera traces
  • projectiles

Add central "ocean manager" actor

Physics and ocean shader should be connected to use the same height formula, world scale, etc.

I suggest ot add "ocean actor", which is added to scene by designer, and then works like a central hud for all ocean stuff. You change anything in it -> ocean config on scene and physics react.

Surface impact VFX reaction

I think that it should be defined by surface itself. For example, body felt down into water, or projectile impacted the surface.

I'm stupid, but Ocean doesn't show up...

Hi,

So I managed to install the plugin and have followed the tutorial to get a simple ocean in the game, edited the blueprints etc. When I run the game the ocean isn't there. So I added a 'BP_VaOcean_Simple' instance into the level in case that was the problem. This loaded in the mesh with the material on it but the ocean wasn't moving when I ran the game or simulated. I tried it in the Component view of the BP too with realtime enabled.
I know I'm being stupid as I'm new to UE4 and this is the first plugin I've been intrigued enough to try and run.

Can anyone point out what I'm doing wrong and offer some guidance in really simplistic terms to help me out please?

Thanks,
Daz

Install problems

I fallowed the directions but when I run the project or game, right before it loads It asks to compile, I click yes and it says the pluginfile may not be installed correctly. I made a folder in my project called plugins and pasted it in that folder, I also went under the engine folder, plugins, made a new folder in the plugins and pasted both files in that spot, I even tried pasting the files in another plugins folder. I put all the textures, shaders, and so on in the correct folders I assume. I am not sure what the problem may be. I am running the 4.2 version of unreal engine. Maybe someone can enlighten me to what may be going on. thanks

Near horizon reflections shadow

Hi

this is a very cool plug in! i have one issue, using the standard ocean. I have a character on a boat, when viewed in third person mode, the colours of the character reflect in the water near the horizon. Also, if the character's head is under the horizon, there's a shadow in the water from the top of the head to the horizon.

Is there a setting I can change to remove these artifacts, or is it a bug?

Thanks, R

Dynamic mesh generation

I think that whole ocean mesh should be generated at runtime with distance based LOD for patches. Maybe with tesselation, but it maybe not necessary with right LOD system.

Using VaOcean

I know my question may be silly since i am not a long time UE 4 user. But how can i add an ocean object to my project? I am working on a project and i have to explore the capabilites of your plugin before going deeper with UE4. A simple sample project or a link towards a VaOcean kickstart tutorial would be a great help for me. Thank you and sorry for my poor english

UVaOceanSimulatorComponent::BeginDestroy() lacks #if WITH_EDITOR in .cpp file

Declaration of this function in header file is within this macro and definition in .cpp file isn't. This causes compilation error in builds where WITH_EDITOR is set to 0:

    VaOceanPlugin.cpp
    C:\[snip]\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp(125) : error C2509: 'BeginDestroy' : member function not declared in 'UVaOceanSimulatorComponent'
            C:\[snip]\Plugins\VaOcean\Source\VaOceanPlugin\Classes\VaOceanSimulatorComponent.h(67) : see declaration of 'UVaOceanSimulatorComponent'
    C:\[snip]\Plugins\VaOcean\Source\VaOceanPlugin\Private\VaOceanSimulatorComponent.cpp(125) : fatal error C1903: unable to recover from previous error(s); stopping compilation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.