9

I'm trying to recreate the surface of a coral reef, and I would like to experiment a little with geometry nodes.

My result so far, I just do a Distribute points on face, and Instance on points.

enter image description here

My main issue is that I want to preserve the green area of an instance, and cut/merge in the red area, so it doesn't obstruct the green area of the instances. But I didn't found a workaround to do it.

Any tips?

Source file

Best regards, Samih.

vklidu
  • 36,165
  • 1
  • 61
  • 135
  • 1
    Very interesting question! There is definitely no simple solution here. Maybe someone (me?) has a little more time to take a closer look... Would it be possible to share your blend file in the meantime so we don't have to recreate the shape somehow? – quellenform Jul 08 '22 at 09:47
  • 1
    @quellenform I edited my question with the blend file, thanks a lot – Samih EL SAKHAWI Jul 08 '22 at 10:12
  • but you know that you can increase the distance min of the poisson disc so that it won't happen? – Chris Jul 08 '22 at 10:23
  • @Chris As I understand it, this is about the transitions (cut edges) of the individual corals. Or not? (https://st4.depositphotos.com/39212402/41061/i/1600/depositphotos_410610182-stock-photo-coral-texture-brain-coral-taken.jpg and https://thumbs.dreamstime.com/z/harte-koralle-85967451.jpg) – quellenform Jul 08 '22 at 10:30
  • i have no idea.... :D – Chris Jul 08 '22 at 10:31
  • @quellenform I want to recreate the same effect. – Samih EL SAKHAWI Jul 08 '22 at 15:55
  • @Chris By doing that, I get empty space, and if I fill it with something, it doesn't look organic. – Samih EL SAKHAWI Jul 08 '22 at 15:56
  • @SamihELSAKHAWI ...Yes, I understand, and i really like that idea! I just do not know yet how best to solve it :D ...as I said, the answer is not easy, if you really want to get it just so. Maybe I'll have an idea about it someday. ...or someone else who is capable enough. – quellenform Jul 08 '22 at 15:59
  • @quellenform I know lol And i'm not in a rush, so it's okay for me if I don't have a workaround immediatly – Samih EL SAKHAWI Jul 08 '22 at 16:01

4 Answers4

15

Instead of deleting overlapping parts that results in heavily calculated mesh (the boolean version) ... could be more efficient to start from scratch - build base pattern structure and model coral element from cell by extrusion.

I was aiming to quellenform's reference ...

enter image description here

Here a quick test based on Voronoi pattern ...

enter image description here

The core of this pattern is based on Fill Curve node and Dual Mesh. Object border and way of points distribution can be done in many ways. Usually I would use Distribute Points on Face > Poison Disk, but here I used more even pattern from Grid + Random offset.

enter image description here

To keep just cels un-cut by object border disable Keep Boundaries in Dual Mesh node.

enter image description here

Than you can set several nodes Extrude and Scale to shape coral element ...

enter image description here enter image description here

Subdivide, Distribute Points, Shade Smooth, ...

enter image description here enter image description here

To animate egg release (mentioned in comment) you can probably easily animate last Scale node value. To randomise it probably ask a new Q (I'm not sure about good solution.

enter image description here Just don't forget to add Delete node with Top socket of Extrude node as Selection.

vklidu
  • 36,165
  • 1
  • 61
  • 135
  • Very cool! I like this approach! I think this is another important step towards the solution.. Since you can select certain areas (rings) by extruding here, it may be possible to transfer the fine structure to the mesh in the process. ...just as an idea. – quellenform Jul 14 '22 at 16:58
  • @quellenform Yeah :) I like it too ... but it seems to be over my primitive skills ... it is waiting for you ... when you wouldn't be far, far a way :) Thanks – vklidu Jul 14 '22 at 19:51
  • Now, of all times, I'm actually far far away from a Blender-enabled computer again. Thanks to D. Trump, everyone knows that Austrians live in tree houses in the forest :D I'll spend the next few days harvesting some vegetables and looking for mushrooms (no kidding) and maybe then I'll have the bright idea how to solve this. ;-) cu soon – quellenform Jul 14 '22 at 20:38
  • 1
    By the way, thinking about it, I wouldn't really call what you're showing "primitive skills". In my opinion, it's a pretty decent piece of creative mastery. Just saying. Thumbs up! – quellenform Jul 14 '22 at 23:09
  • @quellenform ... lucky you :) Enjoy. By "primitive" I mean -the math part, to be able use it effectively the GN power in your way, but my brain is not :) Thanks anyway for couraging me :) For the "dotty" surface I wanted to extract extruded edges and by Resample control distance in radial lines separately ... but I wasn't able to figure it out ... at the end I reused Subdiv ... works probably the best and the simplest here :) – vklidu Jul 19 '22 at 08:43
  • Ingenious! I probably couldn't solve it any better! The fine structure can (and should?) certainly be done well with an appropriate shader. If I had asked the question, I would accept this answer because I don't think it could be done much better. Good work! – quellenform Jul 19 '22 at 10:29
  • @quellenform Thanks ... I see - too much mushrooms :) ... but I would have a few Q, like if there could be a way to shape coral element by curve object (aka profile) or Vector Curve node (instead of extrude-scale) ... how could be generated such dotted shader (I was able in one version to generate Height map from Points proximity, but I have no idea for such dotty lines) ... how to isolate extrude and scale just edge (for this I will ask probably a new Q). Anyway - I see a lot of space for you here :) – vklidu Jul 19 '22 at 14:20
  • 1
    Stunning work. Perhaps some variation on this for your q. re. shaping with Float Curve ? i.e Extruding by 0 height, and then making Z some function of [distance from dual mesh before extrusion] – Robin Betts Jul 19 '22 at 18:48
  • 3
    really great work and answer, well done mate!! +1 – Chris Jul 20 '22 at 09:04
  • @RobinBetts - Float Curve - in general yes :) Thank you for help. I just forget this node cant get "concave". Also it is hard to shape it for me ... probably Map Range issue blend ...probably I will ask a Q. Anyway ... thanks for the "gesture" :) – vklidu Jul 20 '22 at 18:21
  • Thanks a lot your a magician! I decide to take a part of your solution for my project! – Samih EL SAKHAWI Jul 22 '22 at 12:04
  • @SamihELSAKHAWI ...Wait a bit, I'm working on another interesting variant right now.... ;-) – quellenform Jul 22 '22 at 13:01
  • @quellenform I will wait lol but feel free to share another idea. – Samih EL SAKHAWI Jul 22 '22 at 16:39
