• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3
4<head>
5<title></title>
6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7</head>
8<body>
9
10<code>com.jme3.scene.plugins.ogre.matext</code> allows loading of more advanced
11Ogre3D materials that use "base" materials to abstract functionality.
12<br/><br/>
13E.g. example of an Ogre3D material instance:<br/>
14<code>
15import * from "materials/baselighting.material"
16
17material MyMaterial : BaseLightingMaterial
18{
19    set_texture_alias MyTexture textures/mytex.png
20}
21</code>
22
23<h3>Usage</h3>
24
25<p>
26Example code of loading the above material:<br/>
27<code>
28MaterialExtensionSet matExts = new MaterialExtensionSet();<br/>
29MaterialExtension baseLightExt = new MaterialExtension("BaseLightingMaterial", <br/>
30                                                       "Common/MatDefs/Light/Lighting.j3md");<br/>
31baseLightExt.setTextureMapping("MyTexture", "m_DiffuseMap");<br/>
32matExts.addMaterialExtension(baseLightExt);<br/>
33<br/>
34OgreMaterialKey matKey = new OgreMaterialKey("materials/mymaterial.material");<br/>
35matKey.setMaterialExtensionSet(matExts);<br/>
36MaterialList ogreMats = assetManager.loadAsset(matKey);<br/>
37</code>
38
39</body>
40</html>
41