Texture Instancing ShaderMad props to Paul Smith aka pooby for inventing this wonderful method. If you haven't already, check his vimeo videos page for loads of ICE inspiration. Btw Paul's first video introducing the method is here: http://vimeo.com/33908339
Since, he's added 2 videos demonstrating this shader: https://vimeo.com/56627504 and https://vimeo.com/56762083. Cheers!How it works
Basic function of this shader is to stamp an instance of the selected texture at each particle location on the shaded object. Usage
Shader setup is really simple. Basically you only need a point cloud and an object that share the same material.
For a quick test do the following: Create a new scene, create polymesh sphere, create point cloud sphere, plug "Texture Instancing" into Scene_Material's surface port. Open the shader's PPG, pick the point cloud, then the noicon.pic texture, render.
Now all texture instances are oriented upwards. This is because of the chosen rotation method ("Custom Vector" at 0,1,0). You can enter a different orientation vector here, or use a tangent property. Another option is to have each particle have a texture orientation vector of its own, which has to be created as a point cloud attribute using ICE (See example scene posted below).
Usually for heavily randomized texture instances (like pebbles, sand etc.), using custom vector or tangents will be enough. For "flow" type setups with ICE, the third option has to be used.
To show different bits of the same texture, as Paul did in the first video, you'll have to scale up the texture quite a bit, and use random position offsets. If you see uniformly colored parts appear, try the "wrap" option.
Some notes to sum this up:
Only for mental ray, but with rendermapping the result will be usable in other renderers too.
Make sure the point cloud has a shared material as the textured object (Same material is not enough)
ICE attribute vectors get projected on the surface, and used as the Y up axis for the stamped texture. Ideally the vector attribute would be parallel to textured surface, otherwise there'll be a little distortion (which is true for the other methods, custom vector and tangents, as well)
I hope it works for you! report bugs and crashes and post pretty pictures as usual ))
V1.2 has an option to add roughness to the cell borders/blend them + added commentary inside the compound
V1.3 has Scale X and Scale Y exposed separately and also has closest particle position exposed as an output.
V1.4 bug fix. shearing occured when using different X and Y scales and rotation. Now Tex Size and Offsets are in SI Units, so your values might need to be a little different.
V1.4 bug fix. Didn't work with SI 2012 (which has an older Edit UV node)
V1.5 ability to read offset from an ICE attribute, PPG UI a bit reorganized