Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: suggestion for new algorithm for soft shadows  (Read 10676 times)

startrekfan001

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
suggestion for new algorithm for soft shadows
« on: December 22, 2007, 06:06:05 pm »

i'm not a programmer so this probably makes no sense, however it might be of use.

It just occured to me that to create soft shadows, you might as well render out a hard shadow map, apply gaussian blur to it and then apply the soft map to the scene. this way you get soft shadows too. This method should work much faster as gaussian blur is quite a fast script.

did this make sense?  :D
Logged

startrekfan001

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #1 on: January 01, 2008, 02:54:39 pm »

okay the least thing you guys could do is reply. wether you think its bad or not. just post your toughts.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #2 on: January 01, 2008, 08:20:59 pm »

Hey, startrekfan001!  I've been out of town with almost no web access.  Give me a break!

Image based shadow algorithms (which includes things like yout suggestion) don't look that good and can have some very noticable artifacts.  In some instances it would look fine but unless I get a lot more complicated that simply blurring a non-aa shadow there would be problems like dark smudges near the edges of something that was in front of a shadow, etc.
Logged

startrekfan001

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #3 on: January 02, 2008, 12:37:38 pm »

oh i wasnt talking to you steve, dont worry :) but i know there are lots of people around here who know their way around programming, i kinda expected some reply from them.
too bad it wont work this way. i didnt rly understand the dark smudges but i guess its right, since i got to hear the pro ;-) anyway, thanks for the reply :-)
Logged

Kyle

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #4 on: January 02, 2008, 10:41:18 pm »

could those smudges be avoided with some type of masking? like, by using the depth of field to make sure the shadow doesn't overlap things closer to the camera.

the idea doesn't sound like something that would work, I'm just throwing something out there.
Logged

an8kid

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #5 on: January 06, 2008, 08:59:50 pm »

This process would work in theorie.. but it is hard to implement.
as...
shadows also cast on objects... not just flat floors. (this means if you Gaussian blurred where the shadow falls.. your objects would be blurred.


Logged

cpicon92

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #6 on: January 13, 2008, 10:04:03 pm »

Well, if you were to render the hard shadow as a png image and then blur that and put it back on the image it would still go faster than the current soft-shadow system. I wouldn't mind having it as an option, especially to render movies.
Logged

hihosilver

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1294
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #7 on: January 13, 2008, 10:29:00 pm »

There also has to be blocking out, if you blur the edges they could go over something else.  The theory seems pretty complicated, though I would be interested to know if it'd be fast or shorter.  Still, you couldn't achieve any scattering like in monte carlo shadows.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #8 on: January 14, 2008, 04:32:05 pm »

Hey, everybody, image based soft shadows simply has too many problems.  Yes, it can be done but there are endless ways that it won't look right.  Anything that doesn't consider both the 3d geometry of the scene and the direction of the light hitting each point will have problems.
Logged

BobtheVila

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #9 on: January 14, 2008, 07:37:42 pm »

Actually the image based shadows can work, this masking is done in SilentHill2-4 and DT-Racer, the whole pixel wide halo that's not so annoying.

Actually you could mix both as it's not getting soft shadows, it's getting soft shadows that go soft based on distance. I think you could do both hard and gassious passes and then combine them using alpha destination plus depth detection to make distance determining soft shadows.

A sample version can apply aonly a mere extra sample, then use a gradient object fill-in, they work very well. They leave sharp points sharp and fill the rest in quite well, looking like the high sample version.  It may look smoother then the blending used now too.
« Last Edit: January 14, 2008, 07:40:07 pm by BobtheVila »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #10 on: January 18, 2008, 06:26:55 am »

"the whole pixel wide halo" - so then you agree with me, there would be artifacts even in these limited environmants..

No game has the freedom for object design that Anim8or has.  All games carefully control what you can do so that their rendering tricks are fast and don't show artifacts too badly.  For example, no game has unlimited levels of transparency, or arbitrary 100 million polygon characters.  It's simply not practical on todays hardware.

Please stop posting replies about "my favorite game does this".  Image base techniques are a crude hack.  I'm not going to add them because I don't want to get a continuous stream of bug reports about their shortcommings.
Logged

startrekfan001

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #11 on: January 19, 2008, 11:01:04 am »

i get your point steve ;) great work you're doing here and i'm the last one to complain about it. keep up the good work :)
Logged

cumesoftware

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • Cume Software official website
Re: suggestion for new algorithm for soft shadows
« Reply #12 on: January 19, 2008, 01:46:42 pm »

Well, you can mimic soft shadows by imitating the soft lights behaviour. What distinguish a soft light form a hard light, is that the soft light's light comes from inumerous points very close to each other. Of course we cannot render inumerous points of light, but at least 8 points disposed in a square. The points would emit less light per se, so the overall light can have the same intensity of the equivalent hard light.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: suggestion for new algorithm for soft shadows
« Reply #13 on: January 21, 2008, 11:47:32 pm »

cumesoftware, that's exactly how Anim8or does soft shadows.
Logged