Hi there! I'm trying to make a technical mask of sorts that requires precision and I'm genuinely not sure how to make it, at least not without a fair bit of pain. Observe this image:
What I want is to create a circular gradient, but instead of a circle, I want it to apply to an arbitrary shape. Imagine that we assume some kind of middle point, which is that yellow line, and then given that middle point, the gradient spreads to the edge in all cases, evenly and precisely. Is there a simple way of doing this?
The only way I can think of to do this is to create a strip of polygons with a gradient on it, and wrap it around in the shape of a ring, and pull points until I get exactly what I want, and then render THAT to texture. This will work, it just sucks, because I want this to be on a complex 3d model, which means I'll have to draw the shape, see that it works, apply it to a plane, trace over it with geo, render to texture, and…
…well okay maybe it's not THAT big a deal but if an easier way exists that'd be really lovely…
Replies
Vertex color (either in a 3D software, or the equivalent as 2D vector) is pretty much exactly what you describe - by assigning pure white to the verts around the border, and pure black to the verts of the middle line :
pior - Thanks very much for the idea and for taking the time! That's kinda what I had in mind when I mentioned geometry, more or less. I'd rather not pursue that method because it's a bit labor intensive if I want this effect to be on a character, let's say, which has complex geo that I don't want to alter. SOOOO I'd have to make some arbitrary geo and then bake it to texture, blah blah blah.
supaclueless - HEY that's a good idea! Thanks for the setup example that's really awesome. That's pretty good but I think I need the center to be a much smaller shape or line that I can control.
Eric - thank you, that's another good idea, but same problem as above, I think.
Honestly all things considered I think I might be forced to do something like what pior recommends .
Oh by the way, if ya'll are curious, I'm using this as an alpha cuttof mask to do a ripping effect as a material stretches. it works great!
I would anticipate impurities from hand painted strokes to become more noticeable when clamping values, especially with something ornate in mind.
https://plugins.qgis.org/planet/tag/gradient/
And it looks like QGIS is free.
This actually sounds a lot like one of the many tricks to add shading/depth to a realtime eyeball ...
Yeah of course, I probably should have just posted an example of what I'm playing with. Here's an example of a rip effect I'm playing with, and the texture channels I'm using to animate it. Mostly I'd be looking for oval-like shapes... it probably wouldn't be deviating much... but of course when painted on a texture sheet, it won't be exactly an oval.
First of all, I use the red channel but animate the cutoff. Then, I use the green channel to animate the break, then use the last two channels as frames for a quick bounce for the torn edge.
Oh, almost forgot. Alex_J - it's a reasonable idea but I'm worried that I might need really precise gradients to make the rips feel natural - although I haven't done a ton of testing here. as killnpc said, I expect the artifacts from manual painting would cause weirdness.
I’d probably try the QGIS thing but ultimately go Pior’s route. Then just Gaussian blur it a bit.
I've stepped through a similar distance field here as an example of how it might look when animated
Pior's approach will give you a constant 'time' to reach the edge (ie. speed will vary with distance) - that could look more natural in terms of opening up a gap/tear as the centre line will split along it's full length at the beginning
getting a normalised distance to the median line of a shape is basically impossible with a bitmap so making a mesh and vert coloring it is probably the simplest solution
Eric - Skin, believe it or not. Cartoony skin though. Realism doesn't matter so much here.
Great point, Poopipe. There's a statement I never thought I'd say.
I've been on other things while this marinates, but if I discover anything while implementing this finally I'll update...