9
« on: January 09, 2010, 05:40:53 pm »
Perhaps I am doing somthing really stupid - therefore here the code snippet which sets up the shadow map:
void setupShadowCaster() {
if (!SW_RENDERING) {
sh = null;
if (useShadows) {
projector = new Projector();
projector.setPosition(sun.getPosition());
projector.lookAt(md.getTransformedCenter()); //NOTE: this requires that structure is setup first
projector.setFOV(0.7f); //set this value large enough so that the complete shadow is casted
projector.setYFOV(0.7f);
sh = new ShadowHelper(world, buffer, projector, 1024);
sh.addReceiver(background);
sh.setAmbientLight(new Color(64, 64, 64)); //sets the color of the shadow
// sh.setFiltering(true);
}
}
}
when using HW renderer and Shadow map (i.e. SW_RENDERING = false, useShadows=true)
Loading Texture...karoXY.jpg
Loading Texture...karoYZ.jpg
Loading Texture...karoXZ.jpg
Loading Texture...karobw.jpg
Loading Texture...envmap-alu.jpg
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Adding Lightsource: 0
Thread[AWT-EventQueue-0,6,main]
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Hardware supports textures up to 8192*8192 in size!
Additional visibility list (2) created with size: 4096
Additional visibility list (3) created with size: 4096
Additional visibility list (4) created with size: 4096
Allocating 4194304 bytes of direct memory!
Caching 4194304 bytes of direct memory!
Allocating 262144 bytes of direct memory!
Caching 262144 bytes of direct memory!
>>> Very slow.
Setting useShadows to false: buffer is only cleared, nothing is rendered (but my simulation worker thread is running)
Loading Texture...karoXY.jpg
Loading Texture...karoYZ.jpg
Loading Texture...karoXZ.jpg
Loading Texture...karobw.jpg
Loading Texture...envmap-alu.jpg
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Adding Lightsource: 0
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
no rendering at all after this (buffer is only cleared)....