Goshapes makes it easier to rapidly generate level geometry in Godot 4.
This tool augments Path3D nodes with the following abilities:
- create custom block meshes (earth, buildings, etc)
- create path meshes (fences, paths, roads)
- scatter instances (trees, rocks, grass, etc)
This makes it ideal for quickly putting together 3D environments.
Goshapes wraps your custom meshes to a path you specify in the editor:
You can also use paths to procedurally place instances: ^ Notice that the trees above both snap to ground and ignore the footpath. This can be toggled by layer masks.
Goshapes 1.1.0 has been released Feb 14th, 2023 and follows RC1 of Godot 4. It fixes several issues that arose due to changes throughout the alpha and beta.
- Goshapes' folder structure now correctly adheres to the Godot plugin specification, making it an easy include from the Asset Store.
- Compilation fixes to issues that arose from changes made to GDScript during the Godot 4 alpha period.
- Line-pathed Goshapes now generate much cleaner and more even corners, making squared paths easy to generate.
- Inspector hints have been added.
To install, use the Godot Asset Library or clone this repository into the addons folder of your Godot 4 project, so that its path in your project is res://addons/goshapes
.
A few sample scenes, and some sample shape styles and materials have been included under the addons/goshapes/samples
folder. Have a play around there, it should help demonstrate what's possible.
Goshapes works mainly in the inspector. You can add a new Goshape through the add menu or the Goshapes menu in the top toolbar.
The inspector will always have shape native properties and path options. Path options can be copied between shapes, while shape native properties are individual. The data for shapes is contained within Resources. This means you can rapidly assemble shapes using preset styles and options or set to local to set custom for each shape.
For a Goshape, all functions and configurations can be achieved using the inspector.
- Axis matched editing is useful for inorganic shapes like buildings or structures. When enabled it will caused axis-aligned points to move with the point you're currently editing.
- Invert and recenter alow you to change the direction and origin respectively.
Alongside that, there's the Path Options which can be copied between shapes.
- Flatten will force the path to flatten the Y axis, which is useful when you're editing flat surfaces for a player or NPC to traverse.
- Twist will allow you to bend the path in weird and wonderful ways for shapes like corkscrews and vertical spirals.
- Line will cause the shape to extrude along the path instead of filling the path. This is useful for footpaths, roads and fences.
- Rounding will round the edges of the shape by the desired distance
- Interpolate affects the detail of the shape
- Points On Ground will cause the points to align to the surface below them using Raycasting
- Offset Y shifts the shape up or down
- Ground Placement Mask will affect which objects are selected in a Points On Ground raycast
The Shaper Resource contains the data that is used as instructions for what to generate within the Goshape. You can use these to have your Goshape generate geometry or objects using the type of Shaper used.
Shapers can be picked from the top of the GoShape inspector (Shaper must be expanded.)
Blockshapers are the main Shaper type for rendering geometry, they combine up to three Shapers to make geometry: the CapShaper, the WallShaper and the BottomShaper. For the most part, this is automatic.
There are three cap shaper types: Flat, Plane and Line. Flat and Plane are great for building most shapes (with Plane containing more detail) and Line is useful when using the line PathOption (see above). These three methods alter the triangulation technique used for the caps.
All Cap shapers take a material and render its UVs 1:1 in world space.
There are two wall shaper types: Bevel and Mesh. Bevel will generate a straight wall and allows tapering and bevelling. MeshWall is the most useful, allowing you to create custom geometry and wrap it to a wall. There are some tricks to creating that geometry, that I go into below (see Making Mesh Walls).
A ScatterShaper allows for as many instances as is needed within an area:
- Density controls how likely an instance is to spawn
- Spread changes how far apart the instances are (actual distance from neighbour is between 0 and spread * 2
- Seed changes the random seed
- Place on ground causes the genernated instances to be placed on the ground using Raycasting
- Noise lets you override the inbuilt random function with a noise texture
- Evenness changes how well aligned the instances are to each other. The higher the value, the less organic the scatter selection is.
I initially developed this addon for Godot 3, as GDBlocks. Goshapes marks an increase in scope that was made possible thanks to new tools and performance improvements in Godot 4 and was developed predominantly during the Godot 4 alpha period. As the change is quite dramatic, I've decided to fork my own project and make the improvements here. Going forward, this will be the only active project in development - though I'm working on it as slowly as a hobby.
I will endeavour to review any pull requests on Github that fix, optimise or compliment existing functionality without changing the nature of previously generated output. Please note that, while I'm a hobbyist and may sometimes take a little while to respond, I do enjoy and welcome the code contributions of others.