Tim2501 |
Hi, everyone!
I have a little puzzle for you I never could quite solve: I'm trying to create underwater-caustics for a game I'm working on. I baked a cycle of water-normalmaps I want to create the caustics from, but nothing I try will produce nice looking caustics. Any ideas if/ how it can be done in FF? Here's some informative article about it: GPU-Gems: Water caustics I've also attached one of my normalmaps you can play around with... ![]() |
|
Posted: June 7, 2014 7:56 pm | ||
Skybase
![]() |
The math's kinda crazy haha. I don't know if that can be thrown into FF. But I'm pretty certain it can be faked (accuracy aside). Just in my head I'd first convert the normal map to a bump map and the rest would be tinkering with some values and fudging looks and feelings. I know it's not the best of answers but that's just what I'd do.
Pretty crazy though haha. |
|
Posted: June 8, 2014 3:22 am | ||
Rachel Duim
![]() |
||
Posted: June 8, 2014 12:43 pm | ||
Rachel Duim
![]() |
||
Posted: June 8, 2014 6:13 pm | ||
Skybase
![]() |
Rick, I think Tim means he wants to use the already-exported normal map to generate caustics applicable to other images/textures.
|
|
Posted: June 9, 2014 1:06 am | ||
Rachel Duim
![]() |
True, the image is a height map. My thought was this, in FF it's probably easier to use the refraction tool and the edge detection tool on an existing image (as opposed to trying to create a normal based on the crazy math
![]() Math meets art meets psychedelia. |
|
Posted: June 9, 2014 8:59 am | ||
Rachel Duim
![]() |
Might be helpful: Fast Real-time Caustics from Height Fields.
Math meets art meets psychedelia. |
|
Posted: June 10, 2014 9:04 am | ||
ThreeDee
![]() |
||
Posted: June 13, 2014 7:52 am | ||
ThreeDee
![]() |
||
Posted: June 13, 2014 8:00 am | ||
ThreeDee
![]() |
||
Posted: June 13, 2014 8:13 am | ||
Rachel Duim
![]() |
Those look really good!
![]() Math meets art meets psychedelia. |
|
Posted: June 13, 2014 9:24 am | ||
ThreeDee
![]() |
Here's the simplest method that the second image was done with. Needs your normal map as the source image.
(I actually did it first much more complicated before I realized the Lookup component does it in one go...) Simple Caustics from Normal Map V0.5.ffxml |
|
Posted: June 13, 2014 1:18 pm | ||
Rachel Duim
![]() |
Thanks. I'm going to take a look at this. I've already done some experimenting with the Lookup component. Powerful, takes a bit of thought to wrap your mind around the function. I've already used it for tiling, boring compared to this
![]() Math meets art meets psychedelia. |
|
Posted: June 13, 2014 5:15 pm | ||
ThreeDee
![]() |
It is essentially a single-ray caustic: you shoot one ray directly up and use the normal map to check where in the sky the ray will hit. The circular gradient acts as the sky with the sun directly overhead. You can move the sun around in the sky and get it looking different.
Real caustics require multiple rays, but like your references show, the math gets more involved. It is probably not all that difficult to script, but doing the refraction math without scripting can be tricky, as the outgoing rays are not perpendicular to the surface. |
|
Posted: June 14, 2014 3:15 am | ||
Rachel Duim
![]() |
Good stuff. I am going back to school, so to speak. Gotta get my trigonometry skills back up to speed. Haven't used trig or calculus much since college. Caustics are a future challenge, again, thanks for the snippet.
Math meets art meets psychedelia. |
|
Posted: June 14, 2014 10:47 am | ||
Tim2501 |
First of all, thank you for all your suggestions
![]() I have tried some stuff with the lookup-component myself and came up with a nice solution, which, though not physically correct, looks quite nice. I have attached the snippet, which also contains some of my earlier attempts. ![]() CausticsFromNormals.ffxml |
|
Posted: June 20, 2014 8:57 am | ||
SpaceRay
![]() |
This looks very good and interesting, although I do not have time to test it
![]() |
|
Posted: June 23, 2014 11:14 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,719 Registered Users
+8 new in 7 days!
153,546 Posts
+6 new last day!
15,348 Topics
+71 new in year!
33 unregistered users.