Announcement
Collapse
No announcement yet.
Last of Us style indirect shadows
Collapse
X

Last edited by Jhosep_Chevarria; 05292015, 10:45 PM.The Virtual Photographer, welcome to my world!
AQP City, Open World GameMy Artstation: Click me!
*AQP City Fan page
*AQP City on Indie DB

Properly implementing this got a bit bigger then I initially thought so to be honest I haven't really been able to work on this much further. Additionally I noticed some work on surfelbased shadowing in the main source github, which might solve a similar issue, so I kind of focused on other things.
I'll see if I can clean up the prototype and post the source here if someone else would like to attempt to create something more useful with it.
@RyanB: The images posted here used the lookup texture from the Naughty Dog presentation as I wanted to get the basics working first. My plan was to make a simple maxscript to automate the baking. Shouldn't be to hard as you can basically bake a small coverage texture per pixel and store the average.
Comment

Hey guys, if anybody is curious to mess with this I made a material that can be used to render out the soft shadow lookup textures that are similar to the last of us paper (although not exactly).
The core of the math is in this custom node with inputs d, r0, r1:
Code:float div1=cos(d)(cos(r0)*cos(r1)); div1/=sin(r0)*sin(r1); float div2=((1)*cos(r1))+(cos(d)*cos(r0)); div2/=sin(d)*sin(r0); float div3=((1)*cos(r0))+(cos(d)*cos(r1)); div3/=sin(d)*sin(r1); float term=(2*PI)(2*PI*cos(r0)); term=2*PI*cos(r1); term=2*acos(div1); term+=2*cos(r0)*acos(div2); term+=2*cos(r1)*acos(div3); return term;
Notice that the only modifiable variable still hooked up is the light cone angle. So you render multiple textures with various light cone angles and channel pack them and lerp between them to adjust the penumbra in realtime.
All cosine nodes have a period of 2pi so that they work the same as the custom one ones. Also notice all the starting degrees get converted to radians which makes it easier. And the UVs need to be given sphere like curvature which is why there is cosine on the UVs.
https://www.cse.ust.hk/~psander/docs/aperture.pdfAttached FilesLast edited by RyanB; 06052015, 04:11 AM.Ryan Brucks
Principal Technical Artist, Epic Games
Comment

Comment