Skip to content

dip000/godot-landscaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Godot Landscaper

Terrain builder, terrain texturizer, instance scatterer, grass scatterer, grass colorer. Based on textures and paintbrushes

🌟 Update: Added scene instancer brush. Paint-spawn rocks, trees, particles, people, and anything you want!
🌟 Update: You can move your terrain wherever you please and the canvas will follow it (finally yay!)
🌟 Update: Critical fixes are open before launch. Please propose them by joining the conversation in THIS THREAD. Thanks!

Content

  1. Features And How To Use Them:

  2. Performance Concerns

  3. Addressing Current Caveats

  4. Roadmap To Beta And Asset Library

  5. Author Notes

Features And How To Use Them

Follow the next steps:

  1. Download and install this Plugin. See installing_plugins
  2. Open a scene, and instantiate a 'SceneLandscaper' node in the scene tree. It will create a new terrain template
  3. Select the 'SceneLandscaper' node and go to the "Landscaper" tab over the right dock.
  4. Select your brush and click and drag over your terrain to start landscaping!

Terrain Builder

Brush that generates new mesh when you paint over the terrain.
Paint with left-click to build a new mesh, and paint with right-click to erase.
TerrainBuilder

Brush Properties:

  • Canvas Size: Size of the effective building area in meters squared, centered in your terrain

Note that the canvas will always follow your terrain wherever you move it

Terrain Color

Brush that color-paints your created terrain.
Paint with the selected color using left-click, use right-click to smooth the selected color.
TerrainColor

Brush Properties:

  • Color: Color of the terrain paint
  • Resolution: Size of the texture in pixels per meter

This texture is saved in the file system with size = resolution*terrain_size

Terrain Height

Brush that changes the height of your created terrain.
Create mounds with left-click, and create ditches with right-click.
TerrainHeight

Brush Properties:

  • Strenght: How quickly you want to raise or lower the ground when you paint over the terrain
  • Max Height: How the grayscale of this texture is interpreted in the real world. This property is not destructive
  • Apply To All: Applies a soft black/white mask over the whole texture. This property is destructive

Grass Color

Brush that color-paints your spawned grass.
Paint with the selected color using left-click, use right-click to smooth the selected color.
GrassColor

Brush Properties:

  • Color: Color of the terrain paint

Note that only the top of the grass is being colored. That's because the bottom half is taking the color of the terrain!

Grass Spawn

Brush that spawns new grass over your created terrain.
Spawn grass with left-click to spawn your selected grass variant or right-click to clear any grass
GrassSpawn

Brush Properties:

  • Density: How many grass instances are inside the area you have painted with this brush
  • Quality: Subdivisions for each blade of grass. This affects its sway animation and gradient color smoothness (because is vertex colored)
  • Gradient Value: The color mix from the grass roots to the top as seen from the front. BLACK=terrain_color and WHITE=grass_color
  • Enable Details: Renders the details of your grass variant texture. These are the sharp margin edges in the preview grass shown here
  • Detail Color: Recolor of the black tint of your grass texture. Has no effect if your grass doesn't have details to begin with
  • Size: Size of the average blade of grass in meters
  • Variants: A list of grass textures to use. Does not create extra materials but more than one requires a Forward+ renderer.
  • Billboard: Types of billboarding. BillboardY (grass always looks at the camera), CrossBillboard (for each grass, spawns another 90 degrees in the same position), and Scatter (Scatters the grass with random rotations)

Instancer

Brush that spawns your custom scenes
Spawn with the selected scene using left-click, use right-click to erase.
Instancer

Brush Properties:

  • Scene: Open or drag-and-drop your scene with the extension ".tscn" or ".scn". Instancer will load it and instance it from here. Clear it by erasing the path
  • Randomness: Random range between 0(0%) and 360(100%) degrees that the instance will be spawned with.

Performance concerns

About Textures:

  • Terrain and Grass color textures are stored in separate files as PNG and their size in pixels is calculated as "resolution*world_size". This means that the file is as big as the terrain's bounding box.
  • Terrain and Grass color textures are not mipmapped (LOD) internally, but after saving the project they can be mipmapped by the user on import settings.
  • Every texture except Terrain and Grass color, is stored in a "project.res" file. They are not relevant for end-products and the project file itself can be deleted if the user doesn't want to edit the landscape anymore.

