tyFlow Forum
Displacement along surface - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: Bugs and Issues (https://forum.tyflow.com/forum-3.html)
+--- Thread: Displacement along surface (/thread-2125.html)



Displacement along surface - Alexx31 - 01-02-2021

Hello,
"we" are once again at the ever-lasting topic of organic breaking edges, but accomplished in a procedural way.

Someone found a good approach with subdividing and displacement along with the surface directions on a flat plane.
This was possible because the surface is of course easy to define in world space.

For a more complex bent object is the "opposite" of the surface normal needed.
Currently, we can only choose surface normal (or vertex normal) but can not use it as a reference space for each single particle to define X, Y and Z.

And defining displacement directions (X Y Z) is only in "world space" or "object space" possible, but for the bent surface of a sphere it does not help.

On the screenshot with the "test sphere" we want to get the vertices being displaced only along the surface direction.

(This is similar to the approach, to give inner faces an own MatID and displace them: That is also using the "surface direction". But this MatID workflow is much heavier and impossible for small tweaks)


2. Also helpful would be, to be able to only define border edges for this displacement action.
Because inner faces do not change the cut and only distort mapped textures.
Otherwise this method is only usable for monochrome objects.

Missing "surface direction" = those axis which are NOT along the surface normal:
   

The expected result from this approach is very nice and organic looking, something Tyflow would really help to get procedurally so easy!
   

Also, it should be possible, to let that only happen on previously broken edges.
In this case, a mapped texture becomes distorted all other "good" edges were involved too.
Clearly to see at the outer shapes in this screenshot:
   

Thanks for looking!

p.s. I should have posted this better at the "feature request section"


RE: Displacement along surface - tyFlow - 01-03-2021

The problem is, "surface direction" is not easily definable. On a sphere or plane it seems easy to imagine, but on a complex, concave object with sharp features and creases it is not.

The ideal solution is just to have a robust CSG library that can do legitimate concave cuts. The problem with that is that there aren't really any good open source ones available, and I'm not in a position to dedicate many, many months of research to developing my own based on the available literature. So we'll just have to use workarounds until someone releases one.


RE: Displacement along surface - Alexx31 - 01-03-2021

It‘s really actually easy if we break down what we really need and how we already achieve it with border faces in other situations:
- We only need border edges here for organic breaking, so let’s forget about all the inner faces.
Description of Extended workflow with one example piece, no matter how this is shaped or bent!
1.create shell from it
2. select the newly created border faces
3. displace those faces with noise along their normal
result: their vertices will of course be moved along surface direction of the original piece
4. we only need the original surface, the shell was only created to compute the displacement direction
So lets now delete everything again what was added in the „shell operation“ , when we created the additional shell faces.
result:
your original mesh with the desired edge displacement only (!!!) along surface direction.
This is what people are needing only and desperately.
And this should actially be implemented into a voronoi already as „border edge subdivision with border noise attribute“
:-)

I can make you a draft.
It’s only considering the surface normal of each single border face.
Then the needed displacement diection is 90degree towards the direction of the border edge of that face.
This operation is done separately for each border face of a surface.
So easy!

And in order to have visible „organic“ displacement, it’s needed only for that border face, to subdivide it.
(this value could be set individually as it is possible with the noise settings.


RE: Displacement along surface - Alexx31 - 01-03-2021

Definition of the displacement direction (axis), computed on a per-single-border-face basis:
It’s the intersecting line between
- the surface plane of the border face itself
- and if you think of the border edge as being also a surface normal of a plane (just an imaginary help plane)
Where these two planes intersect, this is the needed axis of displacement.

Actually the same like extruding an edge, only in this case adding subdivisions and extruding by noise values.

And for vertices of adjacent border edges, which will be computed twice (once with each adjacent face), just take the average value.


RE: Displacement along surface - Alexx31 - 01-03-2021

Additional thought:
If we just think one step further, an implementation into voronoi would make sense, too,
for another reason regarding textured meshes:
The movement of border edges will always require to reproject the texture, because it’s deformed (= texture distorted) there.
If the operation is happening in one operator, then the voronoi cutting can happen only at the end, after all computation of edges is done within that operator.
And doing only cutting means no change for texture appearance.

So the voronoi would not cut and then displace thereafter, it would at first compute the final position of the already displaced „noisy subdivided“ final cutting edges, and then only once cut there.

The displacement computation for inner faces of the voronoi seems to me even easier to define:
It’s driven by the same global noise attribute, only constraining the „movement“ (or edge placement then) to the original surface.


RE: Displacement along surface - tyFlow - 01-04-2021

The Shell idea only works if you're fracturing a thin surface. Also it just adds extra steps since it's not necessary in order to compute perpendicular normals. The Displace operator can already be used to achieve the same result.

The result of a Voronoi fracture should stay convex in order to play nicely with PhysX. Things like cut-face displacement need to be kept as a post-effect.

The only exception would be proper CSG cutting integrated into a fracture operator that I mentioned above. In that case, the benefit of proper cuts would outweight the downside of convex hull intersections.


RE: Displacement along surface - Alexx31 - 01-05-2021

Thanks for the explanation, which I partly understood ;-)

- I don't know CSG, what is it?
I tried to google it but didn't find it. Every choice and improvement for fracturing patterns would be highly appreciated.

- I haven't achieved a displacement result, as shown in the examples with a more complex geometry.

I checked today again all the well-known "fracturing" example files, and there is only the "fractureDisplace" showing round breaking on the primitives.
But this is not good working with more complex objects and the pieces do not fit together like a puzzle.
I will post this with screenshots in the "issues" thread, where also reference screenshots for comparison are Smile


RE: Displacement along surface - tyFlow - 01-05-2021

CSG stands for Constructive Solid Geometry, but you're probably more familiar with terms like "boolean subtraction, union, intersection, etc", which fall under the CSG umbrella. Basically what I mean is that ultimately the best fracture method would be to use noisy planes to define cuts, rather than trying to displace convex cuts after the fact.


RE: Displacement along surface - Alexx31 - 01-06-2021

The tyCarf (which is using the CSG, which you mentioned) creates of course nice results.

So if that technique could be integrated into a Voronoi, which would give the ability to use it procedurally, it would be of course a great improvement.
It also seems to work smart with topology regarding the polycount.

(About the technical side I have no deeper knowledge. All I wanted to suggest above were just "mathematical" thoughts, that seemed easier to me.)

I have attached screenshots from a quick test done with the tyCarf, again on a "shell sphere".