LPXO Posted June 6, 2005 Share Posted June 6, 2005 Hi, Im trying to build an illuminance loop in VEX based on user jasons "thin" shader in the codex (http://www.odforce.net/codex/?page=3&sec=all&catlimit=&sorty=&limit=5) to allow my shader to accept light form behind the surface. So im replicating this line in an illuminance loop: dclr += - ( Cl * dot(Nf, Ll) * trans_factor * translucency * diff); Ive attached a screenshot of my illuminance loop. Im not getting any kind of result from this. Can anyone give me a hint as to what im missing? Thanks. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 6, 2005 Share Posted June 6, 2005 Hey there, The easiest way to to this is: N --- Normalize +--- Lighting Model ----------------+ | | +--- Negate ----- Lighting Model --+ Add --- Output Basically, add in lighting based on a flipped (negated) surface normal. Quote Link to comment Share on other sites More sharing options...
LPXO Posted June 6, 2005 Author Share Posted June 6, 2005 Thanks Jason. Id already tried that but wasn't quite getting the effect i was after. I was hoping to soften the light on the surface of my object (thin membrane) by making it have a subtle diffuse "glow" that appeared to come from behind. Since i wasnt sure the best approach for this I was trying a few different things. Ill play around with using negated normals and see if i can get a more desirable effect. Thanks for the reply. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 6, 2005 Share Posted June 6, 2005 Sounds like you're talking about Subsurface Scattering - have you tried Mario's SS shaders? Quote Link to comment Share on other sites More sharing options...
LPXO Posted June 6, 2005 Author Share Posted June 6, 2005 Yeah, thats exactly what Im talking about except since it's for an assignment I need to write the shader myself! Ive been trying to cheat it and to be honest the best results ive got are rendering off what's behind my membrane as a seprate layer and doing the translucency in Shake. I have read through Mario's SSS thread and checked out the shaders and it is really cool. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 6, 2005 Share Posted June 6, 2005 Ah, I see. You can do a really interesting faking of sub-surface diffuse scattering by baking off the illumination and blurring it and then re-applying it to the surface. There are several caveats for this though: *1* it won't help the thin-film case - since the blurring happens in texture uv space - and *2* it requires nice uv's which approximate real-world distances. I might be able to find an example of this for you if you like - you can acutally do this at interactive speeds... This said, it's not going to solve the single-scattering case (thin-film like) for you, but the concept might give you ideas. Quote Link to comment Share on other sites More sharing options...
LPXO Posted June 6, 2005 Author Share Posted June 6, 2005 Yeah thats another area I looked into (I think I found that on the Wiki) but didn't make progress on testing it fast enough with my deadline looming so I had to try other methods. Even with the drawbacks I was still interested to see the results. If you have an example somewhere Id love to see it. Thanks. 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.