[Elemental Shader Jam] Shallow Ocean
**UPDATE**
So, I cheated a bit and decided to make a shader in Unreal Engine 4. It's quite a bit of cheating since UE4 provides an awesome physically based rendering shading model to start with, and heaps and heaps of useful functions for you to use in your shaders without having to write them yourself, but I did learn a lot in the end!
I decided to make an ocean / watery globe with rocky islands and a little bit of transparency down into the water:
The shader has a dynamic parameter called Sea Level which you can control via script to change how much of the material is underwater and how much is above:
It takes advantage of a very cool function in UE4 called BumpOffset which does fake depth adjustment - like what they use for Parallax Bumpmapping. So the dark underwater areas look as if they are deeper than the lighter, shallower areas, when you rotate the ball around.
Here is the full Material Blueprint with comments:
http://i.imgur.com/j4QFFJw.jpg
So, I cheated a bit and decided to make a shader in Unreal Engine 4. It's quite a bit of cheating since UE4 provides an awesome physically based rendering shading model to start with, and heaps and heaps of useful functions for you to use in your shaders without having to write them yourself, but I did learn a lot in the end!
I decided to make an ocean / watery globe with rocky islands and a little bit of transparency down into the water:
The shader has a dynamic parameter called Sea Level which you can control via script to change how much of the material is underwater and how much is above:
It takes advantage of a very cool function in UE4 called BumpOffset which does fake depth adjustment - like what they use for Parallax Bumpmapping. So the dark underwater areas look as if they are deeper than the lighter, shallower areas, when you rotate the ball around.
Here is the full Material Blueprint with comments:
http://i.imgur.com/j4QFFJw.jpg
Thanked by 1Elyaradine
Comments
One thing that I've always hated about having to do ocean/shore shaders in our games at work is how to get the frothing of waves convincing, especially the waves as they get close to the shore. Perhaps you could work on a way to get that in too? :)
https://www.assetstore.unity3d.com/en/#!/content/456
https://www.assetstore.unity3d.com/en/#!/content/14147
Now can someone tell me what the buzz word physics based shaders/rendering means? I don't actually know ;)
Overall, it means you're decoupling the lighting work from being baked in your textures, to being a separate piece of the pipeline that can be more dynamic and controllable. End result is you end up with more options, and an arguably faster way of authoring art assets, while generally being more expensive.
This can lead to some unrealistic looking results, for example: You could turn up the specular power term and have a shining white glint despite your object being in a rather dark room.
Physically based rendering defines how things look based on actual the actual physical laws of light interacting with materials.
In practice what this means is that instead of artists painting "the look of the material when lit" into their textures, they are instead defining the properties of the materials themselves. Instead of painting in the details and then choosing an appropriate shader, artists paint things like roughness maps to determine how much light is scattered when it hits the object.
The advantage is then that the materials hold up much better in different lighting conditions. And in general, look much more realistic. Note that the goal of PBR is realistic lighting, if that's not your art style, then PBR is not for you.
[Edit]
John Carmack did an excellent talk on this subject.
Also interestingly, there are libraries of PBR materials out there that are based on BDRF measurement from actual physical objects. So you can find out that wood has a roughness of x and steel has a roughness of y for example.
I cant recommend the Unreal Engine enough, it's an awesome, industry-strength system!
I skipped most of the introduction videos - feel free to go back and watch them, they're very easy to watch.
I imagine though artists would still create a diffuse map, to at least define colours?
And Unreal's strong! The only thing that puts me off personally is that I've gotten quite used to using C#, maybe python, and having to come to grips with something like UnrealScript or C++ kind of puts me off. In terms of art workflow though, they make some fantastic tools, some of which I've had to replicate in Unity to make Unity less frustrating to use. :P
Now it's got a shoreline, better normal mapping of the land areas, mix of plantlife and rock on the land areas, underwater areas are better lit and fade to deep blue when depth increases, Water surface now has more reflections and improved wave motion.