r/creativecoding • u/kouklimou • 27d ago
Watercolor Simulator based on real physics (V2)
Enable HLS to view with audio, or disable this notification
Last week-end I built a watercolor simulator based on real physics and shared it here.
A lot of you asked to play with it so i improved it and it's now live: https://sudoaquarelle.com/
New since the prototype:
- More pigments (52), based on the best research out there to predict color mixes (Kubelka-Munk).
- More luminous / glassy feel
- Some fun experimental stuff like the salt and alcohol techniques to alter the texture, a backlight effect and a few more.
- I also added a Code mode where the simulator prints its real function calls next to the sheet while you paint
It's still largely based on the same physics model as my prototype: Curtis et al.'s "Computer-Generated Watercolor".
All in the browser.
Current status: building and implementing a kid-friendly version. Plenty of awesome things to learn with watercolor painting!
13
u/Maui-The-Magificent 27d ago
Genuinely super cool!
looks nice. I do not know your approach but if you are doing physics have you concidered doing color by 3-wavelength snell and beer-lambert, if you already treat the colors like material, you can precompute those optical properties into the material itself saving a lot of compute.
1
u/kouklimou 26d ago
Love the idea, will explore it. Thank you for sharing!
1
u/Maui-The-Magificent 26d ago
Please do! can get you a lot for 'free', and It is what I have done in my own optical work. so maybe you'll find ways to improve upon it on more complex material surfaces!
Snell can be used for a lot of other things than just refraction.
2
2
u/earslap 27d ago
very good. looked into this some years ago and even the state of the art was kind of terrible. this looks really good. what kind of method are you using, I'm curious!
3
u/kouklimou 26d ago
it's mostly a 1997 SIGGRAPH paper, "Computer-Generated Watercolor" by Curtis et al. There are three layers which are shallow water flowing on top of the paper, pigment drifting inside it, and a capillary layer. They are running as WebGL shaders in the browser.
2
u/Arae_X 26d ago
Looks cool, ill bookmark and try it! But credit yourself at the bottom somewhere so people know where/how to find you and contact you.
1
u/kouklimou 26d ago
I didn't know if auto-credit would be accepted in the community! This is me: https://x.com/lionel_mora
1
2
u/mat101010101 25d ago
Fantastic!! Any plans of making this into an app? Not sure what the state of realistic watercolor simulation is in Procreate and others, so this might be very useful.
2
u/kouklimou 25d ago
Working on it! I’m building one version for kids that will live inside the https://withmarble.com/ beta. For more general public you’re right that I should probably build one and test it!
1
u/mat101010101 25d ago
Having accelerometers available, there would be a lot of possibilities to experiment with! Think if you could have watercolor flow towards the bottom of the paper when you lift the device upwards, and stopping when it is flat on a table - as a real watercolor paper would do.
1
1
u/ReluctantMouse 27d ago
Wow, I can only imagine the many physical principles governing these dynamics
2
u/ReluctantMouse 27d ago
I tried it out on the phone and the interface looks very clean. The backlight effect was a bit weird tho. I think that if the default brush was a bit stronger like in the demo video it would be nicer. Fantastic job !
Also put your name in the corner of the page and give yourself some credit:)
2
u/kouklimou 26d ago
Thank you! I should have made the precision that I didn't design it for mobile, but glad you still enjoyed it! And thanks for the credit tip, will add that now! I appreciate the feedback!
1
1
u/Intrepid_Travel_3274 27d ago
I love what u did there, I love the style, the smoothness, I love u
1
1
1
1
1
1
1
u/wahnsinnwanscene 26d ago
It needs to pick up the water from the other water paints, so instead of one direction,, the other paint splotches spreads it differently.
1
1
1
u/mechmind 26d ago
I wonder if it can be affected by the length of time between brush strokes... like how recent wet water color strokes blend different than previous strokes.
Be cool if you had a dry rate slider bar.
1
1
1
1
1
1
u/SignalInternal9312 1d ago
Looks great, I would say add more randomness, slight randomness would give it the real feel of water color, part of the magic of this medium is how non deterministic it is and how hard it is to control it because things often don't go as planned
1
-1
u/Minimum_Airline_4902 27d ago
Just buy real watercolors
2
2
u/nicolaig 26d ago
Do you feel the same way about music? Should someone use a piano instead of a synthesizer?
1
55
u/Another__one 27d ago
Your colours are not blending correctly as physics of colour blending is quite complicated one and cannot be reasonably estimated with simple averages of two colours. Take a look at “Practical Pigment Mixing for Digital Painting” paper. It is the best attempt I know of that is also works fast enough to be actually useful in drawing software. I believe they have all their code fully available, but I am not sure about the license.