Skip to content

Instantly share code, notes, and snippets.

@stoyannk
Created October 18, 2012 13:06
Show Gist options
  • Save stoyannk/3911679 to your computer and use it in GitHub Desktop.
Save stoyannk/3911679 to your computer and use it in GitHub Desktop.
Simple atoms
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