About Grass:

  • This version now supports GL Compatibility rendering! But it is limited to one grass variant due to the lack of shader instance variables in Compatibility
  • Coloring the grass is optimized by using vertex colors. This means that the shader is only coloring as few as 4 vertex per instance (The vertices of a square)
  • You can set how many vertex to use per grass in "GrassSpawn Brush > Quality"
  • Grass chunking has not been implemented yet.

Addressing Current Caveats

About Spaggeti Code:

  • It takes just a quick look at the code to figure that things are poorly patched, this is mostly due to this plugin being "designed to be a dog house but ending up as mansion". The very first iteration was just a tool script to scatter grass... Needless to say, the dog house builder (a.k.a DIP) had to learn how to build a mansion and things ended up barely holding together. This may or may not be fixed in the future, depending on if it catches up in the community and if it is worth the struggle, after all, Godot has no real market to make a profit out of this.

About Bugs That I Couldn't Fix:

  • Click-trough: When you click over any UI window in front of the 3D scene, the scene will also receive the click and you might end up painting a big ugly spot on your terrain. Same as before, I lack the information to know how to fix this
  • Imperfect RNG: To spawn random things like grass and instances, the current random number generators make the spawning consistent, but you might quickly notice that it suddenly changes and your tree is now looking west instead of north. That's because the RNGs are based on the size of the terrain, so when the terrain bounding box changes, the RNG pattern changes. I haven't found a good approach to solve this issue since we have to raycast a LOT of random spawn points, and basing the RNGs in something more consistent like a 100x100 meters area will be a lot more costly
  • Expanding Textures: When you press [Save Project], extend the terrain, then press [Load Project]. It will try to extend the previous image, looks awful, and creates errors down the line. Right now I don't have a proper way to handle this issue
  • Random Errors: Sometimes, GodotLandscaper just doesn't want to work. In that case, try disabling-enabling the plugin, then selecting-deselecting the SceneLandscaper a few times shrugs

About Backward Compatibility:

  • Version control was not even planned and loading previous versions might not work right off the bat. However, you can always load the previous version resources manually and go about fixing the details. After all, this plugin is purely based on textures, so in the textures is all the information to rebuild your terrain

About Using External Tools For Fine-texturing:

  • This is possible by saving your project, opening the outputted textures with your preferred tool like Photoshop, and then saving them back as png with the same size. GodotLandscaper will always run an input format to decompress, de-mipmap, and convert to RGBA every time you press "Load Project" from the Landscaper tab. However, I cannot say for certain that this will work for every case

About Shading or Un-cartooning The Meshes:

  • By default, the landscaper will set the terrain material as StandardMaterial3D with shading as SHADING_MODE_UNSHADED, and the ShaderMaterial of the grass is set as unshaded (from code).
  • This makes the colors of both - the terrain and grass - match perfectly regardless of the lighting. This is great for cartoonish styles but far from a PBR landscape. Now, you can enable shading to both of them by accessing the mentioned properties but now you'll have to fix the colors with either lights, emissions, or postprocessing because that's not something that the landscaper can do on its own. Also, for performance (and definitely not because I don't know how) you'd need to set the normals of every blade of grass from the shader so the lighting is received correctly.

Roadmap to Beta and Asset Library

  1. Save And Bake Everything In A External Folder

  2. Add Support For Multiple Grass Billboarding Options

    • Cross billboard
    • Billboard Y
    • Scatter
  3. Add Terrain Generator Brush

    • Click over the terrain and create a mesh surface
    • Meshes are ImmediateMesh that are generated dynamically instead of using a shader
  4. Dedicated UI For Paintbrushes

    • Custom control in rightmost Dock
    • Recouple brushes for this new system
  5. Add Instancer Brush

    • Use the same logic as the grass spawner but with custom scenes instead of grass
  6. Critical Bug Fixes

    • A small period when the most game-breaker bugs will get fixed. No major updates will be coming up
  7. To The Asset Library

Author notes

Hi, nickname's DIP. Thanks for passing by!

I'd be glad to hear what you have to say about the grass shader HERE. Or contact me about this plugin at ab-cb@hotmail.com
See ya!

And for those who sent their feedback, thank you very much!

About

Grass scatterer, grass colorer, terrain builder, terrain texturer, and terrain colorer. Based in textures and brushes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published