Its a circus out there

2009

Shops

Home VOPs SOPs DOPs COPs POPs ROPs Expressions OSTips Shops Tools Lighting Python Pclouds HOT About

Bio Showreel GalleryHoudini.htmlVops.htmlSops.htmlDopsMain.htmlCops.htmlBlank.htmlRops.htmlExpressions.htmlOSTips.htmlTools.htmlLighting.htmlPython.htmlPointClouds.htmlHotOceanTookkit.htmlAbout.htmlBio.htmlShowreel.htmlGallery.htmlHoudini.htmlshapeimage_1_link_0shapeimage_1_link_1shapeimage_1_link_2shapeimage_1_link_3shapeimage_1_link_4shapeimage_1_link_5shapeimage_1_link_6shapeimage_1_link_7shapeimage_1_link_8shapeimage_1_link_9shapeimage_1_link_10shapeimage_1_link_11shapeimage_1_link_12shapeimage_1_link_13shapeimage_1_link_14shapeimage_1_link_15shapeimage_1_link_16shapeimage_1_link_17shapeimage_1_link_18
 

Strip Gamma From texture Maps

Use a power vop with a constant plugged in and the float value set to 1/ 0.454545 . This will then strip the gamma value off the incoming texture file. keeping your renders in linear space. remember in Mplay to set your gamma to 2.2

Shader Terms Tips


Ambient Occlusion shader :-

  1. maximum intersect distance :- , is the max distance a ray fires from a point

  2. sampling angle :- controls the spread of the occlusion

Shader Overides At The Object Level


Notes :-  

One shader lots of objects but you want variation in the specular values. 


Each object gets the shader applied in the material parameter. Select the small arrow top right corner. Select from the list “select and create local material parameters . You get the parameter promoted to the object level, ready for the overide. repeat for all the objects.


Expression added to the spec parameter for each object. 


fit01(rand(opdigits(".")) , 0.01, 0.2)   


opdigits used to generate a seed value > extracting the numerical number form the object name. If you wanted to randomise the diff map you could use something like


butterfly`floor(fit01(rand(opdigits(".")) , 1, 7))`.pic


scene file :- rse_sop_randspecvalue.hip

Occlusion VOP with a Cone Angle


Notes :-  

Occlusion VOP. The difference is this one use a cone angle and therefore can also be used for reflection occlusion.


scene file :- rse_shader_0ccRflVop.hip

scene file :- rse_rflOccVop_v001.otl


Environment light shader


Notes :-

 

One from the days of Houdini 9.5. This is an light shader that has more functionality than the old vex gi light. 

code below contained in a light shader


/**********************************************

*

* Special thanks to Mario Marengo for all

* his help

*

* Built by Robert East

*

*

*

*

* Name  Void Occlusion Shader v1.1

*

*/


#include <math.h> 

#pragma label intensity  "light Intensity"

#pragma hint skycolor   color

#pragma hint grndcolor  color

#pragma label grndcolor  "Ground Color"

#pragma label htype "Horizon Type"

#pragma choice htype "lramp" "Linear Ramp"

#pragma choice htype "sramp" "Smooth Ramp"

#pragma choice htype "hard" "Hard"

#pragma choice htype "soft" "Soft"

#pragma label hsoft "Horizon Softness"

#pragma range hsoft 1e-4! 1!

#pragma disable hsoft htype "lramp"

#pragma disable hsoft htype "sramp"

#pragma disable hsoft htype "hard"



#pragma label occ_enable              "Enable"

#pragma hint  occ_enable              toggle

#pragma label occ_amp                 "Amplitude"

#pragma label occ_bendN               "Bent Normal"

#pragma label occ_samples              "Samples"

#pragma label occ_scope               "Occ_Tracing Scope

#pragma label occ_distrib            "Occ Distribution"

#pragma choice  occ_distrib          "nonweighted"      "Nonweighted"

#pragma choice  occ_distrib          "cosine"           "Cosine"


#pragma label env_map              "Environment Map"

#pragma label env_mapFilter              "Map Filter"

#pragma label env_space             "Environment Space"


#pragma hint __nonspecular      hidden


//// Group features into tabs ////////////////////////

#pragma group   "Occlusion"     occ_enable

#pragma group   "Occlusion"     occ_amp

#pragma group   "Occlusion"     occ_bendN

#pragma group   "Occlusion"     occ_samples

