#GameDev #Godot #Geometry #Procedural #PCG #CatmullClark #Subdivision #GeometryMerging #Prototyping

A short playlist showing a couple of examples of merging geometry from an input set of cubes and then CCS subdividing it...

https://www.youtube.com/watch?v=4hPTj0EJ1-Q&list=PLhJWIs18UOUg_SQN_5ZUmx7ym3c6naXgB

2025 05 19 14 32 14

YouTube

#GameDev #Godot #Subdivision #CatmullClark #Cheese

I got tempted by the idea of experimenting with subdivision surfaces again, and, consequently, I present: Cheese!

CW: Possibly mild trypophobia

#GameDev #Godot #Subdividsion #CatmullClark #DebugDrawModeTotheRescue

Aaaaand, fixed! That wasn't really six hours solid debugging, or even an hour of drinking coffee and 4 hours debugging, there was cooking an eating a meal, watching the end of a Scandi Noire murder series... so maybe three hours solid debugging...

As ever, it's not assumptions you make that bite you the worst.

It's the assumptions you didn't even know were there. In this case the assumption that the edges are always added in to a vertex *clockwise*...

So, three hours debugging and one quick method VertUtil.ToVertWithSortedEdgesAndPolys(...) later and it finally looks like I'm really doing what I thought I was doing three days ago.

#GameDev #Godot #Subdividsion #CatmullClark #DebugDrawModeTotheRescue

They do work, though! I wasn't able to work out why I had this weird dark wedge on the flat surface at the edge furthest from the light, but drawing the normals shows that vert's normal (for this surface, we have to split the vert/normal for a sharp edge) is pointing off at an angle instead of perpendicular to the surface...

Time to put my debugging hat on...

But first, a cup of coffee!

May have gone a bit over kill on the debug draw modes here...

#GameDev #Godot #CatmullClark #Debug #DrawModes #DebugdrawModes

#GameDev #ProceeduralGeometry #CatmullClark #SmoothEdges #SmoothVertices #SharpEdges #SharpVertices Some more progress with this.

- I got the normal calculations working (but I am not splitting any vertices, which is why the sharp circular edge at the base looks a bit "soft".)

- I added code for tagging verts or edges as "sharp" and implemented the CatmullClark special cases for processing those (which took some getting right, let me tell you, don't talk to me about taking a vert from the new array when it should have come from the old one...)

Not quite as advanced as I hoped to be by now, but looking pretty good...

Next step: try out the dozen or so examples which I hope will look good for use as part of differently styling different sort of generated landscape...

Further out: I need to get to grips with UVs... and possibly think about some sort of styling that can reach inside the divided mesh and (e.g.) apply grass to the top and "roadway" to selected contiguous smooth strips...

#Godot #PGC #Subdivision #CatmullClark #GameDev #ProceduralContent #CSharp #LotsOfScaryLinq

OK, finally got away from cubes... of course, you can't see exactly what shape this is, because I didn't add any normal calculations yet, but "roughly spherical" broadly sums it up...

If I get time tomorrow I'll add the normals, and then look into adding the calculation refinement that lets us tag verts/edges as "sharp"... Combos of sharp and smooth edges let us create all sorts of shapes, like if you leave the top and bottom edges sharp, but the side ones smooth you get a roughly cylindrical shape... Or you can do a block with a hole in it if you do the same thing to the edges around a square hole...