Guest User

shadows

a guest
Sep 28th, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1.         viewPort.setBackgroundColor(new ColorRGBA(0.87890f, 0.921875f, 0.9375f, 1.0f));
  2.        
  3.         AmbientLight al = new AmbientLight();
  4.         al.setColor(ColorRGBA.White.mult(1.3f));
  5.         rootNode.addLight(al);
  6.        
  7.         DirectionalLight sun = new DirectionalLight();
  8.         sun.setColor(ColorRGBA.White);
  9.         sun.setDirection(new Vector3f(-1.0f, -2.0f, -3.0f).normalizeLocal());
  10.         rootNode.addLight(sun);
  11.        
  12.         final int SHADOWMAP_SIZE = 1024;
  13.         DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 3);
  14.         dlsr.setLight(sun);
  15.         viewPort.addProcessor(dlsr);
Advertisement
Add Comment
Please, Sign In to add comment