Shadows problem - can somebody help?

Shadows problem - can somebody help?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Shadows problem - can somebody help?

Post by Sean Mirrsen »

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? ....
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

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.
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

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:
Image
Image
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.
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Well the geometry of the shadows are entirely computed in vertex shaders so im not sure why this would happen. On the other hand im not sure why they display so nicely if you have neither fragment_program nor crossbar. (Although I think i only used crossbar for the shadows on ground)
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

On second thought your problem is probably that you dont use pbuffers so the shadowmap will be rendered to the main screen which isnt big enough to hold it. Decrease the shadow map resolution to 512x512 and the problems will probably disapear although it will be really blocky.
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

If pbuffers didn't work, I would get pbuffer errors, no? I thought the "p" buffer is the pixel buffer, so that the pixel_buffer_object works instead. Or is that "point" buffer?
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

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.
Post Reply

Return to “Engine”