Jump to content

Accepting Light From The Back Of An Object


Recommended Posts

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.

post-882-1118069819_thumb.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...