Kristen Eggleston
  • Demo Reel

C++ Plugins

3/6/2013

 
Picture
While it can do many things, RSL is limited by the language. To enhance its functionality, one can implement a plugin using Pixar's RSLPlugin C++ API. For a sub-set of micropolygons my plugin writes RiCurves into an archive rib file that is referenced by a later beauty pass render. There are, therefore, two passes. The first creates moss-like geometry via my C++ plugin and must only be done once, the second generates the final image. For information on how to implement an archive rib, look here.


Picture
I tried to bake in the lighting into the rib file. Unfortunately this gave extraordinary values like color(126, 100, 50).

Picture
Applying a shader to the curves fixed the problem of trying to pre bake the colors into the moss. This way the plugin generated random variations of the user inputed color and then the shader on the geo container that is reading in the rib archive (how to do that here) takes care of the lighting.

mossgen.sl
File Size: 1 kb
File Type: sl
Download File

mossgenplug.cpp
File Size: 6 kb
File Type: cpp
Download File

perlin.h
File Size: 3 kb
File Type: h
Download File

One Shader, Many Looks

2/20/2013

 
Picture
With Renderman in Maya, one is able to change a texture map or an attribute based on the name of the object it is applied to. In Houdini, this is done on the material node by adding local overrides. The user can alter any attribute on the chosen shader based on a group or on a stamped copy number.

Be careful when changing texture maps. These are passed in a strings rather than floats or integers so proper formatting is key:

          `"/path/to/file/filename" + number + ".tex"`

Now the user can alter the number so that filename1.tex, filename2.tex, and filename3.tex are all accessible by the same shader and material node leading to quicker render times!
Picture

Changing Coordinate Space Based on a Null Object

2/15/2013

 
This is for Houdini. It turns out that you can very easily map a shader attribute to a null object's position in reference to a point on the object. You could use this for making frost grow on an object.

Pass in the object's name as a string, "/obj/null1".

Measure the distance from the point to the origin of the null.


         // Makes a point in object space, not
// passed in as (0,0,0) because it is
// automatically converted to object space
point fs = point "object" (0,0,0);

// Transforms the point to null space
fs = transform("/obj/null1", fs);

// Calculates the distance from point to point
float d = distance(fs,transform("shader", P));
Make a ramp based on that distance to change whatever attribute.
        influence = smoothstep(0 + rampSize, radOfInfluence, d);
If you are having difficulties getting the null or whatever object you are using to be recognized by the shader, check the name you are passing in. The easiest way to do this with a null is to check the only default checkbox in the render tab which allows the null to be written to a rib file. Then force the ROP to create a disk file and search the disk file for that string name.

Also note that when entering the name into the field in the shader, double quotes are unnecessary and will break your render. Just enter the name of the object: /obj/null1

    Categories

    All
    Accidents
    Cool Tricks
    Houdini
    Shaders

    Archives

    March 2013
    February 2013

    RSS Feed

Proudly powered by Weebly