jME3 video test

Guinea pig speaking:



After a lot of "OMG - I HATE JME3"- moments, it worked as it should. Actually you guys did a very good job creating a new design for jme: Good job guys!





Pretty excited about my progress (don't laugh!):

http://home.arcor.de/michailo/jme3video.jpg



Now I can finally start working on my actual project!

(moved to JME3 board since this seemed to be strictly about video in JME3 and not JME2)



Sorry to hear the two of you didn't hit it off at first sight, but at least you powered through it reported back in the process. Your testing is highly appreciated :slight_smile:

my problems with JME3 were not Video related it was basically about the difference to JME2





// You can't add Quad to rootNode?!

myQuad = new Geometry("myMesh", new Quad(10,10));



// WTF is this manager

Texture tex = manager.loadTexture("Textures/Sky/Night/Night.png");



// So we are using Materials now

// Shading language for a simple texture?!

Material mat = new Material(manager, "Common/MatDefs/Misc/SimpleTextured.j3md");



// WTF is m_ColorMap

mat.setTexture("m_ColorMap", tex);



// Finally!

myQuad.setMaterial(mat);





These were the first thoughts I had, it was a little confusing at the beginning but is reasonable now!

Actually you guys did a very good job creating a new design for jme: Good job guys!

Thanks! I would love to hear what about those "I HATE JME3" moments though :P

my problems with JME3 were not Video related it was basically about the difference to JME2

I can also go through each jME2 line and do a WTF on each part :P why do I need to attach textures to a TextureState and lights to a LightState?! etc

Reason why quads/meshes are seperate from geometries is so you share a single mesh inside many different objects in your scene, the jME2 equivalent would be the SharedNode/SharedMesh classes, but in jME3 it is built-in the system.

We should rename the "manager" variable to "assetManager" but at time of writing there was only 1 manager (no Input or Render manager) and it was a too much to type :P

Can always make a new var "assetManager" to be an alias for "manager" but then we'll need to deprecate a variable somehow, not sure if the "@Deprecated" annotation works for variables.

Using a material doesn't imply using a shading language, it's just a material script, that could possibly include a shader, or it could not. The "m_ColorMap" is defined in SimpleTextured.j3md if you want to take a look at it. This is really just the "modern" way of doing things. When you set a texture on a model, how is it supposed to be used? Does it define the diffuse color or the specular? You need some way to specify that, that's why you have this pseudo-variable like way of setting textures.

Even though I said video will be available, it is still a work-in-progress, specifically, synchronization is a big issue right now that I am trying to fully resolve. I think I will just have to go with the GStreamer port from Cortado since it "simply works" rather than writing my own synchronization sys..

Transparency of textures doesn't work - does it?







       picture = new Picture("FrontPicture", true);

       picture.setPosition(100, 100);

       picture.setWidth(settings.getWidth() - 200);

       picture.setHeight(settings.getHeight() - 200);

       picture.setImage(assetManager, "Textures/Sky/Night/bild.gif", true);





I looked into the code and found:



   public void setImage(AssetManager manager, String imgName, boolean useAlpha){

       if (getMaterial() == null){

           Material mat = new Material(manager, "Common/MatDefs/Gui/Gui.j3md");

           mat.setColor("m_Color", ColorRGBA.White);

           setMaterial(mat);

       }

       TextureKey key = new TextureKey(imgName, true);

       material.setTexture("m_Texture", manager.loadTexture(key));

   }



I guess useAlpha has no function yet :frowning:

I there a workaround? I saw this transparent teapot in an example





UPDATE:



        Material mat2 = new Material(manager, "Common/MatDefs/Misc/Particle.j3md");

        mat2.setTexture("m_Texture", manager.loadTexture("Effects/Smoke/dot.png"));

        picture.setMaterial(mat2);





In Particle.j3md, I changed the Blendmode from AlphaAdditive to Alpha!!!



Yep, pretty confusing :wink:


Yeah it's fine if you change the BlendMode, there are many ways of handling transparent textures and depending on how you designed them you may need to switch the blendmode.

I used Alpha-additive for particles since it's common that the "blackness" in the particle texture is interpreted as alpha and is blended with the background (e.g a glow texture). But if you use the alpha channel only then using the alpha blend mode is fine too.

By the way, the useAlpha parameter is now used in the Picture class.