sbjones25 Posted September 15, 2008 Share Posted September 15, 2008 So i was doing some research and found an awesome tutorial on how to do light wrapping with in a shader: http://www.andynicholas.com/thezone/index....7&curpage=0 and i was thinking that it would be more beneficial to have this feature on a per-light basis. only thing is that it's within the material shader, not light. i was wondering if anyone had any ideas on how to go about doing that based on this tutorial above. i was thinking about being able to add each light via a + sign on the material's shader, or perhaps maybe a light shader that can control this. if you wouldn't mind posting the file if you get it so i can check it out and figure out how it could be done... maybe...??? Here is the tutorial done if you're like me and don't want to have to do the tutorial to give an attempt. Sorry about the NC file. Thanks for any help! Quote Link to comment Share on other sites More sharing options...
sbjones25 Posted September 15, 2008 Author Share Posted September 15, 2008 Oops... forgot to hit the upload button... sorry. HAHA lightwrap.hipnc Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted September 16, 2008 Share Posted September 16, 2008 Since you already got a solution from Andy, and this is just a "wouldn't it be nice if" situation as opposed to a "the project will crash and burn without it" situation, I'll just give you a (large) hint: The way to do it in a light shader is to bend the light's direction (L, given by the standard calculation for the particular kind of light you're writing) toward the surface normal (N) at some rate that is proportional to the cosine of the angle between the two. And let the user control both this rate and the overall amount of bending. Warning: shadow maps don't play nicely with this kind of hackery. Cheers! Quote Link to comment Share on other sites More sharing options...
jason_slab Posted September 16, 2008 Share Posted September 16, 2008 have you guys had a look at the specular sheen vex node yet? it's quite interesting, does a kind of light wrapping at shader level jason Quote Link to comment Share on other sites More sharing options...
kensonuken Posted November 28, 2008 Share Posted November 28, 2008 I tried with values like 270 degrees and value from -.99 to 5 but the output is not looking and the terminator is not going beyond 180 degrees... can anybody tell me what could be the fault? Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted November 29, 2008 Share Posted November 29, 2008 I tried with values like 270 degrees and value from -.99 to 5 but the output is not looking and the terminator is not going beyond 180 degrees... can anybody tell me what could be the fault? There is a data flow issue in that hip file. You shouldn't feed the output of the light wrap illuminance loop into the diffuse of a Lighting Model VOP. I posted a tweaked version which should behave correctly. lightwrap_tweaked.hipnc Quote Link to comment Share on other sites More sharing options...
kensonuken Posted November 29, 2008 Share Posted November 29, 2008 thank you it works... Now can u tell me do this works for faking ambocc? using multiple lights with shadows? Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 12, 2011 Share Posted September 12, 2011 Thanks for this post guys. Need a little more time to understand this stuff completely so I don't break everything when implementing it, but very, very helpful. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.