I created an Island with water around it. I want to make the water around the island get gradually LESS transparent with it's depth, so that you can see a littlebit of the sand below the surface of the water but make it gradually less visible as it goes down. How can I achieve this?
-
$\begingroup$ Hello, there are many ways, you could paint a b&w image in order to use it as a mask in a Mix Shader, to make the sea gradually transparent $\endgroup$– moonbootsCommented Aug 18, 2023 at 13:39
-
$\begingroup$ Would you be able to give me a more detailed explanation? I'm very new to Blender and I don't understand many things:( $\endgroup$– BiersCommented Aug 18, 2023 at 13:51
-
$\begingroup$ please show some screenshot of your current object and its material $\endgroup$– moonbootsCommented Aug 18, 2023 at 13:51
-
$\begingroup$ Well, the way real water does this is volumetrics, so I would use a volumetric shader. $\endgroup$– TheLabCatCommented Aug 18, 2023 at 13:58
-
$\begingroup$ @moonboots I added a screenshot to my original post. $\endgroup$– BiersCommented Aug 18, 2023 at 13:59
2 Answers
You can use a Principled Volume
node for the effect (also have a look at Volume Absorption
and Volume Scatter
nodes). Most simply just create a cube and apply the shader to it and place it below your ocean plane. With the Density value you can control the "depth transparency".
If you want to have a better volume than a cube, duplicate your plane with the Ocean modifier, apply the modifier and then extrude the ocean mesh (but this can be a little bit heavy).
You can also combine surface and volume shaders:
-
2$\begingroup$ Note that would be a rendertime-expensive solution. $\endgroup$– Lauloque ♦Commented Aug 18, 2023 at 15:23
-
$\begingroup$ i was never able to use volume shaders, wont work for my setup 😅 $\endgroup$– Harry McKenzie ♦Commented Aug 18, 2023 at 15:50
-
1$\begingroup$ Hello, thank you so much for your help. This seems to have done the job! $\endgroup$– BiersCommented Aug 21, 2023 at 0:35
You can use a black and white image as a mask that you plug into the Mix Shader, then plug your shaders into the 2 inputs of this Mix Shader. I've made it simple (a mix between a Glossy and a Transparent shader) but of course it can be a more complicated mix of shaders. Depending on the black and white of your mask, you'll see either more of the first input or more of the second:
-
$\begingroup$ Thanks man for help, I really appreciate that. In the end, @Taiyo 's answer seems to be the solution in my case, but I'm really grateful for your answer as well! $\endgroup$– BiersCommented Aug 21, 2023 at 7:37