Friday, 13 June 2014

UV particles via SOuP

Here is a small SOuP technique for producing a plane of particles with a UV gradient on their RGB.

First you need a plane, then emit some particles from that plane. Make sure that the particles have the rgbPP attribute available as we will need to put an expression on it.

Create a SOuP TextureToArray node
Create a SOuP rgbaToColorAndAlpha node
Create two ramp texture nodes - ramp1 is black to red along U, ramp two is black to green along V

Connect the following:

ramp2.outColor -->  ramp1.colorOffset
ramp1.outColor --> textureToArray1.inColor
polyPlaneShape.worldMesh[0] --> nParticleShape.inputGeometry
polyPlaneShape.worldMesh[0] --> textureToArray1.inGeometry
textureToArray1.outRgbaPP --> rgbToColorAndAlpha1.inRgbaPP 

Also connect the emitting plane's transform node to the particle's transform node as shown in the node graph.



Now set the rgbPP using the creation expression:

rgbPP=rgbaToColorAndAlpha1.outRgbPP

Rewind and step forward one frame so that the particles are emitted. Then set their initial state and disconnect the emitter and the connection between polyPlaneShape.worldMesh[0] --> nParticleShape.inputGeometry





The particles will now be dynamic again.


In Nuke, plug in your rendered particles into the STMap node as shown in the image below


No comments:

Post a Comment