* Fix crashes due to introduction of MaterialKey
* Deleted unused textures git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7908 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
026a72d57e
commit
d8afde19cf
Binary file not shown.
Before Width: | Height: | Size: 69 KiB |
Binary file not shown.
Binary file not shown.
@ -2,6 +2,7 @@ Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
|
|||||||
MaterialParameters {
|
MaterialParameters {
|
||||||
Shininess: 8.0
|
Shininess: 8.0
|
||||||
NormalMap: Textures/BumpMapTest/Simple_normal.png
|
NormalMap: Textures/BumpMapTest/Simple_normal.png
|
||||||
|
ParallaxMap : Textures/BumpMapTest/Simple_height.png
|
||||||
UseMaterialColors : true
|
UseMaterialColors : true
|
||||||
Ambient : 0 0 0 1
|
Ambient : 0 0 0 1
|
||||||
Diffuse : 1 1 1 1
|
Diffuse : 1 1 1 1
|
||||||
|
@ -60,12 +60,12 @@ public class TestBumpModel extends SimpleApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml", null));
|
Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml", null));
|
||||||
signpost.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Models/Sign Post/Sign Post.j3m")));
|
signpost.setMaterial( (Material) assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"));
|
||||||
TangentBinormalGenerator.generate(signpost);
|
TangentBinormalGenerator.generate(signpost);
|
||||||
rootNode.attachChild(signpost);
|
rootNode.attachChild(signpost);
|
||||||
|
|
||||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||||
lightMdl.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Common/Materials/RedColor.j3m")));
|
lightMdl.setMaterial( (Material) assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||||
rootNode.attachChild(lightMdl);
|
rootNode.attachChild(lightMdl);
|
||||||
|
|
||||||
// flourescent main light
|
// flourescent main light
|
||||||
|
@ -63,7 +63,7 @@ public class TestMonkeyHead extends SimpleApplication {
|
|||||||
rootNode.attachChild(bumpy);
|
rootNode.attachChild(bumpy);
|
||||||
|
|
||||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||||
lightMdl.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Common/Materials/RedColor.j3m")));
|
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||||
rootNode.attachChild(lightMdl);
|
rootNode.attachChild(lightMdl);
|
||||||
|
|
||||||
// flourescent main light
|
// flourescent main light
|
||||||
|
@ -29,13 +29,11 @@
|
|||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package jme3test.model;
|
package jme3test.model;
|
||||||
|
|
||||||
import com.jme3.app.SimpleApplication;
|
import com.jme3.app.SimpleApplication;
|
||||||
import com.jme3.light.PointLight;
|
import com.jme3.light.PointLight;
|
||||||
import com.jme3.light.DirectionalLight;
|
import com.jme3.light.DirectionalLight;
|
||||||
import com.jme3.material.Material;
|
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.math.FastMath;
|
import com.jme3.math.FastMath;
|
||||||
@ -43,8 +41,7 @@ import com.jme3.scene.Spatial;
|
|||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.shape.Sphere;
|
import com.jme3.scene.shape.Sphere;
|
||||||
|
|
||||||
public class TestOgreLoading extends SimpleApplication
|
public class TestOgreLoading extends SimpleApplication {
|
||||||
{
|
|
||||||
|
|
||||||
float angle1;
|
float angle1;
|
||||||
float angle2;
|
float angle2;
|
||||||
@ -53,15 +50,12 @@ public class TestOgreLoading extends SimpleApplication
|
|||||||
Spatial lightMdl;
|
Spatial lightMdl;
|
||||||
Spatial lightMd2;
|
Spatial lightMd2;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
TestOgreLoading app = new TestOgreLoading();
|
TestOgreLoading app = new TestOgreLoading();
|
||||||
app.start();
|
app.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void simpleInitApp()
|
public void simpleInitApp() {
|
||||||
{
|
|
||||||
// PointLight pl = new PointLight();
|
// PointLight pl = new PointLight();
|
||||||
// pl.setPosition(new Vector3f(10, 10, -10));
|
// pl.setPosition(new Vector3f(10, 10, -10));
|
||||||
// rootNode.addLight(pl);
|
// rootNode.addLight(pl);
|
||||||
@ -75,11 +69,11 @@ public class TestOgreLoading extends SimpleApplication
|
|||||||
|
|
||||||
|
|
||||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||||
lightMdl.setMaterial( (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m"));
|
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||||
rootNode.attachChild(lightMdl);
|
rootNode.attachChild(lightMdl);
|
||||||
|
|
||||||
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||||
lightMd2.setMaterial( (Material) assetManager.loadAsset("Common/Materials/WhiteColor.j3m"));
|
lightMd2.setMaterial(assetManager.loadMaterial("Common/Materials/WhiteColor.j3m"));
|
||||||
rootNode.attachChild(lightMd2);
|
rootNode.attachChild(lightMd2);
|
||||||
|
|
||||||
|
|
||||||
@ -97,14 +91,12 @@ public class TestOgreLoading extends SimpleApplication
|
|||||||
// create the geometry and attach it
|
// create the geometry and attach it
|
||||||
Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
|
Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
|
||||||
float scale = 0.05f;
|
float scale = 0.05f;
|
||||||
elephant.scale(scale,scale,scale);
|
elephant.scale(scale, scale, scale);
|
||||||
rootNode.attachChild(elephant);
|
rootNode.attachChild(elephant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleUpdate(float tpf)
|
public void simpleUpdate(float tpf) {
|
||||||
{
|
|
||||||
angle1 += tpf * 0.25f;
|
angle1 += tpf * 0.25f;
|
||||||
angle1 %= FastMath.TWO_PI;
|
angle1 %= FastMath.TWO_PI;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class TestSphere extends SimpleApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
Sphere sphMesh = new Sphere(14, 14, 1);
|
Sphere sphMesh = new Sphere(14, 14, 1);
|
||||||
Material solidColor = (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m");
|
Material solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
||||||
|
|
||||||
for (int y = -5; y < 5; y++){
|
for (int y = -5; y < 5; y++){
|
||||||
for (int x = -5; x < 5; x++){
|
for (int x = -5; x < 5; x++){
|
||||||
|
@ -66,7 +66,7 @@ public class TestLeakingGL extends SimpleApplication {
|
|||||||
|
|
||||||
// this will make sure all spheres are rendered always
|
// this will make sure all spheres are rendered always
|
||||||
rootNode.setCullHint(CullHint.Never);
|
rootNode.setCullHint(CullHint.Never);
|
||||||
solidColor = (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m");
|
solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
||||||
cam.setLocation(new Vector3f(0, 5, 0));
|
cam.setLocation(new Vector3f(0, 5, 0));
|
||||||
cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
|
cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
|
||||||
|
|
||||||
|
@ -56,15 +56,15 @@ public class TestLodStress extends SimpleApplication {
|
|||||||
dl.setDirection(new Vector3f(-1,-1,-1).normalizeLocal());
|
dl.setDirection(new Vector3f(-1,-1,-1).normalizeLocal());
|
||||||
rootNode.addLight(dl);
|
rootNode.addLight(dl);
|
||||||
|
|
||||||
// Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
|
Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
|
||||||
// Geometry teapot = (Geometry) teapotNode.getChild(0);
|
Geometry teapot = (Geometry) teapotNode.getChild(0);
|
||||||
|
|
||||||
Sphere sph = new Sphere(16, 16, 4);
|
// Sphere sph = new Sphere(16, 16, 4);
|
||||||
Geometry teapot = new Geometry("teapot", sph);
|
// Geometry teapot = new Geometry("teapot", sph);
|
||||||
|
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
||||||
mat.setFloat("Shininess", 16f);
|
mat.setFloat("Shininess", 16f);
|
||||||
// mat.setBoolean("VertexLighting", true);
|
mat.setBoolean("VertexLighting", true);
|
||||||
teapot.setMaterial(mat);
|
teapot.setMaterial(mat);
|
||||||
|
|
||||||
// show normals as material
|
// show normals as material
|
||||||
@ -78,9 +78,9 @@ public class TestLodStress extends SimpleApplication {
|
|||||||
clonePot.setLocalTranslation(x * .5f, 0, y * .5f);
|
clonePot.setLocalTranslation(x * .5f, 0, y * .5f);
|
||||||
clonePot.setLocalScale(.15f);
|
clonePot.setLocalScale(.15f);
|
||||||
|
|
||||||
// LodControl control = new LodControl();
|
LodControl control = new LodControl();
|
||||||
// clonePot.addControl(control);
|
clonePot.addControl(control);
|
||||||
// rootNode.attachChild(clonePot);
|
rootNode.attachChild(clonePot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user