How to Start - Flowing paint in a canvas effect - Help needed!

Hey guys I’m looking for some directions on how to get started with a project that I have and I’m not sure if this is the right place to ask, but here goes.

I’m trying to achieve an effect of liquid paint dripping and flowing through a white canvas. The dripping effect I’m doing it using an asset called Obi Fluid, the effect is pretty cool but now I need to colorize the canvas with the color of the particles used in the obi fluid object.

Is there a way to maybe detect a collision between a particle and the mesh and get the color of the particle and maybe change the color by vertex coordinate, would that be efficient? I would like if someone could point me in the right direction.

Thanks for your time community.

If you want particle collision than

might be useful.

It’s very hard to understand the kind of result you are looking for. What exactly does it mean for the canvas to be ‘colorized’? What would the appearance be? Is this a baked effect, or controlled by the player?

Vertex colors tend to operate at the resolution of the mesh, which means that unless you have a mesh with a vertex resolution around the same resolution as the screen pixels, you’ll see jagged fading effect. This might be good enough but until you show us what you want it’s hard to say.

What kind of data object is the obi fluid object? Is it a Unity Particle System?

I think using a RenderTexture would be the best for this. Have a camera view the particle effect head-on to a Rendertexture. The rendertexure can be converted to a texture2D and applied to the canvas.

1 Like

The way I understand the request:

Imagine you’re standing in front of a white canvas. Then you splash of bucket of paint on it.
Whatever’s left on the canvas and not end up on the floor is intended result.

Render texture won’t produce a correct result, by the way, because canvas is supposed to absorb a portion of paint, flow off the canvas, etc.

Sorry if I were not clear enough, I’m trying to achieve a basic version of something like this:

Just one color at the time instead of the crazy color mix

Render texture (source) → custom render texture (effect)

1 Like

What I would probably try first is use vertex colors and touch it up in a normal mapped shader that cleans up the edges, smooths them out and creates a lip at the edge of the liquid. Using compute shaders you could maybe do it all on the texture in real time.

This code (well you have to reverse it first) may come in handy for you to find the UV position from world space: http://answers.unity.com/answers/372156/view.html

Very useful, I used it in a compute shader to generate a seamless planet texture from 3D perlin and voronoi noise.

So you mean when you mix yellow and red it goes orange or something?

Is not really mixing the colors, I’m more interested in actually painting the surface

By the way, if you’re just using a simple object such as a flat plane, you can get the uv coordinates of the texture from a mesh collider that has the same UV unwrapping as the mesh, just by using RaycastHit.textureCoord.