Skip navigation links

Package com.jme3.material

The com.jme3.material package contains classes for manipulating jMonkeyEngine materials.

See: Description

Package com.jme3.material Description

The com.jme3.material package contains classes for manipulating jMonkeyEngine materials. Materials are applied to geometries in the scene. Each geometry has a single material which is used to render that geometry.

Materials (also known as material instances) are extended from material definitions.

Material definitions

Material definitions provide the "logic" for the material. Usually a shader that will handle drawing the object, and corresponding parameters that allow configuration of the shader. Material definitions can be created through J3MD files. The J3MD file abstracts the shader and its configuration away from the user, allowing a simple interface where one can simply set a few parameters on the material to change its appearance and the way its handled.

Techniques

Techniques specify a specific way of rendering a material. Typically a technique is used to implement the same material for each configuration of the system. For GPUs that do not support shaders, a "fixed function pipeline" technique could exist to take care of rendering for that configuration

Render states

See RenderState.

Example Usage

Creating a textured material // Create a material instance Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); // Load the texture. Texture tex = assetManager.loadTexture("Textures/Test/Test.jpg"); // Set the parameters mat.setTexture("ColorMap", tex);

Skip navigation links