tag:blogger.com,1999:blog-7711027831820077522.post7341294139798351314..comments2018-01-04T00:33:47.570-08:00Comments on Blind Renderer: Optimized Oren-Nayar Approximation Shader CodeAporime Technologieshttp://www.blogger.com/profile/14584602199371891149noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7711027831820077522.post-45196661950368466232012-03-20T16:24:15.594-07:002012-03-20T16:24:15.594-07:00Hi Steve M,
You are right. We initially used a fu...Hi Steve M,<br /><br />You are right. We initially used a full oren-nayar equation for everything, but only character artists ended up using it, so by the time we came up with this approximation, it was mostly used for flattened highlight: our characters already had what we call character fill lights, which provides something similar to rim light, so rim light was not a big concern. Also each character had its own roughness map, which also served as gloss map.<br /><br />So I guess we ended up making an approximation that only works for Space Marine...........Popehttps://www.blogger.com/profile/03943401839650233842noreply@blogger.comtag:blogger.com,1999:blog-7711027831820077522.post-60392642774444102572012-03-20T16:00:07.090-07:002012-03-20T16:00:07.090-07:00Unfortunately, for me, your approximation looks to...Unfortunately, for me, your approximation looks too similar to straight N dot L diffuse lighting to be really useful. Rim lighting (easily seen on a sphere with the view direction matching the light direction) is quite dark with your version, like NdotL, where Oren-Nayar is bright. The highlight area is, however, flattened roughly correctly. <br /><br />I was hoping to use a straight exponent on NdotL to get the flattened effect, however that makes the transition area between light an dark too abrupt, and it doesn't really provide a rim light either... Of course it's also not energy conserving as is, which would be an issue if you wanted to drive diffuse roughness by a texture. <br /><br />Steve MAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7711027831820077522.post-66712387259509189452011-11-17T11:52:34.846-08:002011-11-17T11:52:34.846-08:00Ryg has a mathematically correct way to eliminate ...Ryg has a mathematically correct way to eliminate texture lookups. Use his way, if you want mathematical correctness.<br /><br />See middle of the post, where it shows alpha, beta, C variables<br /><br />http://fgiesen.wordpress.com/2010/10/21/finish-your-derivations-please/<br /><br />p.s. Our approximation might be still faster since it also eliminates bunch of divisions. (well only if it turns out to be your bottleneck)Popehttps://www.blogger.com/profile/03943401839650233842noreply@blogger.com