Created
October 18, 2012 13:06
-
-
Save stoyannk/3911679 to your computer and use it in GitHub Desktop.
Simple atoms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atom NORMAL_W NormalFromInput(interface context) needs NORMAL_O | |
{ | |
return mul(context.normal_o, World); | |
} | |
atom NORMAL_W NormalFromMap(interface context) needs NORMAL_O, UV, TBN, MAP_NORMAL, SAMPLER_POINT | |
{ | |
float3 normal = map_normal.Sample(sampler_point, context.uv); | |
normal = mul(normal, context.tbn); | |
normal = normalize(context.normal_o + normal); | |
return normal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment