A VEX surface shader using the modulus function.
Math and shader language!
Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Thursday July 31st, 2008 03:33 PM

VOPs vs. VEX?
You can achieve the exact same things with both worlds!


Script is below, along with the file.
#pragma hint prim color
#pragma hint sec color
#pragma label prim "Primary Color"
#pragma label sec "Secondary Color"
#pragma range freq 10 20
#pragma label freq "Frequency"
surface
v_modulus(float freq=10; vector prim={1,0.7,1}, sec={0.3,0.3,1})
{
float ss = s*freq%1;
if ( ss < 0.5 ) {
Of = 0;
} else {
Of = 1;
}
vector n = noise(s*10,t*10);
n = lerp(prim,sec,s);
// uncomment this to set the green channel from 0 to 1
//setcomp(n,lerp(0,1,s),1);
Cf = n * Of;
}
Downloads:
Download: modulus.hip 232 KB
Download: modulus.vfl 565 B
Please login or Click Here to register for downloads
Modulus by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com
