evgen Posted March 21, 2012 Share Posted March 21, 2012 Hello. I have the problem with using ramp parameter in vex. What code should i use for get it works? Seems that i need to use spline() with a few arrays of values, as in the help, but compiler gives me a lot of errors with it. How i need to use spline function for this? Thank you Quote Link to comment Share on other sites More sharing options...
symek Posted March 22, 2012 Share Posted March 22, 2012 (edited) You would have to be more specific about errors, but generally, since ramps are tedious to setup, what I usually do is that I copy code from any of SESI shaders with ramps . ASAD light for example: /* * PROPRIETARY INFORMATION. This software is proprietary to (...) #pragma ramp_rgb atten_ramp atten_basis atten_keys atten_values #pragma parmtag atten_ramp rampbasisdefault linear #pragma parmtag atten_ramp rampshowcontrolsdefault 0 #pragma parmtag atten_ramp rampcolortype rgb (...) vector eval_ramp(float t0; string basis[]; float keys[]; vector values[]) { return spline(basis, spline("linearsolve", t0, keys), values); } (...) string atten_basis[] = {"linear", "linear", "linear"}; float atten_keys[] = {0.0, 0.9, 1.0}; vector atten_values[] = {{1,1,1}, {1,1,1}, {0,0,0}}; (...) Cl *= eval_ramp(key, atten_basis, atten_keys, atten_values); Edited March 22, 2012 by SYmek 1 Quote Link to comment Share on other sites More sharing options...
evgen Posted March 22, 2012 Author Share Posted March 22, 2012 Thanks SYmek. Thats correct, i found this solution after posting this thread) Maybe sombody find this information useful too. Thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.