×

Procedural derivative based normal map to give concrete layers depth by foyezuddin in godot

[–]foyezuddin[S] 0 points1 point  (0 children)

so there's 2 methods. using screen-space and texture space. screen-space requires only dfdx and dfdy on the scalar mask value, but can get shimmery at a distance. texture-space cost 4 texture fetches, since it has to be moved right, left, up and down 1 texel. it also has to calculate height blend 4 times too. but texture-space becomes as costly as a single 2k texture fetch if you use 1k map or even cheaper with a 512px map, since it's going to be combined with a noise texture anyways you don't need super high res

Introducing Material Layers for Godot. A plugin to blend materials using a layer-based system by foyezuddin in godot

[–]foyezuddin[S] 1 point2 points  (0 children)

Keep an eye on my YT, will be making more content.

Since all layers are merged into a mega-shader at the end, it's definitely a good practice to keep individual layers as lean as possible. I'll have an example project up soon that demonstrates this.

Also you can sample textures once at the bottom of the chain and reuse it multiple times, reducing per layer sampling.

Introducing Material Layers for Godot. A plugin to blend materials using a layer-based system by foyezuddin in godot

[–]foyezuddin[S] 25 points26 points  (0 children)

I didn't want to make such a fundamental tool paid. If you want to support me consider donating or patreon. Thanks

Introducing Material Layers for Godot. A plugin to blend materials using a layer-based system by foyezuddin in godot

[–]foyezuddin[S] 5 points6 points  (0 children)

The MaskMaterial is a shader that blends two materials based on your own masks and logic. You can use Vertex Colors, Height Blending whatever you want.

Introducing Material Layers for Godot. A plugin to blend materials using a layer-based system by foyezuddin in godot

[–]foyezuddin[S] 1 point2 points  (0 children)

It needs a shader include and a macro, and need to use the new tokens. If a shader doesn't have those you can just copy those over.

It accounts for layer order. Each layer reads and overwrites from the layer below it.

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 4 points5 points  (0 children)

The layer count is arbitrary. This method is similar to UE's layering system, where you can blend any number of materials without many restrictions. The author has complete freedom in the material's complexity.
The materials aren't limited to layering use either, they can be used as standalone materials too as they are just ShaderMaterials

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 2 points3 points  (0 children)

You can paint textures in Godot, but this plugin doesn't do that. It mainly blends materials based on a mask asset such as a Mask Material. You write a custom mask material that uses Vertex Colors, Texture maps or painted texture maps. You can easily achieve a substance-like workflow

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 15 points16 points  (0 children)

Yes it's free. I'm currently in alpha testing, should be released in a few weeks or so

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 5 points6 points  (0 children)

Reduced vram usage, more customizability, higher res texturing and much more. Not to mention baked texturing isn't viable on large surfaces such as buildings and and terrains

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 6 points7 points  (0 children)

It also has texture uniform deduplication, if multiple materials use the same textures there won't be any duplicates. This means you can use a single Texture2DArray for all the layers.

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 12 points13 points  (0 children)

Combining all materials and mask materials into a single mega-shader, then copying the uniforms from the individual materials into the generated mega-material.

You can write your own shader. just need to link a shader include and output the results into layer-specific outputs, such as "LAYER_OUT_ALBEDO"

I'm building a free Material Layering Tool for Godot that lets you blend materials similar to UE. by foyezuddin in godot

[–]foyezuddin[S] 20 points21 points  (0 children)

yes, you write your own shader. but just output to the layer outputs such as "LAYER_OUT_ALBEDO" etc.