• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RenderState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createCollisionPlane

import com.jme3.material.RenderState; //导入依赖的package包/类
/**
 * Create collision plane.
 */
@FromAnyThread
private void createCollisionPlane() {

    final AssetManager assetManager = EDITOR.getAssetManager();

    final Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    final RenderState renderState = material.getAdditionalRenderState();
    renderState.setFaceCullMode(RenderState.FaceCullMode.Off);
    renderState.setWireframe(true);

    final float size = 20000;

    final Geometry geometry = new Geometry("plane", new Quad(size, size));
    geometry.setMaterial(material);
    geometry.setLocalTranslation(-size / 2, -size / 2, 0);

    collisionPlane = new Node();
    collisionPlane.attachChild(geometry);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:23,代码来源:AbstractSceneEditor3DState.java


示例2: getDebugMaterial

import com.jme3.material.RenderState; //导入依赖的package包/类
protected static Material getDebugMaterial(Geometry geometry, boolean colors, boolean wire, boolean normals, boolean faceCullOff) {
//        RenderState renderState = geometry.getMaterial().getAdditionalRenderState();

        Material debugMaterial;
        Material originalMaterial = geometry.getMaterial();
        if(normals) {
            debugMaterial = DebugUtil.createNormalMaterial(geometry);
        }  else if(colors || !wire || originalMaterial == null) {
            debugMaterial = DebugUtil.createDebugMaterial(geometry, colors);
        } else {
            debugMaterial = geometry.getMaterial().clone();
            wire = true;
        }

        RenderState debugRenderState = debugMaterial.getAdditionalRenderState();

        if(wire) {
            debugRenderState.setWireframe(originalMaterial == null || !originalMaterial.getAdditionalRenderState().isWireframe());
        }

        if(faceCullOff) {
            debugRenderState.setFaceCullMode(RenderState.FaceCullMode.Off);
        }

        return debugMaterial;
    }
 
开发者ID:NemesisMate,项目名称:UtilJME3-Debug,代码行数:27,代码来源:DebugMeshState.java


示例3: AbstractMeshElement

import com.jme3.material.RenderState; //导入依赖的package包/类
public AbstractMeshElement(BaseScreen screen, Vector2f position, Size dimension) {
	super(screen, null, position, dimension, Vector4f.ZERO, null);
	setIgnoreMouse(true);

	meshMaterial = new Material(screen.getApplication().getAssetManager(), "icetone/shaders/Unshaded.j3md");
	meshMaterial.setVector2("OffsetAlphaTexCoord", new Vector2f(0, 0));
	meshMaterial.setFloat("GlobalAlpha", screen.getGlobalAlpha());
	meshMaterial.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
	meshMaterial.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Back);

	setLayoutManager(new DefaultLayout() {

		@Override
		protected void onCalcClip(ElementContainer<?,?> container) {
			super.onCalcClip(container);
			if (!clippingLayers.isEmpty()) {
				meshMaterial.setVector4("Clipping", getClippingBounds());
				meshMaterial.setBoolean("UseClipping", true);
			} else {
				meshMaterial.setBoolean("UseClipping", false);
			}
		}

	});
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:26,代码来源:AbstractMeshElement.java


示例4: checkMaterial

import com.jme3.material.RenderState; //导入依赖的package包/类
protected void checkMaterial(BaseScreen screen) {
	if (mat == null) {
		mat = new Material(ToolKit.get().getApplication().getAssetManager(), "icetone/shaders/Unshaded.j3md");
		mat.setVector2("OffsetAlphaTexCoord", new Vector2f(0, 0));
		mat.setFloat("GlobalAlpha", getAlphaValue());
		mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
		mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Back);
		if (isAtlasTextureInUse()) {
			mat.setBoolean("UseEffectTexCoords", true);
		} else {
			mat.setBoolean("UseEffectTexCoords", false);
		}
		mat.setColor("Color", defaultColor);
		mat.setTexture("ColorMap", null);
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:17,代码来源:BaseElement.java


示例5: createShape

import com.jme3.material.RenderState; //导入依赖的package包/类
/**
 * Convenience factory method that creates a debuging bounding sphere geometry
 * @param assetManager the assetManager
 * @return the bounding sphere debug geometry.
 */
public static Geometry createShape(AssetManager assetManager) {
    ProbeRadiusShape b = new ProbeRadiusShape();
    Geometry geom = new Geometry("BoundingDebug", b);

    Material mat = new Material(assetManager, "com/jme3/gde/scenecomposer/gizmo/light/mat/dashed/dashed.j3md");        
    mat.getAdditionalRenderState().setWireframe(true);
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    mat.getAdditionalRenderState().setDepthWrite(false);
    mat.getAdditionalRenderState().setDepthTest(false);  
    mat.setFloat("DashSize", 0.5f);
    geom.setQueueBucket(RenderQueue.Bucket.Transparent);
    geom.addControl(new BillboardControl());
    
    
    geom.setMaterial(mat);
    return geom;

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:24,代码来源:ProbeRadiusShape.java


示例6: createShape

import com.jme3.material.RenderState; //导入依赖的package包/类
public static Geometry createShape(AssetManager assetManager, String name, int radialSample) {
    RadiusShape b = new RadiusShape(radialSample);
    Geometry geom = new Geometry(name, b);

    Material mat = new Material(assetManager, "com/jme3/gde/scenecomposer/gizmo/mat/dashed/dashed.j3md");
    mat.getAdditionalRenderState().setWireframe(true);
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    mat.getAdditionalRenderState().setDepthWrite(false);
    mat.getAdditionalRenderState().setDepthTest(false);
    mat.getAdditionalRenderState().setLineWidth(2f);

    mat.setColor("Color", ColorRGBA.Orange);
    mat.setFloat("DashSize", 0.5f);
    geom.setQueueBucket(RenderQueue.Bucket.Transparent);

    geom.setMaterial(mat);
    return geom;

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:RadiusShape.java


示例7: getNode

import com.jme3.material.RenderState; //导入依赖的package包/类
public Node getNode(AssetManager assetM, ColorRGBA color) {
    Node n = new Node();
    if (SHOW_HITBOX) {
        //geo.setCullHint(Spatial.CullHint.Always);
        //}else {
        Material mat = new Material(assetM, "Common/MatDefs/Misc/Unshaded.j3md");
        ColorRGBA col = color.clone();
        col.a = .5f;
        mat.setColor("Color", col);
        mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
        Geometry geo = new Geometry(name, new Quad(w, h));
        geo.setMaterial(mat);
        geo.setLocalTranslation(-w / 2, -h / 2, 0);
        n.attachChild(geo);
    }
    return n;
}
 
开发者ID:Pesegato,项目名称:MonkeySheet,代码行数:18,代码来源:HBRect.java


示例8: MSMaterialControl

import com.jme3.material.RenderState; //导入依赖的package包/类
public MSMaterialControl(AssetManager assetManager, Geometry geo, MSContainer msCont, MSControl msc){
    material = new Material(assetManager, "MonkeySheet/MatDefs/Anim.j3md");
    Texture[] sheetsX=new Texture[msCont.sheets.length];
    for (int i = 0; i < msCont.sheets.length; i++) {
        sheetsX[i]=assetManager.loadTexture(msCont.sheets[i]);
    }
    material.setFloat("SizeX", msCont.numTiles);
    material.setFloat("SizeY", msCont.numTiles);
    material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    for (MTween mt:MonkeySheetAppState.anis.values()){
        if (mt.msCont==msCont)
            mt.setTextures(sheetsX);
    }
    geo.setMaterial(material);
    geo.addControl(this);
    this.msc=msc;
        material.setFloat("Position", msc.anim.anim[msc.position].position);
        material.setTexture("ColorMap", msc.anim.anim[msc.position].sheetX);
        material.setFloat("FlipHorizontal", 0.0f);
        material.setFloat("AlphaValue", 1.0f);
        material.setColor("FogColor", fogColor);
        material.setFloat("FogIntensity", 0.0f);
}
 
开发者ID:Pesegato,项目名称:MonkeySheet,代码行数:24,代码来源:MSMaterialControl.java


示例9: resetMaterial

import com.jme3.material.RenderState; //导入依赖的package包/类
private static void resetMaterial(Geometry geo) {
        // 准许透明
        geo.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
        // 树叶不需要Cull
        geo.getMaterial().getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
        
        // 重要:让alpha透明图片不会盖住后面的图片(特别是在手机上)
        geo.getMaterial().getAdditionalRenderState().setDepthWrite(true);
        geo.getMaterial().getAdditionalRenderState().setDepthTest(true);
        geo.getMaterial().getAdditionalRenderState().setAlphaTest(true);
        geo.getMaterial().getAdditionalRenderState().setAlphaFallOff(alphaFallOff);
        geo.getMaterial().getAdditionalRenderState().setColorWrite(true);
        
//        geo.getMaterial().setBoolean("UseAlpha", true);
        geo.getMaterial().setBoolean("UseMaterialColors", true);
        geo.getMaterial().setFloat("AlphaDiscardThreshold", alphaFallOff);
        geo.getMaterial().setFloat("Shininess", 0.3f);
        geo.getMaterial().setColor("Ambient", new ColorRGBA(0.7f, 0.7f, 0.7f, 1f));
        geo.getMaterial().setColor("Diffuse", new ColorRGBA(0.7f, 0.7f, 0.7f, 1f));
        geo.getMaterial().setColor("Specular", new ColorRGBA(0, 0, 0, 1));
        
        // 设置Transparent,否则与背景的天空盒混合时会树叶的透明信息变成黑色。
        // 部分树形不能使用Translucent,只能用Transparent
        geo.setQueueBucket(Bucket.Transparent);
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:26,代码来源:TreeFixUtils.java


示例10: convertToGrassMaterial

import com.jme3.material.RenderState; //导入依赖的package包/类
private Material convertToGrassMaterial(Material originMat
        , boolean swaying, float swayFrequency, float swayVariation, float swayDistance, Vector2f wind) {
    Material grassMat = new Material(LuoYing.getAssetManager(), AssetConstants.MATERIAL_GRASS);
    grassMat.setName("Grass Material");
    transferMatParam(originMat, grassMat, "AlphaDiscardThreshold", VarType.Float);
    transferMatParam(originMat, grassMat, "UseMaterialColors", VarType.Boolean);
    transferMatParam(originMat, grassMat, "UseVertexColor", VarType.Boolean);
    transferMatParam(originMat, grassMat, "Ambient", VarType.Vector4);
    transferMatParam(originMat, grassMat, "Diffuse", VarType.Vector4);
    transferMatParam(originMat, grassMat, "Specular", VarType.Vector4);
    transferMatParam(originMat, grassMat, "Shininess", VarType.Float);
    transferMatParam(originMat, grassMat, "DiffuseMap", VarType.Texture2D);
    transferMatParam(originMat, grassMat, "NormalMap", VarType.Texture2D);
    transferMatParam(originMat, grassMat, "SpecularMap", VarType.Texture2D);
    
    grassMat.setTransparent(true);
    grassMat.getAdditionalRenderState().setDepthWrite(true);
    grassMat.getAdditionalRenderState().setDepthTest(true);
    grassMat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
    
    grassMat.setBoolean("Swaying", swaying);
    grassMat.setVector3("SwayData", new Vector3f(swayFrequency, swayVariation, swayDistance));
    grassMat.setVector2("Wind", wind);
    
    return grassMat;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:27,代码来源:PlantEntity.java


示例11: ProjectProcessor

import com.jme3.material.RenderState; //导入依赖的package包/类
public ProjectProcessor(Node root, AssetManager assetManager) {
        castCam = new Camera((int)128, (int)128);
        castCam.setParallelProjection(true);
        castCam.setFrustum(-1, 1, -1, 1, 1, -1);
        
        //Textures\tex\magic\magic.jpg
        // Textures\tex\sky\default\east.jpg
        tex = assetManager.loadTexture("Textures/tex/magic/magic.jpg");
//        tex = assetManager.loadTexture("Textures/tex/sky/default/east.jpg");
//        tex = assetManager.loadTexture("Interface/item/face/female5.jpg");
        mat = new Material(assetManager, "MatDefs/Projection/Projection.j3md");
        
        QuadXYC quad = new QuadXYC(1,1);
        projGeo = new Geometry("ProjGeo", quad);
        projGeo.setLocalScale(width, height, 1);
        Material debugMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        debugMat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
        projGeo.setMaterial(debugMat);
        projGeo.setCullHint(Spatial.CullHint.Always);
        root.attachChild(projGeo);
        
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:23,代码来源:ProjectProcessor.java


示例12: createSunFlag

import com.jme3.material.RenderState; //导入依赖的package包/类
private Spatial createSunFlag(String icon) {
    Material mat = MaterialUtils.createUnshaded();
    mat.setTexture("ColorMap", Jfx.getJmeApp().getAssetManager().loadTexture(icon));
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    
    Geometry flagObj = new Geometry("DirectionalLightEntitySelectObj", new QuadXYC(1, 1));
    flagObj.setMaterial(mat);
    flagObj.setQueueBucket(RenderQueue.Bucket.Translucent);
    
    // 让flag始终朝向镜头
    BillboardControl bc = new BillboardControl();
    bc.setAlignment(BillboardControl.Alignment.Screen);
    flagObj.addControl(bc);
    
    return flagObj;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:17,代码来源:PointLightEntityControlTile.java


示例13: createTorus

import com.jme3.material.RenderState; //导入依赖的package包/类
private Spatial createTorus(String name, ColorRGBA color) {
    Node torus = new Node(name);
    
    // 可见的旋转圈
    Material mat = MaterialUtils.createUnshaded(color);
    mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
    mat.getAdditionalRenderState().setDepthTest(false);
    Geometry torusInner = new Geometry(name + "tours", new Torus(80, 6, 0.005f, 1.0f));
    torusInner.setMaterial(mat);
    
    // 用于优化点选
    Geometry torusOuter = new Geometry(name + "picker", new Torus(20, 4, 0.15f, 1.0f));
    torusOuter.setMaterial(MaterialUtils.createUnshaded());
    torusOuter.setCullHint(CullHint.Always);
    
    torus.attachChild(torusInner);
    torus.attachChild(torusOuter);
    
    return torus;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:21,代码来源:RotationAxis.java


示例14: registerInput

import com.jme3.material.RenderState; //导入依赖的package包/类
private void registerInput() {
	if (brushGeom == null) {
		brushGeom = new Geometry("brush", new Quad(BRUSH_RADIUS*2, BRUSH_RADIUS*2));
		Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
		mat.setTexture("ColorMap", app.getAssetManager().loadTexture("org/shaman/terrain/polygonal/Brush.png"));
		mat.getAdditionalRenderState().setDepthTest(false);
		mat.getAdditionalRenderState().setDepthWrite(false);
		mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
		brushGeom.setMaterial(mat);
		graphNode.attachChild(brushGeom);
		brushGeom.setCullHint(Spatial.CullHint.Always);
		
		listener = new InputListenerImpl();
		app.getInputManager().addMapping("PolygonalMouseX+", new MouseAxisTrigger(MouseInput.AXIS_X, false));
		app.getInputManager().addMapping("PolygonalMouseX-", new MouseAxisTrigger(MouseInput.AXIS_X, true));
		app.getInputManager().addMapping("PolygonalMouseY+", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
		app.getInputManager().addMapping("PolygonalMouseY-", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
		app.getInputManager().addMapping("PolygonalMouseLeft", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
		app.getInputManager().addMapping("PolygonalMouseRight", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
	}
	app.getInputManager().addListener(listener, "PolygonalMouseX+", "PolygonalMouseX-", "PolygonalMouseY+", 
			"PolygonalMouseY-", "PolygonalMouseLeft", "PolygonalMouseRight");
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:24,代码来源:PolygonalMapGenerator.java


示例15: initWaterPlane

import com.jme3.material.RenderState; //导入依赖的package包/类
private void initWaterPlane() {
	float size = map.getSize() * TerrainHeighmapCreator.TERRAIN_SCALE;
	Quad quad = new Quad(size, size);
	Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
	mat.setColor("Color", new ColorRGBA(0, 0, 0.5f, 0.5f));
	mat.setTransparent(true);
	mat.getAdditionalRenderState().setAlphaTest(true);
	mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
	mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
	mat.getAdditionalRenderState().setDepthWrite(false);
	Geometry geom = new Geometry("water", quad);
	geom.setMaterial(mat);
	geom.setQueueBucket(RenderQueue.Bucket.Transparent);
	geom.rotate(FastMath.HALF_PI, 0, 0);
	geom.move(-size/2, 0, -size/2);
	waterPlane = geom;
	sceneNode.attachChild(geom);
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:19,代码来源:SketchTerrain.java


示例16: loadHighResTree

import com.jme3.material.RenderState; //导入依赖的package包/类
private void loadHighResTree() {
		Node treeNode = (Node) assetManager.loadModel(tree.name + "/Tree.j3o");
		//Note: all tree nodes that share the same model file use the same
		//material -> the same settings for fade distances
		highResStem = (Geometry) treeNode.getChild(0);
		highResStem.getMaterial().setFloat("FadeNear", tree.highResStemFadeNear);
		highResStem.getMaterial().setFloat("FadeFar", tree.highResStemFadeFar);
		highResStem.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
		highResStem.getMaterial().getAdditionalRenderState().setAlphaTest(true);
		highResStem.getMaterial().setTransparent(true);
		highResStem.setQueueBucket(RenderQueue.Bucket.Transparent);
//		highResStem.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
		super.attachChild(highResStem);
		if (treeNode.getChildren().size()>=1) {
			highResLeaves = (Geometry) treeNode.getChild(0);
			highResLeaves.getMaterial().setFloat("FadeNear", tree.highResLeavesFadeNear);
			highResLeaves.getMaterial().setFloat("FadeFar", tree.highResLeavesFadeFar);
			highResLeaves.setQueueBucket(RenderQueue.Bucket.Transparent);
//			highResLeaves.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
			super.attachChild(highResLeaves);
		}
		
	}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:24,代码来源:TreeNode.java


示例17: registerAction_ShowWireframe

import com.jme3.material.RenderState; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerAction_ShowWireframe(SpatialExplorer se, SimpleApplication app) {
	se.treeItemActions.add(new Action("Show Wireframe", (evt) -> {
		Spatial target = ((TreeItem<Spatial>)evt.getSource()).getValue();
		app.enqueue(() -> {
			target.breadthFirstTraversal(new SceneGraphVisitorAdapter(){
				public void visit(Geometry geom) {
					RenderState r = geom.getMaterial().getAdditionalRenderState();
					boolean wireframe = false;
					try {
						Field f = r.getClass().getDeclaredField("wireframe");
						f.setAccessible(true);
						wireframe = (Boolean) f.get(r);
					} catch(Exception exc) {
						exc.printStackTrace();
					}
					r.setWireframe(!wireframe);
				}
			});
			return null;
		});
	}));
}
 
开发者ID:davidB,项目名称:jme3_ext_spatial_explorer,代码行数:24,代码来源:Helper.java


示例18: initMark

import com.jme3.material.RenderState; //导入依赖的package包/类
private void initMark() {
//        Sphere sphere = new Sphere(30, 30, 0.2f);
//        mark = new Geometry("Mark", sphere);
//        mark.setLocalTranslation(0, 1f, 0);
//        Material mark_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//        mark_mat.setColor("Color", ColorRGBA.Red);
//        mark.setMaterial(mark_mat);

        Node model = (Node) assetManager.loadModel("Models/seal.j3o");
        model.setLocalTranslation(0f, 1.3f, 0);
        model.setLocalScale(2.3f);
        Material material = new Material(
                assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        material.setTexture("ColorMap", assetManager.loadTexture("Textures/Minefield/Cell/locked.png"));
        material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
        model.setQueueBucket(Bucket.Translucent);
        model.setMaterial(material);
        mark = model;
    }
 
开发者ID:kemonoske,项目名称:ArcaneMining,代码行数:20,代码来源:SealCell.java


示例19: createShield

import com.jme3.material.RenderState; //导入依赖的package包/类
private Geometry createShield() {
    float radius = 12f;
    Sphere sphere = new Sphere(32, 32, radius);
    Geometry geometry = new Geometry("shield-geom", sphere);

    Material mat = new Material(assets, "MatDefs/Lava/Lava.j3md");
    mat.setFloat("Speed", 30f);

    Texture tex = assets.loadTexture("Textures/Fire6.png");
    Texture noise = assets.loadTexture("Textures/noise3.png");
    tex.setWrap(Texture.WrapMode.MirroredRepeat);
    noise.setWrap(Texture.WrapMode.MirroredRepeat);
    mat.setTexture("Color", tex);
    mat.setTexture("Noise", noise);

    mat.getAdditionalRenderState()
            .setBlendMode(RenderState.BlendMode.Additive);

    geometry.setQueueBucket(RenderQueue.Bucket.Transparent);
    geometry.setMaterial(mat);

    return geometry;
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:24,代码来源:PurifyingFlameInfo.java


示例20: createSmokeEmitter

import com.jme3.material.RenderState; //导入依赖的package包/类
private ParticleEmitter createSmokeEmitter() {
    ParticleEmitter smoke = new ParticleEmitter("smoke-emitter",
            ParticleMesh.Type.Triangle, 300);
    Material material = new Material(assets,
            "Common/MatDefs/Misc/Particle.j3md");
    material.setTexture("Texture",
            assets.loadTexture("Effects/flame_alpha.png"));
    material.getAdditionalRenderState()
            .setBlendMode(RenderState.BlendMode.Alpha);
    smoke.setMaterial(material);
    smoke.setImagesX(2);
    smoke.setImagesY(2);
    smoke.setSelectRandomImage(true);
    smoke.setStartColor(new ColorRGBA(0.4f, 0.4f, 0.4f, 1.0f));
    smoke.setStartColor(new ColorRGBA(0.4f, 0.4f, 0.4f, 0.2f));
    smoke.getParticleInfluencer().setInitialVelocity(Vector3f.ZERO);
    smoke.setStartSize(5.0f);
    smoke.setEndSize(12.0f);
    smoke.setGravity(Vector3f.ZERO);
    smoke.setLowLife(1f);
    smoke.setHighLife(1.3f);
    smoke.setParticlesPerSec(200);

    smoke.setRandomAngle(true);
    return smoke;
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:27,代码来源:Meteor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SetAttribute类代码示例发布时间:2022-05-21
下一篇:
Java ConsumerException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap