Class MaterialManager
- java.lang.Object
-
- be.yildizgames.module.graphic.material.MaterialManager
-
public abstract class MaterialManager extends Object
Manage the construction of materials.- Author:
- Grégory Van den Borre
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMaterialManager()Full constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MaterialcreateBlendMaterial(String name, String path, String path2)Create a blended material with 2 files.FragmentShadercreateFragmentShader(String name, String file)Create a new fragment (pixel) shader with 'main' as entry point and 'PS_1_1', 'ARBFP1' as profiles.FragmentShadercreateFragmentShader(String name, String file, String entry, Shader.FragmentProfileList profile)Create a new fragment (pixel) shader.protected abstract ShadercreateFragmentShaderImpl(String name, String file, String entry, Shader.FragmentProfileList profile)Create a shader fragment type.MaterialcreateGuiMaterial(String path)Build a simple GUI material, with alpha transparency and light disabled.MaterialcreateGuiMaterial(String name, String path)MaterialcreateMaterial(be.yildizgames.module.color.Color color)Create a new Material with a given color to set as ambient and with a random unique name.MaterialcreateMaterial(be.yildizgames.module.color.Color color, String name)Create a new Material with a given color to set as ambient.MaterialcreateMaterial(String name)Create a new Material.protected abstract MaterialcreateMaterialImpl(String name)VertexShadercreateVertexShader(String name, String file)Create a new vertex shader with 'main' as entry point and 'VS_1_1', 'ARBVP1' as profiles.VertexShadercreateVertexShader(String name, String file, String entry, Shader.VertexProfileList profile)Create a new vertex shader.protected abstract ShadercreateVertexShaderImpl(String name, String file, String entry, Shader.VertexProfileList profile)Create a shader vertex type.MaterialloadSimpleTexture(String path)Create and load a simple Material with a random name.MaterialloadSimpleTexture(String path, MaterialPass.Transparency transparent)Create and load a simple Material with a transparent image and a random name.MaterialloadSimpleTexture(String name, String path)Create and load a simple Material with a given name.MaterialloadSimpleTexture(String name, String path, MaterialPass.Transparency transparent)Create and load a simple Material with a transparent image and a given name.
-
-
-
Method Detail
-
createMaterial
public final Material createMaterial(String name)
Create a new Material.- Parameters:
name- Material name, must be unique.- Returns:
- The newly built material.
-
createMaterial
public final Material createMaterial(be.yildizgames.module.color.Color color)
Create a new Material with a given color to set as ambient and with a random unique name.- Parameters:
color- Color to set as ambient in the fist pass of the first technique.- Returns:
- The newly built material.
-
createMaterial
public final Material createMaterial(be.yildizgames.module.color.Color color, String name)
Create a new Material with a given color to set as ambient.- Parameters:
color- Color to set as ambient in the fist pass of the first technique.name- Material name, must be unique.- Returns:
- The newly built material.
-
loadSimpleTexture
public final Material loadSimpleTexture(String path)
Create and load a simple Material with a random name.- Parameters:
path- File used as image for the texture.- Returns:
- The created and loaded texture.
-
createBlendMaterial
public final Material createBlendMaterial(String name, String path, String path2)
Create a blended material with 2 files.- Parameters:
name- Material name, must be unique.path- First file.path2- Second file.- Returns:
- The created material.
-
loadSimpleTexture
public final Material loadSimpleTexture(String name, String path)
Create and load a simple Material with a given name.- Parameters:
name- Material unique name.path- File used as image for the texture.- Returns:
- The created and loaded texture.
-
loadSimpleTexture
public final Material loadSimpleTexture(String path, MaterialPass.Transparency transparent)
Create and load a simple Material with a transparent image and a random name.- Parameters:
path- File used as image for the texture.transparent- Transparency type.- Returns:
- The created and loaded texture.
-
loadSimpleTexture
public final Material loadSimpleTexture(String name, String path, MaterialPass.Transparency transparent)
Create and load a simple Material with a transparent image and a given name.- Parameters:
name- Material unique name.path- File used as image for the texture.transparent- Transparency type.- Returns:
- The created and loaded texture.
-
createGuiMaterial
public final Material createGuiMaterial(String path)
Build a simple GUI material, with alpha transparency and light disabled.- Parameters:
path- Texture file path.- Returns:
- The created and loaded texture.
-
createFragmentShader
public final FragmentShader createFragmentShader(String name, String file)
Create a new fragment (pixel) shader with 'main' as entry point and 'PS_1_1', 'ARBFP1' as profiles.- Parameters:
name- Shader name.file- File containing the shader code.- Returns:
- The built shader.
-
createVertexShader
public VertexShader createVertexShader(String name, String file)
Create a new vertex shader with 'main' as entry point and 'VS_1_1', 'ARBVP1' as profiles.- Parameters:
name- Shader name.file- File containing the shader code.- Returns:
- The built shader.
-
createFragmentShader
public FragmentShader createFragmentShader(String name, String file, String entry, Shader.FragmentProfileList profile)
Create a new fragment (pixel) shader.- Parameters:
name- Shader name.file- File containing the shader code.entry- Main function name.profile- Profiles to set.- Returns:
- The built shader.
-
createVertexShader
public VertexShader createVertexShader(String name, String file, String entry, Shader.VertexProfileList profile)
Create a new vertex shader.- Parameters:
name- Shader name.file- File containing the shader code.entry- Main function name.profile- Profiles to set.- Returns:
- The built shader.
-
createFragmentShaderImpl
protected abstract Shader createFragmentShaderImpl(String name, String file, String entry, Shader.FragmentProfileList profile)
Create a shader fragment type.- Parameters:
name- Shader name.file- Shader file.entry- Entry point name.profile- Profile to set.- Returns:
- The created shader.
-
createVertexShaderImpl
protected abstract Shader createVertexShaderImpl(String name, String file, String entry, Shader.VertexProfileList profile)
Create a shader vertex type.- Parameters:
name- Shader name.file- Shader file.entry- Entry point name.profile- Profile to set.- Returns:
- The created shader.
-
-