Hi everybody.
I want to remake NiftyToMest… But this code have material with Unshaded.j3md. When i remake it to Lighting.j3md (i’m newbie in Lighting) > place is white.
Idea:
Billboard and before him two quad with texture by NiftyToMesh + spotLight. First idea was billboard with animation + this two texture stick to billboard but i don’t know how do it so i stoped animation and before billboard created two quad with Nifty.
http://img201.imageshack.us/img201/6444/xxxvt.jpg
[java]ViewPort niftyView = renderManager.createPreView(“NiftyView”, new Camera(800, 150));
niftyView.setClearFlags(true, true, true);
ViewPort niftyView2 = renderManager.createPreView(“NiftyView”, new Camera(800, 140));
niftyView2.setClearFlags(true, true, true);
//
myGUI.MyScreenController startScreen = new myGUI.MyScreenController();
stateManager.attach(startScreen);
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,inputManager,audioRenderer,niftyView);
NiftyJmeDisplay niftyDisplay2 = new NiftyJmeDisplay(assetManager,inputManager,audioRenderer,niftyView);
nifty = niftyDisplay.getNifty();
nifty.fromXml(“Interface/myGui/lvlDisplay.xml”, “level”, startScreen);
nifty2 = niftyDisplay2.getNifty();
nifty2.fromXml(“Interface/myGui/scoreDisplay.xml”, “score”, startScreen);
niftyView.addProcessor(niftyDisplay);
niftyView2.addProcessor(niftyDisplay2);
//texture
Texture2D depthTex = new Texture2D(800, 150, Format.Depth);
FrameBuffer fb = new FrameBuffer(800, 150, 1);
fb.setDepthTexture(depthTex);
Texture2D tex = new Texture2D(800, 150, Format.RGBA8);
tex.setMinFilter(MinFilter.Trilinear);
tex.setMagFilter(MagFilter.Bilinear);
fb.setColorTexture(tex);
niftyView.setClearFlags(true, true, true);
niftyView.setOutputFrameBuffer(fb);
//texture n2
Texture2D depthTex2 = new Texture2D(800, 140, Format.Depth);
FrameBuffer fb2 = new FrameBuffer(800, 140, 1);
fb2.setDepthTexture(depthTex2);
Texture2D tex2 = new Texture2D(800, 140, Format.RGBA8);
tex2.setMinFilter(MinFilter.Trilinear);
tex2.setMagFilter(MagFilter.Bilinear);
fb2.setColorTexture(tex2);
niftyView2.setClearFlags(true, true, true);
niftyView2.setOutputFrameBuffer(fb2);
//quad with Lighting.j3md
Geometry qu = new Geometry(“neco”, new Quad(8, 2));
Material mat = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);
mat.setTexture(“Diffuse”, tex); // there it is!!!
qu.setMaterial(mat);
qu.move(-4.0f, -1.0f, 0.1f);
qu.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(qu);
//quad with mat def Unshaded.j3md > work but without shadows by spotLight
Geometry qu2 = new Geometry(“neco”, new Quad(8, 1.5f));
Material mat2 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat2.setTexture(“ColorMap”, tex2);
qu2.setMaterial(mat2);
qu2.move(-4.0f, 2.3f, 0.1f);
rootNode.attachChild(qu2);[/java]
I tried play with this code but code without error.
PS: I know that this code is superfluous but for this time it work and sry for my english.
THX a lot.