More accurate point-light shadow rendering?

Materials, textures, lighting, postfx
8 posts Page 1 of 1
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Mon Apr 25, 2016 6:37 am
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.
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Sat Dec 10, 2016 9:22 am
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).
JeffR
Steering Committee
Steering Committee
Posts: 740
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Dec 12, 2016 9:48 pm
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.
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Wed Dec 14, 2016 12:39 am
Hi Jeff - of course!

This is the default near plane (0.1):
Image

And this is the near plane halved (0.05):
Image

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.
JeffR
Steering Committee
Steering Committee
Posts: 740
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Wed Dec 14, 2016 4:33 am
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.
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Wed Dec 14, 2016 5:19 am
Yeah, changing the far plane value didn't seem to make much of a difference to the final image - if anything else comes up while I'm playing with it I'll note it down here for you guys :)
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Mon May 22, 2017 7:42 am
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.
JeffR
Steering Committee
Steering Committee
Posts: 740
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon May 22, 2017 3:48 pm
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.
8 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests