Please could you tell me where is rain effect 2D?

where is rain effect ?

there is no rain effect in jME - you'll need to copy from other users or make your own

Check out the fountain example in RenParticleEditor in jmetest package - it might get you started

I Check out the fountain example in RenParticleEditor in jmetest package .but  not same rain effect . your code :





public class hieuungparticle extends SimpleGame

{

private TerrainBlock tb;

private Skybox sky;

public static ParticleGeometry particleGeom;

private WaterRenderPass waterEffectRenderPass;

private ProjectedGrid projectedGrid;

private BasicPassManager pManager;

  private LightNode sun;

  private LensFlare flare;

public static void main(String[] args)

{

hieuungparticle app=new hieuungparticle();

app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);

app.start();



}







@Override

protected void simpleInitGame()

{

Vector3f temp=new Vector3f();

      temp.x=cam.getLocation().x;

      temp.y=cam.getLocation().y;

      temp.z=cam.getLocation().z+100;

      cam.setLocation(temp);



buildRain();



}



private void buildRain()

{

particleGeom = ParticleFactory.buildLineParticles("Rain effect",1000);

     

     

        ZBufferState zbuff = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();

zbuff.setWritable(false);

zbuff.setEnabled(true);

    zbuff.setFunction(ZBufferState.CF_LEQUAL);

    particleGeom.setRenderState(zbuff);

     

     

    //    particleGeom.setStartColor(new ColorRGBA(0.0f, 0.0625f, 1.0f, 1.0f));

      //  particleGeom.setEndColor(new ColorRGBA(0.0f, 0.0625f, 1.0f, 0.0f));

       



        AlphaState as = (AlphaState) particleGeom

                .getRenderState(RenderState.RS_ALPHA);

        if (as == null) {

            as = DisplaySystem.getDisplaySystem().getRenderer()

                    .createAlphaState();

            as.setBlendEnabled(true);

            as.setSrcFunction(AlphaState.SB_SRC_ALPHA);

            as.setTestEnabled(true);

            as.setTestFunction(AlphaState.TF_GREATER);

            particleGeom.setRenderState(as);

            particleGeom.updateRenderState();

        }

        as.setDstFunction(AlphaState.DB_ONE);

        TextureState ts = display.getRenderer().createTextureState();

        ts.setTexture(TextureManager.loadTexture(RenParticleEditor.class

                .getClassLoader().getResource(

                        "jmetest/data/texture/flaresmall.jpg"),

                Texture.FM_LINEAR, Texture.FM_LINEAR));

        particleGeom.setRenderState(ts);

       

       

        particleGeom.setEmissionDirection(new Vector3f(0.0f, 1.0f, 0.0f));

            particleGeom.setMaximumAngle(3.1415927f);

            particleGeom.setMinimumAngle(0);

            particleGeom.getParticleController().setSpeed(0.5f);

            particleGeom.setMinimumLifeTime(1626.0f);

            particleGeom.setMaximumLifeTime(2400.0f);

            particleGeom.setStartSize(20);

            particleGeom.setEndSize(50);

            particleGeom.setStartColor(new ColorRGBA(0.16078432f, 0.16078432f,1.0f, 1.0f));

            particleGeom.setEndColor(new ColorRGBA(0.16078432f, 0.16078432f,1.0f, 0.15686275f));

            particleGeom.getParticleController().setControlFlow(false);

          //  particleGeom.setReleaseRate(300);

            particleGeom.setReleaseVariance(0.0f);

            particleGeom.setInitialVelocity(0.58f);

            particleGeom.getParticleController().setRepeatType(Controller.RT_WRAP);

            particleGeom.warmUp(120);

        particleGeom.addInfluence(SimpleParticleInfluenceFactory.createBasicGravity(new Vector3f(0, -40f, 0), true));

        Ring disk = new Ring(new Vector3f(500, 500, 200), Vector3f.UNIT_Y, 1, 1000);

        particleGeom.setGeometry(disk);

       

       

        rootNode.attachChild(particleGeom);

        particleGeom.updateRenderState();



}

}


irrisor said:

there is no rain effect in jME - you'll need to copy from other users or make your own


Do you have rain effect soure code ?.if you have rain effect source code.give me .please 

Hi guys!



I want to make rain, but only use particle system.

So I want to make rain effect like 2D.

This effect like in NeedForSpeeds, Racers…



Anyone can help, thanks!

hey there,



you have to start the program RensParticleEditor itself and then you will see a tab "Examples" where you will find the example "Fountain". if you are below the fountain, it kind of looks like rain.



it is not perfect but you can go on from there and play around in the particle editor.



so long …

Andy

dhdd said:

hey there,

you have to start the program RensParticleEditor itself and then you will see a tab "Examples" where you will find the example "Fountain". if you are below the fountain, it kind of looks like rain.

it is not perfect but you can go on from there and play around in the particle editor.

so long ...
Andy


You know, I don't want to use particle system to make rain. I want to make rain used by game 2D.

I remember that It has an idea to make rain with 2D in this forum, but I miss it!

You have already posted in that thread also, where an other option was mentioned: http://www.jmonkeyengine.com/jmeforum/index.php?topic=7622.0



Basically it involves using several transparent layers with texture in front of the camera and moving them.



And, no, I do not have a source-code