7

I just want to show you the current progress, so that you don't think I'm just talking nonsense.

Of course, this is not yet a full-fledged answer to the question, but only a small teaser.

...Please have a little patience with me, the task is a little more complex than I thought.

enter image description here

But this much I can promise: It will be 100% procedural and super flexible (I hope):

enter image description here

...yes, and the node tree will grow big

enter image description here

...and yes, even the fine structures can be created here with Geometry Nodes. I'm curious myself how this will look with a good shader.

enter image description here

quellenform
  • 35,177
  • 10
  • 50
  • 133
  • Due to the low number of upvotes, I unfortunately see no reason to complete this answer, and as usual publish the blend file.... So this time these screenshots will have to suffice as inspiration. – quellenform Sep 15 '22 at 22:16
5

version Boolean

You can try create a coral without a hole and Boolean hole after distribution.

enter image description here enter image description here

Just since Boolean it would be probably calculation heavy :)

Note: Min Distance for Poison Disk distribution helps prevent overlap inner(higher) ring.

version Material-Transparent

Much lighter would be to hide those obstruct parts of mesh by assigning Transparent shader to those faces.

Before enter image description here

After enter image description here

Factor saying what faces will be transparent ...
You can use Circle object (filled with tris), scattered at the same places as Corals. For that purpose I created node Group from your node tree and duplicate it. Like that it is easier to keep scattering corals and circles synced when you change some scatter parameter.

enter image description here

Node Group (your scattering setup) enter image description here

Use Circle object as Target in Geometry Proximity node. This node assigns values (attributes) to each scattered coral's vertex depends on Circle's face distance (at Spread Sheet window you can see those values under Mesh > Face Corner).

enter image description here

These values can be translated into Black&White mask and used as factor for mixing Solid and Transparent Shader.

Plug Distance socket into Group Output node. I call it "Hole", but can be anything. Under Modifier Properties expand Output Attributes and name it this attribute (I used "Mask").

enter image description here

Switch to Shading layout. In Shader Editor add a Material and add Attribute node. Use the same attribute name used in GN (in my case "Mask"). If you plug Fac socket directly into Material Output > Surface socket you can see darker color at centre of each coral., but since this color is generated by Circle object, darker are also obstruct outer parts of coral lying in area of circles. To contrast this factor I used Math node > Greater Than

enter image description here

... but now we have transparent also whole centre of coral element. To avoid it I created a second material and assigned it to this centre part of coral that we don't want to be affected by transparency. For this simplicity and better illustration I used just bright pink color.

enter image description here

Anyway ... even you solve obstructing parts corals elements wouldn't be blended seamlessly as seen on screens). So, you should consider to start from some pattern or low res to be be able blend it in a process.

vklidu
  • 36,165
  • 1
  • 61
  • 135
  • Hi, the thing is that I want to animate the center area (like eggs that pop out from holes), and I can't achieve that with mesh booleans. – Samih EL SAKHAWI Jul 08 '22 at 15:59
  • I can check that issue, but main Q still remains -Would your computer handle boolean calculation? Isn't the Material version with Alpha better choice? Also Your Q is aiming to parts inside a holes, but quellenform's reference reminds me another issue your approach cant handle -blending parts of cells out of holes. It sounds to me you should start completely from different side ... like some voronoi pattern? Probably would helpful real image of your goal. Thanks – vklidu Jul 09 '22 at 21:22
  • I'm far, far away from a computer with Blender right now, so I can't work on this wonderful question any further, but I think you're absolutely right: you'd have to approach this from a completely different angle. I was also thinking of a Voronoi pattern, and you would have to work more from the outside in towards these shapes, but the more I think about it I come to the conclusion that Geometry Nodes or Blender are not the right choice for the task at all. This is more a task for Houdini because of the complexity... – quellenform Jul 09 '22 at 21:38
5

So I decided to take part of the idea of Vklidu. But the idea with material looks viable I think.

From the voronoi pattern, I instantiate points on mesh faces, and I scale the size of instances based on face area. Also, I adjust my model a little bit to avoid overlapping.

node setup

mesh

We can still see some overlapping, but since it's outside the camera, It's okay for me.

render

It would be great to merge vertices only where instances are intersecting, so it gives a more organic look.