本文整理汇总了Java中com.jme3.shadow.DirectionalLightShadowFilter类的典型用法代码示例。如果您正苦于以下问题:Java DirectionalLightShadowFilter类的具体用法?Java DirectionalLightShadowFilter怎么用?Java DirectionalLightShadowFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectionalLightShadowFilter类属于com.jme3.shadow包,在下文中一共展示了DirectionalLightShadowFilter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doCreateFilter
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
@Override
protected Filter doCreateFilter(FilterPostProcessor parent, Object configuration) {
if (configuration != null) {
WizardDescriptor wiz = (WizardDescriptor) configuration;
return new DirectionalLightShadowFilter(SceneApplication.getApplication().getAssetManager(), (Integer)wiz.getProperty("shadowMapSize"), (Integer)wiz.getProperty("nbSplits"));
}
return null;
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:9,代码来源:NewDirectionalLightShadowFilterAction.java
示例2: simpleInitApp
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的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);
}
开发者ID:huliqing,项目名称:LuoYing,代码行数:34,代码来源:EmitterAndFilter.java
示例3: initEntity
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
@Override
public void initEntity() {
filter = new DirectionalLightShadowFilter(LuoYing.getApp().getAssetManager(), shadowMapSize, shadowMaps);
filter.setEdgeFilteringMode(edgeFilteringMode);
filter.setEdgesThickness(edgesThickness);
filter.setEnabledStabilization(enabledStabilization);
filter.setLambda(lambda);
filter.setRenderBackFacesShadows(renderBackFacesShadows);
filter.setShadowCompareMode(shadowCompareMode);
filter.setShadowIntensity(shadowIntensity);
filter.setShadowZExtend(shadowZExtend);
filter.setShadowZFadeLength(shadowZFadeLength);
filter.setEnabled(isEnabled());
}
开发者ID:huliqing,项目名称:LuoYing,代码行数:15,代码来源:DirectionalLightShadowFilterEntity.java
示例4: getShadowFilter
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
private DirectionalLightShadowFilter getShadowFilter(){
for(Filter f : RendererPlatform.getFilterPostProcessor().getFilterList()) {
if(f instanceof DirectionalLightShadowFilter) {
return (DirectionalLightShadowFilter)f;
}
}
return null;
}
开发者ID:meltzow,项目名称:supernovae,代码行数:9,代码来源:LightProc.java
示例5: LightDrawer
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
public LightDrawer(MapView view, AssetManager am, Node rootNode, ViewPort vp) {
this.view = view;
this.rootNode = rootNode;
FilterPostProcessor fpp = new FilterPostProcessor(am);
int SHADOWMAP_SIZE = 4096;
// sr = new DirectionalLightShadowRenderer(am, SHADOWMAP_SIZE, 1);
// sr.setEdgeFilteringMode(EdgeFilteringMode.PCF4);
// sr.setShadowIntensity((float) ModelManager.getBattlefield().getSunLight().shadowCaster.intensity);
// vp.addProcessor(sr);
sf = new DirectionalLightShadowFilter(am, SHADOWMAP_SIZE, 1);
sf.setEnabled(true);
sf.setEdgeFilteringMode(EdgeFilteringMode.PCF4);
sf.setShadowZExtend(SHADOWMAP_SIZE);
fpp.addFilter(sf);
// Ambiant occlusion filter
SSAOFilter ssaoFilter = new SSAOFilter(0.5f, 4f, 0.2f, 0.3f);
// fpp.addFilter(ssaoFilter);
// Glow filter
BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.Objects);
fpp.addFilter(bloom);
vp.addProcessor(fpp);
}
开发者ID:methusalah,项目名称:OpenRTS,代码行数:28,代码来源:LightDrawer.java
示例6: lightSettup
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
private void lightSettup() {
/**
* A white, directional light source.
*/
DirectionalLight sun = new DirectionalLight();
sun.setDirection((new Vector3f(-0.5f, -0.5f, -0.5f)).normalizeLocal());
// sun.setColor(new ColorRGBA(250, 250, 215, 1));
sun.setColor(ColorRGBA.White);
getRootNode().addLight(sun);
/* this shadow needs a directional light */
FilterPostProcessor fpp = new FilterPostProcessor(getAssetManager());
// DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), 1024, 1);
// dlsf.setLight(sun);
// fpp.addFilter(dlsf);
/* AO */
// FilterPostProcessor fpp = new FilterPostProcessor(app.getAssetManager());
// SSAOFilter ssaoFilter = new SSAOFilter();//1f, 3.2f, 0.2f, 0.1f);
// fpp.addFilter(ssaoFilter);
// app.getViewPort().addProcessor(fpp);
// /* DropShadow */
final int SHADOWMAP_SIZE = 1024;
// DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(app.getAssetManager(), SHADOWMAP_SIZE, 1);
// dlsr.setLight(sun);
// app.getViewPort().addProcessor(dlsr);
//
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(getAssetManager(), SHADOWMAP_SIZE, 1);
dlsf.setLight(sun);
dlsf.setEnabled(true);
// fpp = new FilterPostProcessor(app.getAssetManager());
fpp.addFilter(dlsf);
getViewPort().addProcessor(fpp);
/**
* A white ambient light source.
*/
AmbientLight ambient = new AmbientLight();
ambient.setColor(ColorRGBA.White);
// ambient.setColor(new ColorRGBA(255, 255, 255, .5f));
getRootNode().addLight(ambient);
}
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:44,代码来源:AbstractHexGridApplication.java
示例7: initializeLight
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
private void initializeLight() {
/**
* A white, directional light source.
*/
sun = new DirectionalLight();
sun.setDirection((new Vector3f(-0.5f, -0.5f, -0.5f)).normalizeLocal());
// sun.setColor(new ColorRGBA(250, 250, 215, 1));
sun.setColor(ColorRGBA.White);
/* this shadow needs a directional light */
fpp = new FilterPostProcessor(app.getAssetManager());
// DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), 1024, 1);
// dlsf.setLight(sun);
// fpp.addFilter(dlsf);
/* AO */
// FilterPostProcessor fpp = new FilterPostProcessor(app.getAssetManager());
// SSAOFilter ssaoFilter = new SSAOFilter();//1f, 3.2f, 0.2f, 0.1f);
// fpp.addFilter(ssaoFilter);
// app.getViewPort().addProcessor(fpp);
// /* DropShadow */
final int SHADOWMAP_SIZE = 1024;
// DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(app.getAssetManager(), SHADOWMAP_SIZE, 1);
// dlsr.setLight(sun);
// app.getViewPort().addProcessor(dlsr);
//
dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 1);
dlsf.setLight(sun);
// dlsf.setEnabled(true);
// fpp = new FilterPostProcessor(app.getAssetManager());
fpp.addFilter(dlsf);
/**
* A white ambient light source.
*/
ambient = new AmbientLight();
ambient.setColor(ColorRGBA.White);
// ambient.setColor(new ColorRGBA(255, 255, 255, .5f));
lightInit = true;
}
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:43,代码来源:DefaultSetting.java
示例8: setShadows
import com.jme3.shadow.DirectionalLightShadowFilter; //导入依赖的package包/类
/**
* Creates new shadows off a given shadowmap size and the number of splits to calculate
* @param am
* the assetmanager to needed to load something
* @param shadowMapSize
* @require is a power of 2
* The size of the shadow map
* @param nbSplits
* The number of splits to take of the shadow map
*/
public void setShadows(AssetManager am, int shadowMapSize, int nbSplits){
shadow = new DirectionalLightShadowFilter(am, shadowMapSize, nbSplits);
shadow.setLight(sun.getLight());
}
开发者ID:GSam,项目名称:Game-Project,代码行数:15,代码来源:VisualEffectsManager.java
注:本文中的com.jme3.shadow.DirectionalLightShadowFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论