Time for action – welcome to Dark City
For larger scenes, you should try a DirectionalLightShadowFilter
object from the com.jme3.shadow
package.
You can use a copy of ShadowDirectional.java
for the following exercise:
- Add a directional light source to the scene:
public void simpleInitApp() { DirectionalLight sunLight = new DirectionalLight(); sunLight.setDirection(new Vector3f(.3f, -0.5f, -0.5f)); rootNode.addLight(sunLight);
- If you re-use code from the
ShadowDirectional.java
class, deactivate the previously createdDirectionalLightShadowRenderer
object, or at least comment out itsaddProcessor()
line:// viewPort.addProcessor(dlsr);
- Create a
DirectionalLightShadowFilter
object in thesimpleInitApp()
method. Use thesetLight()
method to specify your ...
Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.