kensonuken Posted March 4, 2009 Share Posted March 4, 2009 Im trying to build a custom light vop and started to build one.. I request you guys to help me out in building this light vop... I will be uploading the hip files.. Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 4, 2009 Author Share Posted March 4, 2009 Im trying to build a custom light vop and started to build one.. I request you guys to help me out in building this light vop... I will be uploading the hip files.. This is the shader which im trying to build light pointlight( float intensity = 1; color lightcolor = 1; point from = point "shader" (0,0,0); float decay = 2.0; ) { illuminate( from ) { float distance_squared = L.L; if( decay == 2.0 ) { Cl = intensity * lightcolor / distance_squared; } else { Cl = intensity * lightcolor / pow(distance_squared, 0.5 * decay ); } } } Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 4, 2009 Author Share Posted March 4, 2009 Im not able to find the illuminate node in vop ... how do i move further? Quote Link to comment Share on other sites More sharing options...
Jason Posted March 4, 2009 Share Posted March 4, 2009 Im not able to find the illuminate node in vop ... how do i move further? In VEX you dont need it. Why not check out the source code the VEX Light SHOPs and learn from those? There is so much info right there. Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 4, 2009 Author Share Posted March 4, 2009 (edited) yeah jason I know but I want to make lots of additional functions which i feel better to build it using vops and add them quickly. As of now I have only one thing to add to the existing light shaders thats projecting the UV texture over the object and render them into saparate pass for each light.. I dont know if things can work like taking Cl and multiplying with uvs or howz the solve this problem... I dont want to use some rendered texture and plug it in the light node but to generate it procedurally so that It will not generate any sub pixel artifacts during the interpolation... Edited March 4, 2009 by kensonuken Quote Link to comment Share on other sites More sharing options...
Jason Posted March 4, 2009 Share Posted March 4, 2009 What I mean is to learn from VEX function set, the language structure from the VEX source code, particularly how it differs from RSL - and then build it in VOPs like you want it. If you look through the Light shaders in VEX, you'll see that there are no illuminate constructs in there. It seems like you're running before you're walking. There is some fundamental groundwork you need to know before building some of these shaders. Quote Link to comment Share on other sites More sharing options...
Jason Posted March 4, 2009 Share Posted March 4, 2009 Hey Kensonuken, Did you manage to get something going? Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 5, 2009 Author Share Posted March 5, 2009 yeah I saw the sample shader code in the shop I understood how it works and Im trying to plug UV map (procedural). I am a bit confused.. it should be multiplied by Cl but I want to take that out as another pass called Proj so im thinking to write that out as some Proj = Cl * Uvmap just getting confused how to code this... Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 7, 2009 Author Share Posted March 7, 2009 i could build this shader but this is showing only the UVs of the object instead of just a uv projection streching across the cone angle... light light1() { float amount; vector vec; float amount1; vector vec1; vector sum; // Code produced by: ramps1 float ss; vop_bindS(ss, s, 1); ss = ss*1 - 0; if (1 != 0) amount = vop_TentTrain(ss*.5, 1*vop_FilterWidth(ss)); else amount = vop_RampTrain(ss, 1*vop_FilterWidth(ss)); // Code produced by: floattovec1 vec = vop_floattovec(amount, amount, amount); // Code produced by: ramps2 float ss1; vop_bindS(ss1, t, 1); ss1 = ss1*1 - 0; if (1 != 0) amount1 = vop_TentTrain(ss1*.5, 1*vop_FilterWidth(ss1)); else amount1 = vop_RampTrain(ss1, 1*vop_FilterWidth(ss1)); // Code produced by: floattovec2 vec1 = vop_floattovec(amount1, amount1, amount1); // Code produced by: add1 sum = vec + vec1; // Code produced by: output1 vector tempCl = sum; Cl = tempCl; } Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 7, 2009 Author Share Posted March 7, 2009 here is the output... Quote Link to comment Share on other sites More sharing options...
kensonuken Posted March 7, 2009 Author Share Posted March 7, 2009 I am trying to get this kind of look just to project UV map.. Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted April 14, 2009 Share Posted April 14, 2009 I am trying to get this kind of lookjust to project UV map.. To make a projector light, you just need to wire Ps into a Transform VOP, and change the space to "space:lightndc", the x/y components are what you want. 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.