Heya people, how you doing?
I was taking a gander on some materials from the Source engine, and came across this line:
$FRESNELWARP "fresnelranges"
From what I understood, it's basically a textures that wraps around the model, but with a Fresnel as it's feed? Although I'm not too sure about it.
I also tried looking for the written shaders, but cannot find them, so if anyone has any idea what I need to do, that would be grand.
Replies
I'm not 100% sure though. Test it out!
Here is what I mean:
Just to be clear, you code worked perfectly fine with the Fresnel Warping lookup texture, so much kudos for that.
In the document, it's also talking about a warp color texture, which is supposed to be related to the Fresnel Warp, but I have no idea what it is and my google-fu in said terms is coming up empty.
If you (or anyone else) have hints on what it could be, that would be very much appreciated, because I'm honestly lost on what a 3D Texture which looks like a UV Map is supposed to be or if I'm reading too much into it and it's infact a simple XYZ projection.
Cheers!
*edit* a buddy if mine has a cool implementation of this, has a neat trick for smoothing it out. http://blog.legend286.co.uk/lightwarps/
here's how the code should be all-together
The effect is most likely an artistic accentuation of the silhouette. The mask seems to support both effects, the light warp and the color fresnel term.
vec3 textureColor = tex2d(modelTexture, uv);
float fresnelMask = tex2d(fresnelTexture,uv);
vec3 warpedColor = tex3d(warpTexture, textureColor.rgb);
float fresnelTerm = calculateFresnelTerm(viewVector,normalVector);
float alpha = fresnelTerm * fresnelMask ;
vec3 finalColor = alpha * warpedColor + (1-alpha) * textureColor;
Exact same question I had.
Is it basically to drive the color of the fresnel?
EDIT: Duh... just read valve's pic. lol
proceed.....