Nugget Profile picture
Jan 18 14 tweets 6 min read
How to make convincing (and fake) caustics in #b3d!

🧵
#Blender3D #blender
Step one: Get a texture!

Any image or procedural texture works fine for this. Keep in mind that tileable textures will yield a much nicer result (if you are using an image texture).
I found that this image from OpenGameArt works quite well: opengameart.org/content/water-… Image
Step 2: Animation!

While the texture I found does happen to already be animated, animating it procedurally is quite simple and allows for much more control.
To begin, lets get the cosine and sine of our frame number and combine those two values into a vector like so: Image
You can see the effect of this function more clearly when we add this vector to the coordinates of our texture. It's way too fast right now, so lets multiply the frame number by .1 and scale the vector by .2.
As you can see, our texture is smoothly moving in a circle.
It's still a pretty boring animation, so lets spice it up a bit:
If we duplicate our image texture, and instead of adding we subtract our function from the vector, we get two textures moving opposite directions.
The real magic starts to happen when we take the minimum of both using a math node.
Ta-dah! Animated caustics!
If we wanna get even fancier, we can throw that all in a nodegroup and duplicate it 3 times, each with a slighly offset frame number. Combining those together with a Combine RGB node adds some pretty color separation to our caustics.
Step 3: Lighting.

There are a few ways of projecting our caustics onto the scene, but in my opinion the best way to do so is using the transparent BSDF node. If we multiply our caustics by a large number like 30 and plug it into the color of the transparent node, we get this: Image
Because the transparent shader's color is brighter than 1, it actually amplifies the brightness of the sunlight higher than its initial value, similar to how actual caustics would effect the scene. There are a few issues though, most notably in the surface of the water.
Since we only want our caustics texture to cast shadows but not be visible to the camera, we can mix between our transparent shader and a bumpy glass shader based off of the light path node's "Is Camera Ray" output. This immediately solves our issue. ImageImage
Another problem with our shader is that the caustics maintain their intensity right up to the water surface. In real life, the caustics would start out invisible and grow more intense the deeper into the water the surface is. We can solve this using this setup: ImageImage
The wonderful thing about his method specifically is that all lights including hdris will create caustics, leading to some beautiful results: Image
Thats it for the thread, hopefully you all found this somewhat helpful! if you don't feel like making the setup yourself, here's the project file: drive.google.com/file/d/1RtZLE0…
Out of curiosity, would people like to see more threads like this?

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nugget

Nugget Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(