Last active
August 29, 2015 14:00
Revisions
-
hiko9lock revised this gist
Apr 27, 2014 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,3 @@ struct CustomCode1245Output { float3 color; -
hiko9lock renamed this gist
Apr 27, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hiko9lock created this gist
Apr 27, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ // You may add new struct outputs, function inputs and adjust code in the function. // Function name and output struct should match 'Function Name' attribute on node. // Available preprocessor definitions: SFX_HLSL_3, SFX_HLSL_5, SFX_GLSL_1_2, SFX_GLSL_4, SFX_CGFX_3, _MAYA_, _3DSMAX_, SFX_SWATCH // You can use SFX_TEXTURE[n] or SFX_SAMPLER[n] to refer to texture inputs so you do not have to hardcode their names 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; }