My attempt to make an underwater scene in Unreal Engine 4.
This is a Graduation Project where I wanted to test out the limits of the new engine and get better at realistic scenes/PBR materials. This project also runs on an Oculus Rift.
The Blur! My eyes! Too much blur haha. This is a great idea, I would love to see some fishes. Did you finish that other project you were doing the hand-painted thread you had going?
Hi kmactastic! The handpainted thread is my freework. This is for school. So in between doing both at the same time
I'm still tweaking everything, so the blur might lose it's strength later hehe.
The idea for the scene is to build up some type of reef with a sunken ship in it.
Just started using UE4 about 2 weeks ago. I'm really sad they don't have the fog volume in there. It could have saved me quite a lot of headache.
Since last time I got my water plane to look good from both sides using this material input:
So underwater you can see through the surface depending on your view angle.
And above water there is no unnatural see through to the bottom.
There is however an issue with my particles.. they can be seen through the water plane when you're above the water surface.
Is there anyone who knows how to efficiently do particles that should be in a large radius?
What I mean by this is that I don't want the engine to render particles that are so far away, you can't see them through the fog and the blur.
Sculpts in the making:
I soon realized that making a coral reef is going to take a lot of planes/polys to look good. :poly122:
Light shafts are being looked into but atm my attempts are failing.
I really wish UE4 got fog volumes again. :shifty:
Strong caustics are usually the result of direct lighting filtering through the refraction from the water above. Meaning ideally you'd mask out the caustics in primary light shadowed areas.
Yes there are caustics from secondary light (global illumination) but those usually aren't nearly as strong, unless the secondary light source is also that strong of a contrast and is going past the water/air refraction barrier at some point. So not that important usually.
Edit- Because the light is refracting, a strong cutoff isn't ideal, can't do actual caustics right now, and unfortunately UE4 doesn't have support for something like variance shadow maps, which would be ideal for getting a nice blurry fade between caustics/no caustics. So beware if cutting them off it might look weird with UE4's only lightly filtered shadows.
Yeah it's not the best thing to have in shadows but not having them at all would really break the underwater feeling.
atm I'm working with a light function on a directional light so it's even visible above water.
In short: I hacked my way through this. The scene should almost only be underwater anyway.
Thanks for your input btw, I hadn't even heard of variance shadow maps until now.
In the end, I think the scene will continue to be as small as it is now.
I'll still add some smaller rocks, after that building the scene with props and getting those damn blueprints to work.
It looks like I've accomplished almost nothing in 12 weeks, but behind the scenes there was a lot of messing around with a lot of different things. So in that aspect I can say I've learned a great deal from this project.
After dealing with my kayak scene for the previous exam I gained quite a lot of knowledge as how to handle water.. so I redid most of my shader and got this effect:
I think I could sit there and stare at it for a looong time.
Probably will keep this angle for videos.
If only I could keep those sun-rays in my screen without looking at the sun Don't think it'll happen though.
I fixed myself a character. Blueprints react to the underwater now only when it comes above water is when it still fucks up xD I'll try to find a hack for it.
For those interested in how my character works..
I give you this:
The blueprint is just a simple player, I added a plane with some distortion on it to fake the underwater feeling.
In the Property Matrix I enabled the "Use Controller Rotation Pitch" so I could also swim up and down.
The post processing volume of my sea was copied as well to make a physics volume with fluid enabled and a slight friction.
The player slowly fades his speed when moving around. It also responds on how long/hard you pressed the button. All of that was done by the Engine luckily I'm no coder
As for the water shader.. It still has a double sided shader with different material depending on what side you view it from.
Some images:
I'm really unhappy about the topside of the water with those ugly reflections.. but no matter what I seem to do, the only way for me to make them at least somewhat bearable is when I lower the intensity of my normals, which also makes my sea look like a lake.. -___-'
I'm using a heightfog underwater that I disable above water so that's where that gradient is coming from. When I completely disable it I get a white reflection in the distance. Probably because the standard sky from UE4 has a very bright base whenever the light doesn't adjust.
Couple things...the rock that you made...the sculpt looks really solid. A lot of that nice form from your sculpt/bake is getting lost in here. Also, textures look a little low res compared to everything else around it, so it sticks out a little bit.
Would be great to see more breakup of the sand near the rock. Just some subtle detail to add some contrast.
Couple things...the rock that you made...the sculpt looks really solid. A lot of that nice form from your sculpt/bake is getting lost in here. Also, textures look a little low res compared to everything else around it, so it sticks out a little bit.
Would be great to see more breakup of the sand near the rock. Just some subtle detail to add some contrast.
Caustics look really cool.
Breakup.. you mean sand heaping up at the rocks? I'll put that on my to-do list.
I apparently had a very light cavity map so I adjusted that on the stone. Texture is indeed somewhat low res Tried sharpening it (cheap tricks ftw)
What I did since the last update was implementing a very easy flashlight.
It's kind of hard to see but in reality I'm using a light function here with this handmade texture:
I'm not sure but I think there are a few things going on that makes your images quite difficult to look at, especially the chroma. When I reached the last picture I'm having some headache
My general idea of undersea is how things are soft. You may want to play more with depth and color imo and less with chroma and distortion.
Thanks for the feedback DireWolf. I'll be adjusting the fringe, depth and the fog again. It's one of those settings that I keep on adjusting xD going to leave final tweaking till I have a somewhat better/finished environment.
More props
I got my scene to run at 30fps on an Oculus yesterday It's not the best thing in the world, but considering my scene is not that optimized yet...
Hey Spiffy, thanks for your comment! Someone already pointed that video out to me. ^^ I would've loved to do this but decided not to go into it since it looks pretty complex and I don't have the time to get it in by the deadline.
Atm I'm still making small props to populate the scene, after that I'll build up the level flow, make a powerpoint for the exam and polish some tiny fun features
So the last bit of my deadline I worked without updating polycount.
The project has been semi completed btw
The only thing that's left to do is to get some LOD's in there since it seems to suffer a lot from frame-drops by an unidentified source. It could be the transparent water shader but it could also be that I draw to many polygons without optimization.
Some pictures without the fog:
It runs on the Oculus Rift DK2 very nicely. There is controls for the diver + a flashlight. You can also go above water.
There are some schools of fish that move at different speeds and different matinees.
What's on the pile of stuff that's wrong:
- Rock texture is still too low res. Might need some detail blending or a completely new texture. Looks wrong in definition compared to the rest of the meshes.
- Speed of diver might need some tweaking. (implement a quick dash with shift key)
- Needs better definition of boundaries.
- Lags quite a lot (too many CPU calls) Still run-able on high end computers/laptops.
- Needs LOD's.
- Mesh particles fucked up on AMD graphics card. (exploded polygons with stretched textures) Nvidia seems to run fine.
- Water reflection on surface still looks horrible.
I use a light function for my caustics. Basically the scene has 2 directional lights. 1 with a lightfunction and the other for just the lightbaking.
the one with the lightfunction is pretty bright as well.
you can use custom reflection vector to diminish those white reflection in the distance. It might be a good idea to post pics of your material network for the water to get a better idea of the problem
Awesome work! Would be fun to try this. You never did any tutorials for this scene? If someone knows of a particularly good one for a performant underwater please PM me.
Replies
I'm still tweaking everything, so the blur might lose it's strength later hehe.
The idea for the scene is to build up some type of reef with a sunken ship in it.
Just started using UE4 about 2 weeks ago. I'm really sad they don't have the fog volume in there. It could have saved me quite a lot of headache.
Deadline: Exam period (January 2015)
Oooh caustics :poly105:
Since last time I got my water plane to look good from both sides using this material input:
So underwater you can see through the surface depending on your view angle.
And above water there is no unnatural see through to the bottom.
There is however an issue with my particles.. they can be seen through the water plane when you're above the water surface.
Is there anyone who knows how to efficiently do particles that should be in a large radius?
What I mean by this is that I don't want the engine to render particles that are so far away, you can't see them through the fog and the blur.
Sculpts in the making:
I soon realized that making a coral reef is going to take a lot of planes/polys to look good. :poly122:
Light shafts are being looked into but atm my attempts are failing.
I really wish UE4 got fog volumes again. :shifty:
Check this out by the way: https://www.youtube.com/watch?v=564OYZanl3A&list=UUBobmJyzsJ6Ll7UbfhI4iwQ#t=1373
For seeweeds!
Here's a small update on the rock in the engine:
Yes there are caustics from secondary light (global illumination) but those usually aren't nearly as strong, unless the secondary light source is also that strong of a contrast and is going past the water/air refraction barrier at some point. So not that important usually.
Edit- Because the light is refracting, a strong cutoff isn't ideal, can't do actual caustics right now, and unfortunately UE4 doesn't have support for something like variance shadow maps, which would be ideal for getting a nice blurry fade between caustics/no caustics. So beware if cutting them off it might look weird with UE4's only lightly filtered shadows.
atm I'm working with a light function on a directional light so it's even visible above water.
In short: I hacked my way through this. The scene should almost only be underwater anyway.
Thanks for your input btw, I hadn't even heard of variance shadow maps until now.
I'm also happy to say I've finally gotten Oculus Rift to work. Both dev kits now work with the standalone game thanks to some great UE4 support.
the reason why it took so long was because the dev kits aren't always at my disposal.
Started making some fishes:
Any tips on how to animate a swarm of these would be nice
You can clearly see I'm no real animator
In the end, I think the scene will continue to be as small as it is now.
I'll still add some smaller rocks, after that building the scene with props and getting those damn blueprints to work.
It looks like I've accomplished almost nothing in 12 weeks, but behind the scenes there was a lot of messing around with a lot of different things. So in that aspect I can say I've learned a great deal from this project.
After dealing with my kayak scene for the previous exam I gained quite a lot of knowledge as how to handle water.. so I redid most of my shader and got this effect:
I think I could sit there and stare at it for a looong time.
Probably will keep this angle for videos.
If only I could keep those sun-rays in my screen without looking at the sun Don't think it'll happen though.
I fixed myself a character. Blueprints react to the underwater now only when it comes above water is when it still fucks up xD I'll try to find a hack for it.
For those interested in how my character works..
I give you this:
The blueprint is just a simple player, I added a plane with some distortion on it to fake the underwater feeling.
In the Property Matrix I enabled the "Use Controller Rotation Pitch" so I could also swim up and down.
The post processing volume of my sea was copied as well to make a physics volume with fluid enabled and a slight friction.
The player slowly fades his speed when moving around. It also responds on how long/hard you pressed the button. All of that was done by the Engine luckily I'm no coder
As for the water shader.. It still has a double sided shader with different material depending on what side you view it from.
Some images:
I'm really unhappy about the topside of the water with those ugly reflections.. but no matter what I seem to do, the only way for me to make them at least somewhat bearable is when I lower the intensity of my normals, which also makes my sea look like a lake.. -___-'
I'm using a heightfog underwater that I disable above water so that's where that gradient is coming from. When I completely disable it I get a white reflection in the distance. Probably because the standard sky from UE4 has a very bright base whenever the light doesn't adjust.
Oh well I'll figure something out..
Here's some bubbles for reading all the way down:
The gifs look quite good
Couple things...the rock that you made...the sculpt looks really solid. A lot of that nice form from your sculpt/bake is getting lost in here. Also, textures look a little low res compared to everything else around it, so it sticks out a little bit.
Would be great to see more breakup of the sand near the rock. Just some subtle detail to add some contrast.
Caustics look really cool.
Haha, I was thinking the same thing when I was looking up
Breakup.. you mean sand heaping up at the rocks? I'll put that on my to-do list.
I apparently had a very light cavity map so I adjusted that on the stone. Texture is indeed somewhat low res Tried sharpening it (cheap tricks ftw)
What I did since the last update was implementing a very easy flashlight.
It's kind of hard to see but in reality I'm using a light function here with this handmade texture:
And another coral fan
My general idea of undersea is how things are soft. You may want to play more with depth and color imo and less with chroma and distortion.
http://www.hotelclub.com/blog/wp-content/uploads/2010/08/underwater-cave.jpg
Ended up tweaking it right after that anyway xD
Made a tiny cave thingy
A first step to terrain material blending..
Depth tessellation!
More props
I got my scene to run at 30fps on an Oculus yesterday It's not the best thing in the world, but considering my scene is not that optimized yet...
http://youtu.be/564OYZanl3A?t=11m30s
They cover shader based/world offset animation and morph targets in UE4.
Looking good, I'm working on something similar but I'm no where near this far ahead, can't wait to see more.
Atm I'm still making small props to populate the scene, after that I'll build up the level flow, make a powerpoint for the exam and polish some tiny fun features
Some new fishes.
I'm reusing the rig of the clownfish to animate all of them with the same animation. :poly136:
hurray for rushing stuff.
The project has been semi completed btw
The only thing that's left to do is to get some LOD's in there since it seems to suffer a lot from frame-drops by an unidentified source. It could be the transparent water shader but it could also be that I draw to many polygons without optimization.
Some pictures without the fog:
It runs on the Oculus Rift DK2 very nicely. There is controls for the diver + a flashlight. You can also go above water.
There are some schools of fish that move at different speeds and different matinees.
What's on the pile of stuff that's wrong:
- Rock texture is still too low res. Might need some detail blending or a completely new texture. Looks wrong in definition compared to the rest of the meshes.
- Speed of diver might need some tweaking. (implement a quick dash with shift key)
- Needs better definition of boundaries.
- Lags quite a lot (too many CPU calls) Still run-able on high end computers/laptops.
- Needs LOD's.
- Mesh particles fucked up on AMD graphics card. (exploded polygons with stretched textures) Nvidia seems to run fine.
- Water reflection on surface still looks horrible.
[ame]https://www.youtube.com/watch?v=Yo9zpnXzFJA[/ame]
I use a light function for my caustics. Basically the scene has 2 directional lights. 1 with a lightfunction and the other for just the lightbaking.
the one with the lightfunction is pretty bright as well.
For depth tessellation, follow this link: [ame]https://www.youtube.com/watch?v=D6zyUI33FqA[/ame]
Can u share me ur project?
Please
If someone knows of a particularly good one for a performant underwater please PM me.