Godot Vertex Shader Documentation
Repository
https://github.com/godotengine/godot-docs
Details
As an open source project Godot has a lot of trouble keeping its documentation fresh and relevant. This is likely because most people interested in open source projects are programmers and all they want to do is program. This is all the more true with a game engine as it attracts mostly people who want to make games, not people who want to work on tools. This situation leaves Godot in a place where much of the documentation has been around for awhile, and while it is still good, it becomes a little outdated. This PR replaces a section of the documentation to focus on using the vertex shader to displace vertices in a mesh, something that many new users would like to know more about.
The new documentation explains how to create a mesh within Godot and then create and apply a shader material to it. Then it explains how to write and use a vertex shader to displace the vertices to create a new heightmap. This is very useful for creating a lot of different effects.
One important part of this contribution is that it includes a code implementation of fbm-noise. fbm-noise is something that is used a lot for graphics stuff in gamedev but many new programmers struggle to implement it. So having an implementation in the official documentation should help many new users.
Heightmap made with sin and cosine:
Heightmap made with noise (much more interesting):
Components
This documentation teaches new users how to:
- Create and subdivide a Plane Mesh
- Create and assign a material to a Mesh
- Write a Shader that displaces the vertices of a Mesh
- Pass values (Uniforms) into a Shader to update the Mesh in realtime
- Approximate normals from a height function
- Use a light with a custom material
Difference
This tutorial replaces one titled "Mesh generation with heightmap at shaders". The old tutorial required the user to use Gimp and Blender to make a plane and a heightmap. The new tutorial removes those requirements and instead goes more into depth on how to use a Vertex shader.
At the end of the tutorial the user should end up with something like this:
Links
http://docs.godotengine.org/en/latest/tutorials/3d/vertex_displacement_with_shaders.html
GitHub Proof of Authorship
- GitHub Account: https://github.com/clayjohn
- Pull Request: https://github.com/godotengine/godot-docs/pull/1540
Leave Godot Vertex Shader Documentation to:
Read more #utopian-io posts
Best Posts From Clay John
We have not curated any of clayjohn's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Clay John
- Godot: Bug Fixing
- Godot Development: MSAA in the GLES2 backend
- Godot Documentation: Introduction to Shaders series
- Godot Documentation: Differences between GLES2 and GLES3
- Godot Documentation: Animating Thousands of Objects
- Godot Documentation: Shader Reference
- Godot Documentation: Advanced Post-Processing
- Godot Documentation: Custom Post-Processing
- Godot Documentation: Shader Migration Guide
- Godot Documentation: Using a Viewport As a Texture
- Godot Documentation: Lights and Shadows in 2D
- Godot Vertex Shader Documentation
- Godot Viewport Documentation
- Documentation for Godot | PanoramaSky and ProceduralSky
- Building a Procedural Solar System in Godot
- Updates On World Generation and Passing Data From CPU to GPU
- Post Processing with three.js
- Into The Great Abyss: A game about exploration and resource management
- Learning 3D Graphics With Three.js | Raycasting Part 2
- Learning 3D Graphics With Three.js | How To Use a Raycaster