Mason opened this issue on Dec 17, 2003 ยท 14 posts
Mason posted Wed, 17 December 2003 at 4:06 PM
Does anyone know how to blur the ray traced shadows? I know how to do it with the shadow maps. Thanks
millman posted Wed, 17 December 2003 at 4:20 PM
I would imagine it could be done with a multiple array of lights, each from a slightly different position, and with varying intensities, the "core" of the array being the brighter. Don't think it would do good things for the render time though.
stewer posted Wed, 17 December 2003 at 5:58 PM
Short answer: You don't. Ray tracing makes hard shadows, shadow maps make soft shadows. You can play a little with the shading rate of the shadow receiving object, but that's about it. Long answer: Ray traced shadows work on a simple yes/no principle. For every point shaded, the ray tracer answers the simple question "Can I see the light from here?", determining wether or not the point will be bright or dark. Since the lights in Poser are point-sized, there is no "I can see parts of the light" answer, it's straight yes or no - shadow or no shadow. Then there are algorithms to do soft ray-traced shadows, sometimes called area lights or area shadows (Poser 5 does not do that, so this paragraph is about how other programs create soft ray traced shadows). These simulate a non-point sized light source, by pretending there was a finite number of point sources distributed over a certain area. That way, the answer to the question "Can I see the light?" would be "you can see 4 out of 10 points of the light source." Unfortunately, replacing one point-sized light source with, say, 16 point sized light sources has unwanted consequences: Obviously, it'll take 16 times as long to calculate that shadow. Furthermore, the answer is "you can see n points", with n being a number between 0 and 16 - leaving you with 17 levels of "shadow", which will result in visible edges - you'd need around 200 different levels to make the the edges disappear, which would take 200 times as long to render. In order to avoid that, people had the idea of "jittering" the sample points, which would replace edges or aliasing, as it is often refered to, with noise. Noise is something the human eye is much better at ignoring than aliasing, with one exception: Animation. If you use jittered samples to create soft shadows in an animation, the noise will create ugly flickering. So, the bottom line still remains: For soft shadows in Poser, use shadow maps.
mateo_sancarlos posted Wed, 17 December 2003 at 7:22 PM
O.K. sounds good - but how do we use shadow maps to make soft-edged shadows? Is it like Poser 4 - low map size?
Mason posted Wed, 17 December 2003 at 7:30 PM
Yes low map size. The shadow maps in P5 are the shadows from P4 so whatever you do in P4 works in P5. I wasn't sure if P5 raytrace had a softening algorythm which I guess it doesn't.
Khai-J-Bach posted Wed, 17 December 2003 at 9:02 PM
ok..in tS I normally use a mix of raytracer lights and shadowmapped lights.. can you do the same? (not a p5 user) the mix gives the hard core of the shadow (raytraced) and the soft blurred edge (the mapped shadow)..
nerd posted Thu, 18 December 2003 at 12:03 AM Forum Moderator
No, you wouldn't normally mix them. In P4 you could make a reeealy soft shadow by using several lights like you do with a P5 to soften ray traced shadows. In P5 adding a bunch of lights with raytraced shadows dowsn't hit render times nearly as bad as a bunch of shadow mapped lights. I have a light setup that uses 12 spots in a cluster to create a soft raytraced shadow. I it renders faster than a shadow mapped light with a 2048 map. Poser 5's Mapped lights have a "Shadow Blur Radius" property that controls shadow softness directly. You don't need to fudge it with a low map resolution. That way you can use a high rez shadow map (So the shadows connect to the feet) and still get a soft shadow. Nerd
stewer posted Thu, 18 December 2003 at 1:14 AM
2048 shadow maps are extremely large - if you need to go that high, you should check if your shadow lite cams are adjusted wrong. As I wrote in a previous thread, a 2048 shadow map will take 64 times the RAM and 64 times as long to render than a 256 shadow map. In Poser you have the "Shadow Blur Radius" to adjust how sharp/smooth your mapped shadow is.
stewer posted Thu, 18 December 2003 at 1:27 AM
Attached Link: http://www.cgtalk.com/showthread.php?s=&threadid=105752
E.g. this would be a 128x128 shadow map with a blur radius of 5.jwbaer posted Thu, 18 December 2003 at 8:41 AM
-Jeremy
jwbaer posted Thu, 18 December 2003 at 8:45 AM
jwbaer posted Thu, 18 December 2003 at 8:50 AM
stewer posted Thu, 18 December 2003 at 9:42 AM
Yes, Python should give you access to that. When still working for Egisys, I added the new light properties to the Python interface in SR3, so you should be able to script most if not everything about lights. You can use the documentation.py script to have Poser give you an updated function description.
jwbaer posted Thu, 18 December 2003 at 12:21 PM
I guess another way to do something similar to what I've done here is to duplicate each light and set one copy of each light to raytrace and one copy of each light to shadow map. Then you get a shadow-mapped shadow overlaying your raytraced shadow within a single render. In a quick test, that doesn't produce quite as nice of a result as blending the two different renders on one's own, but would be a little easier to automate, and does look better than either just raytraced shadows or just mapped shadows, at least in an image like the one above. Raises the render time, of course.