Monday, March 24, 2014

Building a Panner from scratch

I recently learned about plugging textures into the UVs of other textures to distort them and that got me thinking about how the panner and rotator nodes work. The panner was simple enough, it's just constantly adding a value that's offset by the ramps in either channel of the TexCoord node. The 2 vector constant acts as the Speed X and Y for the panner. The only trick is that Time outputs a scalar value and needs to be appended to itself to be multiplied with the 2 vector constant.
At first this may seem useless beyond understanding the node (like many of my previous breakdowns) but it actually has applications. I helped Dylan improve his electricity particle by using this panner with a noise texture for the speed instead of a 2 vector constant.
I'm still working on the rotator node and luckily there's a material  function called Custom Rotator that I think will help me figure it out. I just don't have time right now. (Plugging Time into the rotation angle gets a constant rotation, I just need to figure out how the math inside the function works.)