Skip to content

Instantly share code, notes, and snippets.

@hiko9lock
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiko9lock/11342282 to your computer and use it in GitHub Desktop.
Save hiko9lock/11342282 to your computer and use it in GitHub Desktop.
ShaderFX Custom Code sample for Maya 2015, maya LT
struct CustomCode1245Output
{
float3 color;
};
CustomCode1245Output CustomCode1245Func( float2 UV )
{
CustomCode1245Output OUT;
float3 output= float3(0.0, 0.0, 0.0);
float dist= 0.004;
int radius= 4;
for( int i= -radius; i< radius; i++ ) {
for( int j= -radius; j< radius; j++ ) {
output+= tex2D( SFX_SAMPLER0, UV+float2(i*dist, j*dist)).xyz;
}
}
OUT.color= (output/((radius+1)*(radius+1)));
return OUT;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment