Browse Source

added material colors/specular/diffuse to shiny sphere snippet in Palette

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9177 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
roo..li 13 years ago
parent
commit
06e88afcf7

+ 1 - 1
jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteShinySphere.java

@@ -47,7 +47,7 @@ public class JmePaletteShinySphere implements ActiveEditorDrop {
 
     private String createBody() {
 
-        String body = "    /** Bumpy rock with shiny light effect. Uses Texture from jme3-test-data library! Needs light source! */\n    Sphere rock = new Sphere(32,32, 2f);\n    Geometry shiny_rock = new Geometry(\"Shiny rock\", rock);\n    rock.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres\n    TangentBinormalGenerator.generate(rock);           // for lighting effect\n    Material mat_lit = new Material(assetManager, \"Common/MatDefs/Light/Lighting.j3md\");\n    mat_lit.setTexture(\"DiffuseMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond.png\"));\n    mat_lit.setTexture(\"NormalMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond_normal.png\"));\n    mat_lit.setFloat(\"Shininess\", 5f); // [0,128]\n    shiny_rock.setMaterial(mat_lit);\n    rootNode.attachChild(shiny_rock);\n ";
+        String body = "    /** Bumpy rock with shiny light effect. Uses Texture from jme3-test-data library! Needs light source! */\n    Sphere rock = new Sphere(32,32, 2f);\n    Geometry shiny_rock = new Geometry(\"Shiny rock\", rock);\n    rock.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres\n    TangentBinormalGenerator.generate(rock);           // for lighting effect\n    Material mat_lit = new Material(assetManager, \"Common/MatDefs/Light/Lighting.j3md\");\n    mat_lit.setTexture(\"DiffuseMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond.png\"));\n    mat_lit.setTexture(\"NormalMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond_normal.png\"));mat.setBoolean(\"UseMaterialColors\",true);\n    mat.setColor(\"Specular\",ColorRGBA.White);\n    mat.setColor(\"Diffuse\",ColorRGBA.White);\n    mat_lit.setFloat(\"Shininess\", 5f); // 1-128\n    shiny_rock.setMaterial(mat_lit);\n    rootNode.attachChild(shiny_rock);\n ";
         return body;
     }