aboutsummaryrefslogtreecommitdiff
path: root/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/package.html
blob: 0b2725cc0400a6ebfaaf6942f87d2541aa304f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>

<code>com.jme3.scene.plugins.ogre.matext</code> allows loading of more advanced
Ogre3D materials that use "base" materials to abstract functionality.
<br/><br/>
E.g. example of an Ogre3D material instance:<br/>
<code>
import * from "materials/baselighting.material"

material MyMaterial : BaseLightingMaterial
{
    set_texture_alias MyTexture textures/mytex.png
}
</code>

<h3>Usage</h3>

<p>
Example code of loading the above material:<br/>
<code>
MaterialExtensionSet matExts = new MaterialExtensionSet();<br/>
MaterialExtension baseLightExt = new MaterialExtension("BaseLightingMaterial", <br/>
                                                       "Common/MatDefs/Light/Lighting.j3md");<br/>
baseLightExt.setTextureMapping("MyTexture", "m_DiffuseMap");<br/>
matExts.addMaterialExtension(baseLightExt);<br/>
<br/>
OgreMaterialKey matKey = new OgreMaterialKey("materials/mymaterial.material");<br/>
matKey.setMaterialExtensionSet(matExts);<br/>
MaterialList ogreMats = assetManager.loadAsset(matKey);<br/>
</code>

</body>
</html>