Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
When you admire the worn paint on a metal door or the shimmer of water in a game, you're seeing the result of carefully crafted materials. In Grindstone, materials control how surfaces appear under lighting and effects by linking together shaders, textures, and property values. This system allows both technical and creative users to define the look of everything from gritty terrain to sci-fi armor.
Materials don't define shape — that’s what meshes do — but they define how light interacts with surfaces. This includes everything from basic colors and texture maps to more advanced features like transparency, normal mapping, or emissive glow.
In Grindstone, materials are flexible, asset-driven objects that can be previewed, edited, and reused throughout your scenes.
Each material is composed of three primary elements:
Each material points to a GraphicsPipelineSet, Grindstone's version of a shader configuration. This defines:
The pipeline set ensures all materials using it share consistent behavior, while still allowing individual customization through properties.
These are values passed into the shader to influence rendering logic. Examples include:
Color
: a float4 that tints the surfaceRoughness
: a float controlling how matte or glossy the surface looksUVScale
: a float2 for controlling texture tilingEach parameter is defined by the GraphicsPipelineSet, and supports various types including float, int, vectors, booleans, and arrays.
Resources are external assets such as:
These provide surface detail and variation, turning a flat red color into cracked paint or rough stone.
Materials are fully editable in the Inspector Panel once selected in the Asset Browser. The interface provides:
Fields are automatically generated depending on the property type:
This editor-driven UI ensures artists and designers can work efficiently without needing to understand shader code.
Materials are applied through a combination of components:
Each submesh in the model has a material index, which selects the appropriate material from the array. This allows you to apply different materials to different parts of the same mesh — for example, wood for the handle, steel for the blade.
Developers can create and customize materials at runtime using the scripting API:
This is useful for features like changing damage states, animating materials, or adjusting visuals based on gameplay events.
Materials can be:
.fbx
, .obj
, etc. via the Model Importer, which applies a default GraphicsPipelineSet
and attempts to assign matching texturesOnce imported, you can replace or customize the material as needed.
While Grindstone currently imports all materials, future versions will validate shader compatibility and usage. If a material fails to import (e.g., due to a missing shader), it will appear in the AssetWarnings panel, and:
This helps keep projects stable while alerting developers to issues needing attention.
SteelPlate
, AlienSkin
)Although not exposed to artists, materials in Grindstone are stored as JSON files. This allows them to be:
Here’s a basic example:
Most users will never need to edit this directly, as all material editing is done through the editor UI.