Alright I got something working kind of.
However not the exact result I am looking for
Where I actually want the mask to be applied to the tiles of the other textures.
I am having trouble thinking of how to explain this.
Code:
with GLMaterialLibrary1 do
begin
with AddTextureMaterial('grass_alpha', 'grass_alpha.jpg') do
begin
Material.Texture.TextureMode := tmModulate;
Material.BlendingMode := bmAdditive;
Texture2Name := 'grass_texture';
end;
with AddTextureMaterial('grass_texture', 'grass_texture.jpg') do
begin
//Material.Texture.MappingMode := tmmCubeMapReflection;
end;
end;
with GLMaterialLibrary2 do
begin
// Pass : 1
with AddTextureMaterial('Pass1', 'dirt_texture.jpg') do
begin
//Material.Texture.TextureMode := tm;
//Material.BlendingMode := bmAdditive;
//Texture2Name := 'TestGrass';
end;
// Pass : 2
with TGLLibMaterial.Create(GLMaterialLibrary2.Materials) do
begin
Name := 'TestGrass';
Material.MaterialLibrary := GLMaterialLibrary1;
Material.LibMaterialName := 'grass_alpha';
//material.Texture.TextureMode := tmBlend;
//Material.BlendingMode := bmAdditive;
end;
end;
and then the I have a material in the GLMaterialLibrary1 that has a shader that blends all of the materials in GLMaterialLibrary2 to create its texture.
Any suggestions?
Bookmarks