#pragma group   "Occlusion"     occ_angle

#pragma group   "Occlusion"     occ_maxdist

#pragma group   "Occlusion"     occ_scope

#pragma group   "Occlusion"     occ_bias

#pragma group   "Occlusion"     occ_distrib


#pragma group  "Environment Map"  env_map

#pragma group  "Environment Map"  env_mapFilter

#pragma group  "Environment Map"  env_space



light rs_void_occlusion_hemis(

                float intensity = 1;

                vector skycolor = {0.5,0.7,0.67};

                vector grndcolor = {0.52,0.458,0.328};

                string htype = "soft";

                float hsoft = 0.2;

                int occ_enable = 1;

                float occ_amp = 1; // controls the strength of the occlusion

                int occ_bendN = 1; // whether to use the bent normal

                int occ_samples = 100;

                float occ_angle = 90;

                float occ_maxdist = -1; // -1 stands for "infinitely far"

                string occ_scope = "*"; // tracing scope

                float occ_bias = 0.01; // tracing bias

                string occ_distrib = "cosine"; // either "cosine" or "nonweighted"


                string env_map = "Mandril.rat";

                string env_mapFilter = "gaussian";

                string env_space = "space:world";

                export int __nonspecular=1;

                )

        {




        vector n = normalize(N);

        vector nw = ntransform("space:world",n);

       

        float weight = 1.0 - acos(nw.y)/M_PI;

        float hw = weight; // hw grnd/sky bias


        // Now we play with the variations in my post, acording to the

        // user's choice

        if(htype == "sramp") {                                  // Smooth ramp

                              hw = smooth(0,1,weight);

                             }

                             else if(htype == "hard")            // Hard edge


                             {        

                              hw = filterstep(0.5,weight);

                             }

                             else if(htype == "soft") {          // Soft edge

         

        // Instead of hard-wiring two values that straddle 0.5 for the

        // softness interval and writing something like this:

        // smooth(0.4,0.6,weight)

        // We let the user enter a value between 0 and 1 (hsoft) which

        // we use to open up that interval from almost completely closed

        // at hsoft=0.0001 (which is the limit enforced by the UI as per

        // our pragma directive above) and fully open at hsoft=1.


                                float halfinterval= clamp(hsoft*0.5,1e-4,0.5);

                                hw = smooth(0.5-halfinterval,0.5+halfinterval,weight);

                                }



        // Now we call lerp as before, except we replace the third argument (which

        // used to be just "weight", with the new "hw" defined above


                                vector lightcolor = lerp(grndcolor,skycolor,hw);





// Calculate occlusion and bent normal


                float vis = 1; // Default values chosen so that they will

                vector Nbent = n; // have no effect in the final assignment to Cl

                if(occ_enable) {

                                float occ = 0;

                                occlusion(occ, Nbent, Ps, n,

                                "angle" , radians(occ_angle),

                                "samples" , occ_samples,

                                "maxdist" , occ_maxdist,

                                "distribution", occ_distrib,

                                "bias" , occ_bias,

                                "scope" , occ_scope,

                                "variancevar" , Cl);

                                vis = clamp(1.0-(occ*occ_amp),0,1);

                              }

                                if(occ_bendN) n = Nbent;

                                vector Cenv = 1;

              







                                if(env_map!="") {

                                string space = env_space=="" ? "space:world" : env_space;

                                Cenv = environment(env_map,n,"envobject",space);

                                }


                                Cl = lightcolor*intensity*Cenv*vis;

                                L = n;

}



scene file :- rse_envlightshader.hip

otl file :- rs_void_occlusion_hemis.otl


Shader  Matte Exports


Simple scene showing how you can create mattes for objects on a per shader basis


scene file :- rse_shop_simpleMatteExports.hip

Displacement and hard edges


Interesting problem originally posted on the list > how on earth to get hard edges and use displacement without tearing.


  1. Create a new user N

  2. Copy that N to the geometry

  3. Add vertex cusp N , set to Cusp N

  4. In your shader create a parameter > using you new user N > transform that N from object to camera.

  5. So we are cusping with N and we are using a new user N for our shading.



scene file :- rse_cuspCube_X11_001.hip

Simple Occlusion


  1. Simple occlusion using the default VOP


scene file :- rse_shop_simpleOcc.hip

Car Paint Shader


  1. Fresnel ideas

Gold


  1. Custom Fresnel