Jump to content

More accurate point-light shadow rendering?


benbeshara

Recommended Posts

Hi, I was just wondering if anyone has been working on more accurate shadows for Torque3D. The game I've been working on in my spare time is light-and-shadow stealth centric and the parabolic shadows in Torque3D just don't cut it for accuracy - if the geometry is complex enough, they look fine, but the distortion warps them in such a way that they're not representative of the actual path of the lights, and they don't always seem to 'pick up' all the geometry, leaving large gaps in the rendered shadow. I've tried the box shadow maps, and they're far more accurate but produce a lot of artefacting.


Any help would be very much appreciated, as graphics programming is far from my strong point.

Link to comment
Share on other sites

  • 7 months later...

So I had a little success clearing up the cubemap shadows by lowering the near plane but... they don't look great, and players don't cast shadows. I think I'm going to try to study up on lighting and shadow rendering and see what I can do when either 3.10 or 4.0 are released (I don't want to mess with the rendering side of the engine while it is being overhauled).

Link to comment
Share on other sites

Hey ben,


Can I get some screens of what it looks like when you lower the near plane? I hadn't tested that. The acne/artifacting for the cube shadows is definitely annoying and will get some TLC.


The gaps you see in the parabloid shadows are 'working as intended' though. Not even being snarky. The way it calculates those is by mapping a sphere to two, or even 1 render target(which is the idea behind the 'single pass dual parabloid'. It's really fast, but due to the distortion of the render to make the hemispheres work, you get gapping at the seams.


Those are great for fast lights, like gunfire, but definitely not as idea for permanent lights like lanterns or the like.

Link to comment
Share on other sites

Hi Jeff - of course!


This is the default near plane (0.1):

http://i.imgur.com/oTb829r.jpg


And this is the near plane halved (0.05):

http://i.imgur.com/jCosWnD.jpg


The lighting set up could be better sorry, if you'd like I can retake the pictures in outpost or something.


It's great to hear that the shadows will be getting some work - I would contribute myself but, as I've said, they're far from my strong point :$ I've considered trying to add in nVidia's shadowlib/shadowworks but this would break OGL and DX9. Plus my preliminary attempts were less than successful.

Link to comment
Share on other sites

Wow, that's a STARK improvement. Is your far plane the default value in both cases?


This may give some ideas on where the math is currently going oddball when we go in to fix 'er up.

If you notice any other details or settings that have an impact as you fiddle, by all means, lay it out here, it'll help a lot in narrowing things down.

Link to comment
Share on other sites

  • 5 months later...

So I've finally had a little more time to look at this - I've discovered that by removing overdarkening (lightParams.y) in the shader, the shadow acne seems to have disappeared, but I'm left with overly meek shadows, which makes me question whether it is still there - I just can't see it? The same effect can be seen just by turning overdarkening off in the editor so I don't think I'm really on the right track :/ I tried implementing the shadow filtering other shadow types use but it had no effect on the artefacts.

Link to comment
Share on other sites

Yeah, I'm still thinking that part of it is the depth precision, given that the original shots showed a bring-in on the nearplane. We've been planning to do an inverted depth buffer for 4.0, which should reduce precision issues with a bunch of different things that rely on it such as z-fighting, and I suspect it'd help with this as well. I'll try to take a look at experimenting with that this week to get a start on it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...