当前位置: 首页>>代码示例>>Java>>正文


Java FilterPostProcessor类代码示例

本文整理汇总了Java中com.jme3.post.FilterPostProcessor的典型用法代码示例。如果您正苦于以下问题:Java FilterPostProcessor类的具体用法?Java FilterPostProcessor怎么用?Java FilterPostProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FilterPostProcessor类属于com.jme3.post包,在下文中一共展示了FilterPostProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CombinedViewport

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
public CombinedViewport(String name,
        RenderManager renderManager,
        Camera mainCam,
        float fov,
        float near,
        float far,
        Node node,
        FilterPostProcessor fpp
) {
    this.name = name;
    this.cam = new Camera(mainCam.getWidth(),mainCam.getHeight());
    this.viewPort = renderManager.createMainView(name, cam);
    this.fov = fov;
    this.near = near;
    this.far = far;
    this.aspect = (float) mainCam.getWidth() / (float) mainCam.getHeight();
    this.node = node;
    this.fpp = fpp;
    setupView();
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:21,代码来源:CombinedViewport.java

示例2: 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);
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:22,代码来源:TerrainHeighmapCreator.java

示例3: 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();
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:19,代码来源:TestToneMapFilter.java

示例4: VisualEffectsManager

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
/**
 * Constructor, activates all the effects and then relies on the user to deactivate what they don't want
 *
 * @param am
 *  Asset manager required to load up the textures
 * @param node
 *  The node to attach the effects to
 * @param viewPort
 *  the view port to attach the effects to
 */
public VisualEffectsManager(AssetManager am, Node node, ViewPort viewPort){
    this.node = node;
    this.viewPort = viewPort;

    sun = new Sun(node, Vector3f.UNIT_Y.negate(), ColorRGBA.White.mult(2f));
    fpp = new FilterPostProcessor(am);

    loadSkyBoxes(am);

    initBasicEffects(); //just make sure to set the effects if you want something different

    setShadows(am, 1024, 3);
    addShadows();

    viewPort.addProcessor(fpp);
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:27,代码来源:VisualEffectsManager.java

示例5: install

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
/**
 * Install a scene loader to the asset manager.
 *
 * @param application the application.
 * @param processor   the processor.
 */
public static void install(@NotNull final Application application, @Nullable final FilterPostProcessor processor) {
    final AssetManager assetManager = application.getAssetManager();
    assetManager.registerLoader(SceneLoader.class, "j3o", "j3f", "j3s");
    SceneLoader.application = application;
    SceneLoader.processor = processor;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:13,代码来源:SceneLoader.java

示例6: afterPropertiesSet

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
    mainViewPort = renderManager.getMainViews().get(0);
    viewPorts.add(new CombinedViewport("farView", renderManager, mainCam, fov, 300f, 200000f, rootNode, new FilterPostProcessor(assetManager)));
    viewPorts.add(new CombinedViewport("nearView", renderManager, mainCam, fov, 0.5f, 310f, rootNode, new FilterPostProcessor(assetManager)));
    mainViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha);
    mainViewPort.setClearFlags(false, true, true);
    fov(45);
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:10,代码来源:ComplexCamera.java

示例7: 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();
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:35,代码来源:RealtimeMiniMapAppState.java

示例8: 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();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:39,代码来源:TestFog.java

示例9: 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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:TestCartoonEdge.java

示例10: 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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:38,代码来源:TestSSAO.java

示例11: 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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:TestPostFilters.java

示例12: 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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:35,代码来源:TestEnvironmentMapping.java

示例13: 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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:39,代码来源:TestHoverTank.java

示例14: updateFilterState

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
private synchronized void updateFilterState() {
    final FilterPostProcessor fpp = this.node != null ? this.node.getFilterPostProcessor() : null;
    clearFilters();
    if (filterEnabled && fpp != null) {
        SceneApplication.getApplication().enqueue(new Callable() {
            public Object call() throws Exception {
                SceneApplication.getApplication().getViewPort().addProcessor(fpp);
                logger.log(Level.FINE, "Enabled post filters");
                return null;
            }
        });
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:14,代码来源:FilterExplorerTopComponent.java

示例15: clearFilters

import com.jme3.post.FilterPostProcessor; //导入依赖的package包/类
private synchronized void clearFilters() {
    SceneApplication.getApplication().enqueue(new Callable() {
        public Object call() throws Exception {
            for (Iterator<SceneProcessor> it = SceneApplication.getApplication().getViewPort().getProcessors().iterator(); it.hasNext();) {
                SceneProcessor proc = it.next();
                if (proc instanceof FilterPostProcessor) {
                    it.remove();
                    proc.cleanup();
                }
                logger.log(Level.FINE, "Disabled post filters");
            }
            return null;
        }
    });
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:16,代码来源:FilterExplorerTopComponent.java


注:本文中的com.jme3.post.FilterPostProcessor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。