Ok, as you probably know, my comp was unable to run Spring with shadows enabled the first time around. Now that I got the source code, and made a few tweaks, I found out that shadows can indeed be displayed by my comp. The problem is that the surface that is supposed to cast or receive shadows is tilted in the direction the sun is facing. (but always parallel to either of the map sides)
What I changed was removing the check for WGLEW_ARB_pbuffer and GLEW_ARB_texture_env_crossbar in the shadow handler. I have GL_EXT_pixel_buffer_object to replace the first extension, but nothing to replace the second. I suspect that is what is causing the problem. Is there any workaround to make the shadows display correctly? It's probably hard, but it's all just math I believe... After all, the shadows are working good, they are just over-deformed in one axis. SJ? Anyone? ....
Shadows problem - can somebody help?
Moderator: Moderators
Hm i dont think ext_pixel_buffer is a replacement for pbuffers, EXT_framebuffer_object is supposed to be but that isnt supported in non beta drivers yet afaik. As for the second one its automatically replaced by arb_fragment_program+arb_fragment_program_shadow by spring if you have those instead.
What do you mean tilted ? That make no sense with the rest of your comment. Show some screenshots.
What do you mean tilted ? That make no sense with the rest of your comment. Show some screenshots.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
I mean tilted like in a way it's turned on x or z axis around the center point (which is under the camera). Here:
In the first shot, you can see the 'dark plane' that appeared where the surface that detects shadow gets buried under the landscape. It always begins under the camera, and is on the opposite side from the sun.
In the second shot, you can see the shadow being correctly displayed, and the commander's shadow, but you can see how the shadow is cut off at the base of the hill, as if the 'shadow surface' cuts into the side of the hill, and there's no shadow under that point.
I don't have fragment_program to replace it, or I would have had water reflections. And I don't have EXT_framebuffer_object, but somehow don't get pbuffer errors.
In the first shot, you can see the 'dark plane' that appeared where the surface that detects shadow gets buried under the landscape. It always begins under the camera, and is on the opposite side from the sun.
In the second shot, you can see the shadow being correctly displayed, and the commander's shadow, but you can see how the shadow is cut off at the base of the hill, as if the 'shadow surface' cuts into the side of the hill, and there's no shadow under that point.
I don't have fragment_program to replace it, or I would have had water reflections. And I don't have EXT_framebuffer_object, but somehow don't get pbuffer errors.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
I tried setting the map resolution to 128 - and still got the same results. Something's being miscalculated. I noticed a shadow matrix - could that be used to influence the problem in this case? Like, offsetting some edge values could help if this matrix does what I think it does. The problem is I don't know which are the 'edge' values.