About Store Forum Documentation Contact



Post Reply 
A change of direction
Author Message
3DRaddict Offline
Member

Post: #31
RE: A change of direction
Thanks to a suggestion by georgatos7 I've gradually increased the transparency of the water as it laps onto the beach (by 'lerping' more beach texture into the water/foam combo)

[Image: Engine%202016_02_15%2022_07_24.png]
02-15-2016 09:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #32
RE: A change of direction
Looking really good, great work!
02-16-2016 12:42 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #33
RE: A change of direction
Calm before the storm...
Flyby of a calm sea on a hot summer's day.
Recorded in fullscreen mode using the Windows10 inbuilt video capture software.





I'll now be moving into the real meat of my project... the Surf Zone.
This is where all the action will be happening in the form of breaking surfable waves.
I have a number of ideas to carry out and experiment with, but I'll still update my progress, good and bad.
02-16-2016 01:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #34
RE: A change of direction
Currently all my wave creation and processing is being carried out in the GPU via HLSL shader code, with the CPU feeding the neccessary parameters to change the physical shape and visual appearance. Being able to tesselate the water surface gives marked speed and resolution improvemnents over my original 'Surfing Simulation' using Esenthel, where most of the work was being done in the CPU.
However, the problem that I have now hit upon is how to access all the wave data existing in the GPU, since I need the vertex position and normals at any point on the dynamic wave surface at any time, so as to manipulate floating objects (e.g surfboard). The standard GPU shaders (VS,HS,DS,PS) have no easy means of achieving this (that I can find,anyway)
However, my saving grace could well be in the form of the Directx Compute Shader... I have started reading up on this and am looking at a few working examples. As well as being able to pass data back and forth to/from the standard shaders, it can also pass data back to the CPU (at a slower rate, though). Another plus is that all processing is performed in parallel on seperate threads... this could very well suit the wave grid processing and enable me to do away with the tessellation shaders, and just use standard grids, but at a higher resolution.
This all remains to be seen, so I will be spending the next couple of weeks getting to grips with the Directx Compute Shader.
02-19-2016 09:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #35
RE: A change of direction
Maybe you could replicate on the CPU (in a simplified way) what you are doing on the GPU?
That way, you wouldn't have to send any data back to the CPU.
02-19-2016 09:45 AM
Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #36
RE: A change of direction
Y as Tottel proposed maybe you could re-evaluate your waves position and normal on the CPU but just for the single position you are interested to place your floating object. I think i remember reading about this as a possible solution for similar cases, i don't know the specifics of your implementation though so not sure if it's doable or not.

Edit: It looks like the source of information was actually this vid that probably is using a similar implementation for the ocean, but it's done with the built-in node based shader tool for the ocean geometry and is using a parallel cpu code implementation to calculate the Buoy's height and normal.
http://www.youtube.com/watch?v=PBWLfpm0K0o&t=14m30s
(This post was last modified: 02-19-2016 12:57 PM by georgatos7.)
02-19-2016 11:11 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #37
RE: A change of direction
Quote:I think i remember reading about this as a possible solution for similar cases

Hi, georgatos7, if you could possibly dig out that reference it would be much appreciated. I really want something 'quick and dirty' and not too mathematical.smile

Edit: Thanks!
(This post was last modified: 02-19-2016 12:16 PM by 3DRaddict.)
02-19-2016 12:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #38
RE: A change of direction
On giving this some thought, it does seem to be a feasible solution. I'm going to give it priority over the Compute Shader. Thanks for the input, Tottel and Georgatos7.
02-19-2016 05:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #39
RE: A change of direction
A slight synchronisation problem, but at least duckie is now keeping his head above water! If any creature has more than the nine lives of a cat, then its a duck...he's drowned many times today. grin
Its been a frustrating day, but thanks again to G and T for their suggestion... I'm sure its saved me a couple of weeks work investigating Compute Shaders.



02-21-2016 09:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #40
RE: A change of direction
Success at last!
Floating body now floating correctly.



02-22-2016 11:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #41
RE: A change of direction
Congratulations! grin

It's very interesting to see your progress, keep going!
02-22-2016 12:16 PM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #42
RE: A change of direction
Whenever I come across complex formulations and equations that I will require to use in my 3D application, I resort to an old favourite of mine...the humble spreadsheet.
For me it is the ideal way of testing and visualizing in a 2D format, and once working correctly, it is fairly easy to repeat that 2D slice along the 3rd dimension of your 3D application. The spreadsheet allows you to build up tables of functions and their parameters, then visualize them by means of XY line charts. Key parameters can be altered manually (or automatically, by means of macros) resulting in instant visual results on the chart. However, some familiarity with spreadsheet programming is required.
For example, I'm currently working on what happens to the shape of a wave as it approaches a beach. The dynamics of the wave changes as the depth gets less... the wavelength, speed and height are all affected. When the wave height is larger than 0.8 times the water depth then the wave breaks.
Here are a few screenshots of my spreadsheet to get a better idea.
[Image: depth_wavelength.ods%20-%20OpenOffice%20..._21_28.png]
[Image: depth_wavelength.ods%20-%20OpenOffice%20..._21_55.png]
[Image: depth_wavelength.ods%20-%20OpenOffice%20..._22_17.png]
[Image: depth_wavelength.ods%20-%20OpenOffice%20..._23_11.png]
02-25-2016 09:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #43
RE: A change of direction
Very interesting approach. It makes a lot of sense to try to achieve a different and more realistic behavior the closer you get to the shore especially since in this case water is a main gameplay element.
(This post was last modified: 02-26-2016 03:34 PM by georgatos7.)
02-26-2016 12:56 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #44
RE: A change of direction
I've been working on the spreadsheet simulation as shown in my previous post. I've progressed to the stage where I now have an algorithm that changes the shape of the wave profile as it advances from deep water, through the intermediate stages to shallow water, and finally on the beach. It is during the intermediate stages that the wave is surfable as it start to spill over. The wave breaks completely into a mass of foam when it hits the shallow water.
Unfortunately, a spreadsheet simulation proceeds at an incredibly slow pace due to the large amount of spreadsheet cells which have to be calculated each frame. So, rather than a video, I was only able to take a series of screenshots as the simulation proceeded.
The shots start with the wave forming in the deep water on the right and end with the broken up wave on the beach on the left. To fit everything in, I had to drastically reduce the scale, so the wave appears as a rather indistinct blue blob. However, at the bottom of the shot is an enlarged version of the wave, showing the shape detail more clearly at that instant in time.
I guess I'm now ready to transpose everything from the spreadsheet to the 3D project version.
[Image: Image3.png]
[Image: Image4.png]
[Image: Image5.png]
[Image: Image6.png]
[Image: Image7.png]
[Image: Image8.png]
[Image: Image9.png]
[Image: Image10.png]
[Image: Image11.png]
[Image: Image12.png]
[Image: Image13.png]
[Image: Image14.png]
[Image: Image15.png]
03-03-2016 09:29 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #45
RE: A change of direction
Very impressive modelling. I'm really looking forward to seeing this in action smile
03-03-2016 04:42 PM
Find all posts by this user Quote this message in a reply
Post Reply