• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

修訂471515481a205abdd42c86a9442c8e44bcd59d76 (tree)
時間2013-03-03 19:31:10
作者remy.bouquet@gmail.com <remy.bouquet@gmai...>
Commiterremy.bouquet@gmail.com

Log Message

Better TestMultiPostWater

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10457 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

Change Summary

差異

--- a/engine/src/test/jme3test/water/TestMultiPostWater.java
+++ b/engine/src/test/jme3test/water/TestMultiPostWater.java
@@ -1,30 +1,17 @@
11 package jme3test.water;
22
33 import com.jme3.app.SimpleApplication;
4-import com.jme3.audio.AudioNode;
5-import com.jme3.audio.LowPassFilter;
6-import com.jme3.effect.ParticleEmitter;
7-import com.jme3.effect.ParticleMesh;
8-import com.jme3.input.controls.ActionListener;
9-import com.jme3.input.controls.KeyTrigger;
104 import com.jme3.light.DirectionalLight;
115 import com.jme3.material.Material;
12-import com.jme3.material.RenderState.BlendMode;
136 import com.jme3.math.ColorRGBA;
147 import com.jme3.math.FastMath;
158 import com.jme3.math.Quaternion;
169 import com.jme3.math.Vector3f;
1710 import com.jme3.post.FilterPostProcessor;
18-import com.jme3.post.filters.BloomFilter;
19-import com.jme3.post.filters.DepthOfFieldFilter;
20-import com.jme3.post.filters.LightScatteringFilter;
2111 import com.jme3.renderer.Camera;
22-import com.jme3.renderer.queue.RenderQueue.Bucket;
2312 import com.jme3.renderer.queue.RenderQueue.ShadowMode;
24-import com.jme3.scene.Geometry;
2513 import com.jme3.scene.Node;
2614 import com.jme3.scene.Spatial;
27-import com.jme3.scene.shape.Box;
2815 import com.jme3.system.AppSettings;
2916 import com.jme3.terrain.geomipmap.TerrainQuad;
3017 import com.jme3.terrain.heightmap.AbstractHeightMap;
@@ -39,22 +26,27 @@ import java.util.List;
3926
4027 /**
4128 * test
29+ *
4230 * @author normenhansen
4331 */
4432 public class TestMultiPostWater extends SimpleApplication {
4533
4634 private Vector3f lightDir = new Vector3f(-4.9236743f, -1.27054665f, 5.896916f);
4735 private WaterFilter water;
48- TerrainQuad terrain;
49- Material matRock;
50- AudioNode waves;
51- LowPassFilter underWaterAudioFilter = new LowPassFilter(0.5f, 0.1f);
52- LowPassFilter underWaterReverbFilter = new LowPassFilter(0.5f, 0.1f);
53- LowPassFilter aboveWaterAudioFilter = new LowPassFilter(1, 1);
36+ private TerrainQuad terrain;
37+ private Material matRock;
38+ private static float WATER_HEIGHT = 90;
5439
5540 public static void main(String[] args) {
5641 TestMultiPostWater app = new TestMultiPostWater();
57- app.setSettings(new AppSettings(true));
42+ AppSettings s = new AppSettings(true);
43+ s.setRenderer(AppSettings.LWJGL_OPENGL2);
44+ s.setAudioRenderer(AppSettings.LWJGL_OPENAL);
45+//
46+// s.setRenderer("JOGL");
47+// s.setAudioRenderer("JOAL");
48+ app.setSettings(s);
49+
5850 app.start();
5951 }
6052
@@ -76,36 +68,36 @@ public class TestMultiPostWater extends SimpleApplication {
7668 flyCam.setMoveSpeed(100);
7769
7870 //cam.setLocation(new Vector3f(-700, 100, 300));
79- //cam.setRotation(new Quaternion().fromAngleAxis(0.5f, Vector3f.UNIT_Z));
80- cam.setLocation(new Vector3f(-327.21957f, 61.6459f, 126.884346f));
71+ //cam.setRotation(new Quaternion().fromAngleAxis(0.5f, Vector3f.UNIT_Z));
72+ cam.setLocation(new Vector3f(-327.21957f, 251.6459f, 126.884346f));
8173 cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0}));
8274
8375
8476 Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
8577 sky.setLocalScale(350);
86-
78+
8779 mainScene.attachChild(sky);
8880 cam.setFrustumFar(4000);
89-
9081
91-
92- FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
93-
82+
83+
84+ FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
85+
9486 water = new WaterFilter(rootNode, lightDir);
9587 water.setCenter(new Vector3f(9.628218f, -15.830074f, 199.23595f));
9688 water.setRadius(260);
9789 water.setWaveScale(0.003f);
9890 water.setMaxAmplitude(2f);
9991 water.setFoamExistence(new Vector3f(1f, 4, 0.5f));
100- water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
92+ water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
10193 water.setRefractionStrength(0.2f);
102- water.setWaterHeight(0.8f);
94+ water.setWaterHeight(WATER_HEIGHT);
10395 fpp.addFilter(water);
104-
96+
10597 WaterFilter water2 = new WaterFilter(rootNode, lightDir);
10698 water2.setCenter(new Vector3f(-280.46027f, -24.971727f, -271.71976f));
10799 water2.setRadius(260);
108- water2.setWaterHeight(0.8f);
100+ water2.setWaterHeight(WATER_HEIGHT);
109101 water2.setUseFoam(false);
110102 water2.setUseRipples(false);
111103 water2.setDeepWaterColor(ColorRGBA.Brown);
@@ -120,28 +112,27 @@ public class TestMultiPostWater extends SimpleApplication {
120112 water2.setSunScale(1.0f);
121113 water2.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
122114 fpp.addFilter(water2);
123-
124-
115+
116+
125117 WaterFilter water3 = new WaterFilter(rootNode, lightDir);
126118 water3.setCenter(new Vector3f(319.6663f, -18.367947f, -236.67674f));
127119 water3.setRadius(260);
128- water3.setWaterHeight(0.8f);
120+ water3.setWaterHeight(WATER_HEIGHT);
129121 water3.setWaveScale(0.003f);
130122 water3.setMaxAmplitude(2f);
131123 water3.setFoamExistence(new Vector3f(1f, 4, 0.5f));
132- water3.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
124+ water3.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
133125 water3.setRefractionStrength(0.2f);
134- water3.setWaterHeight(0.8f);
135126 water3.setDeepWaterColor(ColorRGBA.Red);
136127 water3.setWaterColor(ColorRGBA.Red.mult(2.0f));
137128 water3.setLightColor(ColorRGBA.Red);
138129 fpp.addFilter(water3);
139-
130+
140131 viewPort.addProcessor(fpp);
141132
142-
133+ //fpp.setNumSamples(4);
143134 }
144-
135+
145136 private void createTerrain(Node rootNode) {
146137 matRock = new Material(assetManager, "Common/MatDefs/Terrain/TerrainLighting.j3md");
147138 matRock.setBoolean("useTriPlanarMapping", false);
@@ -192,6 +183,5 @@ public class TestMultiPostWater extends SimpleApplication {
192183
193184 @Override
194185 public void simpleUpdate(float tpf) {
195-
196186 }
197187 }