FDNavigate back to the homepage

Stylised Moon Lit Water in Blender

Rick
September 27th, 2022 · 3 min read

One thing Ive realised is that noise is your friend and especially when combining with light sources and normals of a surface - which affects how the light is perceived on a surface.

The hero image was a still render of the scene. It has 4 parts to it:

  • Plane representing still water

  • A world background stary night

  • The light source (area light)

  • Plane below water plane

  • A final note about baking

Plane representing still water

This is just a simple plane which has been uv unwrapped. And had some shading applied to it:

Shader node setup for water plane

The interesting part is the shader node setup which is shown below:

Water plane shader node setup

Lets run through this:

  • We have a Texture coordinate node for the uvs

  • Have a mapping node so we can scale in one axis to get the stretched water feel

  • A 3D noise texture

  • The Bump node to generate normals from the FAC value of the noise node or the noise value

  • Connect this bump node to the normals of the BSDF node

  • Connect the FAC of the noise node to the color ramp - to control the opacity. (The greater the FAC value the greater the opacity - we arent so bothered about the color here, just opacity!)

  • Connect the opacity from the color ramp to the opacity in the BSDF shader node

Here are the settings for the BSDF:

BSDF node settings for the base material

This took quite alot of the 2 hours this took to get the perfect settings or close to what I was after 🙂

And there we have the basic water plane!

A world background stary night

This was really simple, I used a very scaled (500) noise texture to get very small dots. Here is the shader node setup:

World shader node setup for background texture

And this is what it looks like so far:

Stary night background texture shown

Abit shit right?

Well we need light and one more magical aspect haha

The light source (area light)

The light source is just a simple area light, it is in mega wats as I have a rather large plane, no reason was just playing around with it!

Here is the plane with the light source in affect:

Light source added to scene and affecting the water plane surface

Here are my particular light source settings:

Light source settings in blender

But you will have to play with the source strength to get a perfect match to your scene.

Its not quite right as the water is too see through and also we dont get any sort of faux bloom effect with the light reflections.

Read on my friends!

Plane below water plane

So I had a thought, everything I read about rendering and lights has planes placed in particular positions to get the right affect or feeling for a scene.

So I thought on a whimp what would happen if we place a plane which is black just below this water plane with a semi transparent opacity.

Before:

Light source and just the water plane

After:

Light source, water and black plane

Just the black plane rendered:

Light and just black plane with blurry light

And here is the black plane shader settings:

Black plane with light source affecting it

As you can see the plane adds a more blurred effect to the water plane and this combination gives you the sort of bloom or burred affect to the reflected light and also prevents you seeing through the bottom of the plane, but with just enough reflection to see some of the stars reflected!

A final note about baking

You can bake all of this into textures and use on the materials in threejs and r3f. I am not 100% sure about light settings this might need tweaking in the r3f/threejs setup.

But genuinely this setup could be used in a web project without much effort, maybe a 2-3 hours of tweaking!

Final Thoughts

This is a nice way to generate a moon lit scene in R3F or threejs. Requires medium level of knowledge about blender for tweaking things and exporting to three.

Hope you enjoy and play around with it and tell me what you think [email protected].

More articles from theFrontDev

Exporting Per Vertex Attributes from Blender into a GLTF Model

Exporting per vertex attributes from Blender and ensuring the correct format. Useful if your in a tight spot and need to use blender and take advantage of geometry node attributes in a GLTF Model.

September 23rd, 2022 · 4 min read

Creating Water Trails with Vertex Displacement on a GLTF Model

How to do water trails by displacing verticies and integrating a custom shader with a built in threejs shader, taking advantage of hdr images in a custom shader.

September 19th, 2022 · 5 min read
© 2021–2024 theFrontDev
Link to $https://twitter.com/TheFrontDevLink to $https://github.com/Richard-ThompsonLink to $https://www.linkedin.com/in/richard-thompson-248ba3111/