package.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. </head>
  7. <body>
  8. The <code>com.jme3.material</code> package contains classes for manipulating
  9. jMonkeyEngine materials.
  10. Materials are applied to {@link com.jme3.scene.Geometry geometries} in the
  11. scene.
  12. Each geometry has a single material which is used to render that
  13. geometry.
  14. <p>
  15. Materials (also known as material instances) are extended from
  16. material definitions.
  17. <h3>Material definitions</h3>
  18. <p>
  19. Material definitions provide the "logic" for the material. Usually a shader that
  20. will handle drawing the object, and corresponding parameters that allow
  21. configuration of the shader.
  22. Material definitions can be created through J3MD files.
  23. The J3MD file abstracts the shader and its configuration away from the user, allowing a
  24. simple interface where one can simply set a few parameters on the material to change its
  25. appearance and the way its handled.
  26. <h3>Techniques</h3>
  27. <p>
  28. Techniques specify a specific way of rendering a material. Typically
  29. a technique is used to implement the same material for each configuration
  30. of the system. For GPUs that do not support shaders, a "fixed function pipeline"
  31. technique could exist to take care of rendering for that configuration
  32. <h3>Render states</h3>
  33. <p>
  34. See {@link com.jme3.material.RenderState}.
  35. <h3>Example Usage</h3>
  36. <p>
  37. Creating a textured material
  38. <code>
  39. // Create a material instance
  40. Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  41. // Load the texture.
  42. Texture tex = assetManager.loadTexture("Textures/Test/Test.jpg");
  43. // Set the parameters
  44. mat.setTexture("ColorMap", tex);
  45. </code>
  46. </body>
  47. </html>