rootNode.setCullMode(Spatial.CULL_ALWAYS); opaques.setCullMode(Spatial.CULL_DYNAMIC); transps.setCullMode(Spatial.CULL_DYNAMIC); orthos.setCullMode(Spatial.CULL_NEVER);
rootNode.setCullMode(SceneElement.CULL_ALWAYS); opaques.setCullMode(SceneElement.CULL_DYNAMIC); transps.setCullMode(SceneElement.CULL_DYNAMIC); orthos.setCullMode(SceneElement.CULL_NEVER);
  protected void simpleInitGame() {    display.setTitle("Test Render Queue - false - hit 'Q' to toggle Queue mode - 'R' Two Pass: - true");    KeyBindingManager.getKeyBindingManager().set("queue", KeyInput.KEY_Q);    KeyBindingManager.getKeyBindingManager().set("trans", KeyInput.KEY_R);    cam.setLocation(new Vector3f(10, 0, 50));    cam.update();    Vector3f max = new Vector3f(5, 5, 5);    Vector3f min = new Vector3f( -5, -5, -5);    opaques = new Node("Opaques");    transps = new Node("Transps");    orthos = new Node("Orthos");    transps.setRenderQueueMode(Renderer.QUEUE_SKIP);    opaques.setRenderQueueMode(Renderer.QUEUE_SKIP);    orthos.setRenderQueueMode(Renderer.QUEUE_SKIP);    rootNode.attachChild(orthos);    rootNode.attachChild(transps);    rootNode.attachChild(opaques);    Box b1 = new Box("Box", min, max);    b1.setModelBound(new BoundingBox());    b1.updateModelBound();    b1.setLocalTranslation(new Vector3f(0, 0, -15));    opaques.attachChild(b1);    Box b2 = new Box("Box", min, max);    b2.setModelBound(new BoundingBox());    b2.updateModelBound();    b2.setLocalTranslation(new Vector3f(0, 0, -30));    opaques.attachChild(b2);    Box b3 = new Box("Box", min, max);    b3.setModelBound(new BoundingBox());    b3.updateModelBound();    b3.setLocalTranslation(new Vector3f(0, -15, -15));    opaques.attachChild(b3);    TextureState ts = display.getRenderer().createTextureState();    ts.setEnabled(true);    ts.setTexture(        TextureManager.loadTexture(        TestRenderQueue.class.getClassLoader().getResource(        "jmetest/data/images/Monkey.tga"),        Texture.MM_LINEAR_LINEAR,        Texture.FM_LINEAR));    opaques.setRenderState(ts);    LightState ls = display.getRenderer().createLightState();    ls.setEnabled(true);    DirectionalLight dLight = new DirectionalLight();    dLight.setEnabled(true);    dLight.setDiffuse(new ColorRGBA(1,1,1,1));    dLight.setDirection(new Vector3f(-1,-1,-1));    ls.attach(dLight);    DirectionalLight dLight2 = new DirectionalLight();    dLight2.setEnabled(true);    dLight2.setDiffuse(new ColorRGBA(1,1,1,1));    dLight2.setDirection(new Vector3f(1,1,1));    ls.attach(dLight2);    ls.setTwoSidedLighting(false);    transps.setRenderState(ls);    transps.setLightCombineMode(LightState.REPLACE);    Box tb1 = new Box("TBox Blue", min, max);    tb1.setModelBound(new BoundingBox());    tb1.updateModelBound();    tb1.setLocalTranslation(new Vector3f(0, 15, 15));    transps.attachChild(tb1);    MaterialState ms1 = display.getRenderer().createMaterialState();    ms1.setEnabled(true);    ms1.setDiffuse(new ColorRGBA(0,0,1,.75f));    ms1.setShininess(128);    tb1.setRenderState(ms1);    Torus tb2 = new Torus("TBox Green", 20, 20, 3, 6);    tb2.setModelBound(new BoundingBox());    tb2.updateModelBound();    tb2.setLocalTranslation(new Vector3f(0, 0, 30));    transps.attachChild(tb2);    MaterialState ms2 = display.getRenderer().createMaterialState();    ms2.setEnabled(true);    ms2.setDiffuse(new ColorRGBA(0,1,0,.75f));    ms2.setShininess(128);    tb2.setRenderState(ms2);    Box tb3 = new Box("TBox Red", min, max);    tb3.setModelBound(new BoundingBox());    tb3.updateModelBound();    tb3.setLocalTranslation(new Vector3f(0, 0, 15));    transps.attachChild(tb3);    MaterialState ms3 = display.getRenderer().createMaterialState();    ms3.setEnabled(true);    ms3.setDiffuse(new ColorRGBA(1,0,0,.5f));    ms3.setShininess(128);    tb3.setRenderState(ms3);        Box tb4 = new Box("TBox Blue2", new Vector3f(-4.5f,-4.5f,-4.5f), new Vector3f(4.5f,4.5f,4.5f));    tb4.setModelBound(new BoundingBox());    tb4.updateModelBound();    tb4.setLocalTranslation(new Vector3f(0, 4, 17));    transps.attachChild(tb4);    MaterialState ms4 = display.getRenderer().createMaterialState();    ms4.setEnabled(true);    ms4.setDiffuse(new ColorRGBA(0,0,1,.75f));    ms4.setShininess(128);    tb4.setRenderState(ms4);    AlphaState as = display.getRenderer().createAlphaState();    as.setEnabled(true);    as.setBlendEnabled(true);    as.setSrcFunction(AlphaState.SB_SRC_ALPHA);    as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);    transps.setRenderState(as);    Vector2f center = new Vector2f(display.getWidth()>>1, display.getWidth()>>1);    Quad q1 = new Quad("Ortho Q1", 40, 40);    q1.setLocalTranslation(new Vector3f(100+center.x,100+center.y,0));    q1.setZOrder(1);    q1.setDefaultColor(ColorRGBA.white);    q1.setLightCombineMode(LightState.OFF);    orthos.attachChild(q1);    Quad q2 = new Quad("Ortho Q2", 100, 100);    q2.setLocalTranslation(new Vector3f(60+center.x,60+center.y,0));    q2.setZOrder(5);    q2.setDefaultColor(ColorRGBA.red);    q2.setLightCombineMode(LightState.OFF);    orthos.attachChild(q2);    Quad q3 = new Quad("Ortho Q3", 120, 60);    q3.setLocalTranslation(new Vector3f(-20+center.x,-150+center.y,0));    q3.setZOrder(2);    q3.setDefaultColor(ColorRGBA.blue);    q3.setLightCombineMode(LightState.OFF);    orthos.attachChild(q3);    ZBufferState zstate = display.getRenderer().createZBufferState();    zstate.setWritable(false);    zstate.setEnabled(false);    orthos.setRenderState(zstate);    orthos.setRenderState(Renderer.defaultStateList[RenderState.RS_LIGHT]);        rootNode.setCullMode(Spatial.CULL_ALWAYS);    opaques.setCullMode(Spatial.CULL_DYNAMIC);    transps.setCullMode(Spatial.CULL_DYNAMIC);    orthos.setCullMode(Spatial.CULL_NEVER);  }