本文整理汇总了Java中com.jme3.post.FilterPostProcessor.addFilter方法的典型用法代码示例。如果您正苦于以下问题:Java FilterPostProcessor.addFilter方法的具体用法?Java FilterPostProcessor.addFilter怎么用?Java FilterPostProcessor.addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.post.FilterPostProcessor
的用法示例。
在下文中一共展示了FilterPostProcessor.addFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWater
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
private void createWater() {
water = new WaterFilter(rootNode, new Vector3f(-0.1f, -0.1f, -0.1f));
water.setWaterColor(new ColorRGBA().setAsSrgb(0.0078f, 0.3176f, 0.5f, 1.0f));
water.setDeepWaterColor(new ColorRGBA().setAsSrgb(0.0039f, 0.00196f, 0.145f, 1.0f));
water.setUnderWaterFogDistance(80);
water.setWaterTransparency(0.12f);
water.setFoamIntensity(0.4f);
water.setFoamHardness(0.3f);
water.setFoamExistence(new Vector3f(0.8f, 8f, 1f));
water.setReflectionDisplace(50);
water.setRefractionConstant(0.25f);
water.setColorExtinction(new Vector3f(30, 50, 70));
water.setCausticsIntensity(0.4f);
water.setWaveScale(0.003f);
water.setMaxAmplitude(2f);
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
water.setRefractionStrength(0.2f);
water.setWaterHeight(0);
waterFilter = new FilterPostProcessor(assetManager);
waterFilter.addFilter(water);
}
示例2: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
System.out.println("== Tone Mapping Sample ==");
System.out.println(" SPACE:\tToggle tone-mapping OFF or ON");
System.out.println(" Y:\tIncrease white-point");
System.out.println(" H:\tDecrease white-point");
fpp = new FilterPostProcessor(assetManager);
toneMapFilter = new ToneMapFilter();
fpp.addFilter(toneMapFilter);
viewPort.addProcessor(fpp);
rootNode.attachChild(createHDRBox());
cam.setLocation(new Vector3f(0f,0f,3f));
initInputs();
}
示例3: createMiniMapViewport
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
private void createMiniMapViewport() {
// Create a new camera (cloned from current)
Camera cam = app.getCamera();
mapCamera = cam.clone();
repositionCameraViewport();
// Position camera at player position and rotate it so it points
// downwards
camLoc = parent.getParent().getPlayerEntity().getSpatial().getLocalTranslation().clone();
mapCamera.setLocation(camLoc);
Quaternion q = new Quaternion();
q.fromAngles(FastMath.DEG_TO_RAD * 90f, FastMath.DEG_TO_RAD * 180f, 0);
mapCamera.setRotation(q);
// Create the viewport
mapViewport = app.getRenderManager().createMainView("View of camera #n", mapCamera);
mapViewport.setClearFlags(true, true, true);
// Filter prost processor for masking out the circular map
fpp = new FilterPostProcessor(assetManager);
maskFilter = new MaskFilter();
maskFilter.setMaskTexture(assetManager.loadTexture("Textures/NV/BinocularsMask.png"));
fpp.addFilter(maskFilter);
mapViewport.addProcessor(fpp);
// newGuiNode = new Node();
// newGuiNode.setQueueBucket(RenderQueue.Bucket.Gui);
// newGuiNode.setCullHint(Spatial.CullHint.Never);
// mapViewport.attachScene(newGuiNode);
mapViewport.attachScene(parent.getParent().getMappableNode());
// newGuiNode.updateGeometricState();
}
示例4: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void simpleInitApp() {
this.flyCam.setMoveSpeed(10);
Node mainScene=new Node();
cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f));
cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f));
// load sky
mainScene.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false));
// create the geometry and attach it
// load the level from zip or http zip
if (useHttp) {
assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", HttpZipLocator.class.getName());
} else {
assetManager.registerLocator("wildhouse.zip", ZipLocator.class.getName());
}
Spatial scene = assetManager.loadModel("main.scene");
DirectionalLight sun = new DirectionalLight();
Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
sun.setDirection(lightDir);
sun.setColor(ColorRGBA.White.clone().multLocal(2));
scene.addLight(sun);
mainScene.attachChild(scene);
rootNode.attachChild(mainScene);
fpp=new FilterPostProcessor(assetManager);
//fpp.setNumSamples(4);
fog=new FogFilter();
fog.setFogColor(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f));
fog.setFogDistance(155);
fog.setFogDensity(2.0f);
fpp.addFilter(fog);
viewPort.addProcessor(fpp);
initInputs();
}
示例5: setupFilters
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void setupFilters(){
if (renderer.getCaps().contains(Caps.GLSL100)){
fpp=new FilterPostProcessor(assetManager);
//fpp.setNumSamples(4);
CartoonEdgeFilter toon=new CartoonEdgeFilter();
toon.setEdgeColor(ColorRGBA.Yellow);
fpp.addFilter(toon);
viewPort.addProcessor(fpp);
}
}
示例6: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
cam.setLocation(new Vector3f(68.45442f, 8.235511f, 7.9676695f));
cam.setRotation(new Quaternion(0.046916496f, -0.69500375f, 0.045538206f, 0.7160271f));
flyCam.setMoveSpeed(50);
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
Texture diff = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg");
diff.setWrap(Texture.WrapMode.Repeat);
Texture norm = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall_normal.jpg");
norm.setWrap(Texture.WrapMode.Repeat);
mat.setTexture("DiffuseMap", diff);
mat.setTexture("NormalMap", norm);
mat.setFloat("Shininess", 2.0f);
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(1.8f, 1.8f, 1.8f, 1.0f));
rootNode.addLight(al);
model = (Geometry) assetManager.loadModel("Models/Sponza/Sponza.j3o");
model.getMesh().scaleTextureCoordinates(new Vector2f(2, 2));
model.setMaterial(mat);
rootNode.attachChild(model);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter ssaoFilter = new SSAOFilter(12.940201f, 43.928635f, 0.32999992f, 0.6059958f);
fpp.addFilter(ssaoFilter);
SSAOUI ui = new SSAOUI(inputManager, ssaoFilter);
viewPort.addProcessor(fpp);
}
示例7: setupFilters
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void setupFilters() {
if (renderer.getCaps().contains(Caps.GLSL100)) {
fpp = new FilterPostProcessor(assetManager);
// fpp.setNumSamples(4);
fpp.addFilter(new ColorOverlayFilter(ColorRGBA.LightGray));
fpp.addFilter(new RadialBlurFilter());
//fade=new FadeFilter(1.0f);
//fpp.addFilter(fade);
viewPort.addProcessor(fpp);
}
}
示例8: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
final Node buggy = (Node) assetManager.loadModel("Models/Buggy/Buggy.j3o");
TextureKey key = new TextureKey("Textures/Sky/Bright/BrightSky.dds", true);
key.setGenerateMips(true);
key.setAsCube(true);
final Texture tex = assetManager.loadTexture(key);
for (Spatial geom : buggy.getChildren()) {
if (geom instanceof Geometry) {
Material m = ((Geometry) geom).getMaterial();
m.setTexture("EnvMap", tex);
m.setVector3("FresnelParams", new Vector3f(0.05f, 0.18f, 0.11f));
}
}
flyCam.setEnabled(false);
ChaseCamera chaseCam = new ChaseCamera(cam, inputManager);
chaseCam.setLookAtOffset(new Vector3f(0,0.5f,-1.0f));
buggy.addControl(chaseCam);
rootNode.attachChild(buggy);
rootNode.attachChild(SkyFactory.createSky(assetManager, tex, false));
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
bf.setBloomIntensity(2.3f);
bf.setExposurePower(0.6f);
fpp.addFilter(bf);
viewPort.addProcessor(fpp);
}
示例9: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
flyCam.setEnabled(false);
ChaseCamera chaseCam = new ChaseCamera(cam, tank, inputManager);
chaseCam.setSmoothMotion(true);
chaseCam.setMaxDistance(100000);
chaseCam.setMinVerticalRotation(-FastMath.PI / 2);
viewPort.setBackgroundColor(ColorRGBA.DarkGray);
Geometry tankGeom = (Geometry) tank.getChild(0);
LodControl control = new LodControl();
tankGeom.addControl(control);
rootNode.attachChild(tank);
Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
DirectionalLight dl = new DirectionalLight();
dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
dl.setDirection(lightDir);
Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
DirectionalLight dl2 = new DirectionalLight();
dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
dl2.setDirection(lightDir2);
rootNode.addLight(dl);
rootNode.addLight(dl2);
rootNode.attachChild(tank);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
bf.setBloomIntensity(2.0f);
bf.setExposurePower(1.3f);
fpp.addFilter(bf);
BloomUI bui = new BloomUI(inputManager, bf);
viewPort.addProcessor(fpp);
}
示例10: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Init.initialize(this);
this.flyCam.setMoveSpeed(20);
inputManager.addMapping("do", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "do");
Entity sky = Loader.load("envSky");
rootNode.attachChild(sky.getSpatial());
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-1, -1, -1));
this.rootNode.addLight(dl);
FilterPostProcessor processor = new FilterPostProcessor(this.assetManager);
this.viewPort.addProcessor(processor);
DirectionalLightShadowFilter filter = new DirectionalLightShadowFilter(assetManager, 1024, 1);
filter.setLambda(0.55f);
filter.setShadowIntensity(0.75f);
filter.setShadowCompareMode(CompareMode.Hardware);
filter.setEdgeFilteringMode(EdgeFilteringMode.PCF4);
filter.setLight(dl);
processor.addFilter(filter);
Spatial terrain = this.assetManager.loadModel("Models/env/terrain/scene.j3o");
terrain.setShadowMode(RenderQueue.ShadowMode.Receive);
this.rootNode.attachChild(terrain);
Spatial tree = this.assetManager.loadModel("Models/trees/tree/tree978.j3o");
tree.setShadowMode(RenderQueue.ShadowMode.Cast);
this.rootNode.attachChild(tree);
}
示例11: setupFilters
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void setupFilters(){
if (renderer.getCaps().contains(Caps.GLSL100)){
fpp=new FilterPostProcessor(assetManager);
//fpp.setNumSamples(4);
int numSamples = getContext().getSettings().getSamples();
if( numSamples > 0 ) {
fpp.setNumSamples(numSamples);
}
CartoonEdgeFilter toon=new CartoonEdgeFilter();
toon.setEdgeColor(ColorRGBA.Yellow);
fpp.addFilter(toon);
viewPort.addProcessor(fpp);
}
}
示例12: simpleInitApp
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void simpleInitApp() {
this.flyCam.setMoveSpeed(10);
cam.setLocation(new Vector3f(6.0344796f, 1.5054002f, 55.572033f));
cam.setRotation(new Quaternion(0.0016069f, 0.9810479f, -0.008143323f, 0.19358753f));
makeScene();
//Creating the main view port post processor
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(new ColorOverlayFilter(ColorRGBA.Blue));
viewPort.addProcessor(fpp);
//creating a frame buffer for the mainviewport
FrameBuffer mainVPFrameBuffer = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
Texture2D mainVPTexture = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
mainVPFrameBuffer.addColorTexture(mainVPTexture);
mainVPFrameBuffer.setDepthBuffer(Image.Format.Depth);
viewPort.setOutputFrameBuffer(mainVPFrameBuffer);
//creating the post processor for the gui viewport
final FilterPostProcessor guifpp = new FilterPostProcessor(assetManager);
guifpp.addFilter(new ColorOverlayFilter(ColorRGBA.Red));
//this will compose the main viewport texture with the guiviewport back buffer.
//Note that you can swich the order of the filters so that guiviewport filters are applied or not to the main viewport texture
guifpp.addFilter(new ComposeFilter(mainVPTexture));
guiViewPort.addProcessor(guifpp);
//compositing is done by mixing texture depending on the alpha channel,
//it's important that the guiviewport clear color alpha value is set to 0
guiViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha);
guiViewPort.setClearColor(true);
}
示例13: initializeBloom
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
private void initializeBloom() {
// add a glow effect
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
bf = new BloomFilter(BloomFilter.GlowMode.Objects);
bf.setExposurePower(18f);
bf.setBloomIntensity(1.0f);
bf.setBlurScale(maxBlur);
//bf.setExposureCutOff(1f);
bf.setDownSamplingFactor(2.2f);
fpp.addFilter(bf);
viewPort.addProcessor(fpp);
}
示例14: setupLights
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void setupLights() {
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
rootNode.addLight(al);
SpotLight sl = new SpotLight();
sl.setColor(ColorRGBA.White.mult(1.0f));
sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
sl.setDirection(sl.getPosition().mult(-1));
sl.setSpotOuterAngle(0.1f);
sl.setSpotInnerAngle(0.004f);
rootNode.addLight(sl);
//pointlight to fake indirect light coming from the ground
PointLight pl = new PointLight();
pl.setColor(ColorRGBA.White.mult(1.5f));
pl.setPosition(new Vector3f(0, 0, 1));
pl.setRadius(2);
rootNode.addLight(pl);
SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
shadows.setLight(sl);
shadows.setShadowIntensity(0.3f);
shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
viewPort.addProcessor(shadows);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
fpp.addFilter(filter);
fpp.addFilter(new FXAAFilter());
fpp.addFilter(new FXAAFilter());
viewPort.addProcessor(fpp);
}
示例15: setupLights
import com.jme3.post.FilterPostProcessor; //导入方法依赖的package包/类
public void setupLights() {
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
rootNode.addLight(al);
SpotLight sl = new SpotLight();
sl.setColor(ColorRGBA.White.mult(1.0f));
sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
sl.setDirection(sl.getPosition().mult(-1));
sl.setSpotOuterAngle(0.1f);
sl.setSpotInnerAngle(0.004f);
rootNode.addLight(sl);
//pointlight to fake indirect light coming from the ground
PointLight pl = new PointLight();
pl.setColor(ColorRGBA.White.mult(1.5f));
pl.setPosition(new Vector3f(0, 0, 1));
pl.setRadius(2);
rootNode.addLight(pl);
SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
shadows.setLight(sl);
shadows.setShadowIntensity(0.3f);
shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
viewPort.addProcessor(shadows);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
fpp.addFilter(filter);
fpp.addFilter(new FXAAFilter());
fpp.addFilter(new FXAAFilter());
viewPort.addProcessor(fpp);
}