Wed, Nov 27, 3:22 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 26 1:43 pm)



Subject: Blurred shadows with ray traced shadows...how?


Mason ( ) posted Wed, 17 December 2003 at 4:06 PM · edited Wed, 27 November 2024 at 3:21 AM

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

file_89332.jpg

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

file_89333.jpg

The problem with using shadow-mapped lights is that in some cases, you need ray-traced shadows. For example, in the image above, it would be impossible to get those wine glass shadows using shadow maps, because they depend on the fact that we are ray tracing through the glass material. The image above actually uses the following technique: render the exact same image twice -- once with all lights set to shadow mapped shadows and the second time with all lights set to raytraced shadows. Then blend the two images in photoshop or similar image processing app. That way you can get the benefits of raytraced shadow accuracy, but soften them by blending with the shadow-mapped shadows. It's a little more work, but if you have some transparent materials like in this image, it can make a difference.

-Jeremy


jwbaer ( ) posted Thu, 18 December 2003 at 8:45 AM

file_89334.jpg

For comparison, here is the same image straight from the renderer with ray traced shadows only.


jwbaer ( ) posted Thu, 18 December 2003 at 8:50 AM

file_89335.jpg

And here it is with shadow maps only. Neither gave the result I wanted straight from the renderer. The blend I did was actually really quick and dirty -- a little more time spent could probably produce better results. Stewer, do you know if there is enough Python access to the lighting system in P5 to acutally automate this in a script? I could go look myself, but since you were writing a lot of the later python extension methods, I thought you might know off the top of your head. Might be fun to play with, anyways :)


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.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.