benbeshara Posted April 25, 2016 Share Posted April 25, 2016 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. Quote Link to comment Share on other sites More sharing options...
benbeshara Posted December 10, 2016 Author Share Posted December 10, 2016 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). Quote Link to comment Share on other sites More sharing options...
JeffR Posted December 12, 2016 Share Posted December 12, 2016 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. Quote Link to comment Share on other sites More sharing options...
benbeshara Posted December 13, 2016 Author Share Posted December 13, 2016 Hi Jeff - of course!This is the default near plane (0.1):http://i.imgur.com/oTb829r.jpgAnd this is the near plane halved (0.05):http://i.imgur.com/jCosWnD.jpgThe 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. Quote Link to comment Share on other sites More sharing options...
JeffR Posted December 14, 2016 Share Posted December 14, 2016 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. Quote Link to comment Share on other sites More sharing options...
benbeshara Posted December 14, 2016 Author Share Posted December 14, 2016 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 :) Quote Link to comment Share on other sites More sharing options...
benbeshara Posted May 22, 2017 Author Share Posted May 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
JeffR Posted May 22, 2017 Share Posted May 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.