Monday, August 12, 2013

Few Houdini Questions:-

1)how to emitt particles only when impact data is greater than 30?
   if(clamp(point("../dopimportrecords1",$PT,"impulse",0),1,36)>30,1,0)
 using dop field:
if(clamp(dopfield("/obj/AutoDopNetwork","piece0","Impacts","Impacts",3,"impulse"),1,36)>30,1,0)

2)Move object in circle in xz plane
   in x and y tanslation put following expressions..
x=sin($T*40)*4
y=cos($T*40)*4
3)Enable or disable rbd state, if dopobjects are in the attribute group..using adjascent glue.
In active value node ...
`pointlist("/obj/glue_piece0_to_piece99/red","red")`
pointlist("pathOfGroup","groupName")

4)Create Basic Chains
   -create chain using duplicate sop (rotate 90 on each copy)
-create rbd fractured object
-create a pin constaint (remove goal field)
-change solver to rbd and increase collision passes to 50

5)Any Dvd Cutter: to cut the clips from dvd's
    Arvee player

6)Export Boujou Camera to Houdini
   export camera as houdini 4.1, it ll save as .hip file

7)Export from Boujou to Nuke

 press [x] to execute a script command and type :
import_boujou 
as a TCL script. 
You will need to export the camera and tracks as a .txt file from boujou (its the last export option). 
This will make a you a scene containing your tracks with individual transform geos for position.

Friday, July 19, 2013

Houdini Class Notes

Houdini Notes:-

1)Switch on even or odd input.
if(ch("../../box_object2/Number")%2==0,0,1)

2)Echoing in textport
echo `rand(0.5)`
3)repeat operation =q key

4)Some Useful variables
$F,$FF,$PT,$NPT,$PR,$NPR,$CEX,$CEY,$CEZ,$RFSTART,$RFEND

http://www.sidefx.com/docs/houdini9.5/nodes/sop/standardvariables

http://www.sidefx.com/docs/houdini10.0/expressions/_globals

http://www.sidefx.com/docs/houdini10.0/nodes/vop/global

5)Getting centroid of other nodes which are moved from origin
centroid("path",D_X)

bounding box,
bbox("../path",D_XMIN,D_XMAX,.......)
$ZMAX,$ZMIN,D_XSIZE,...
Group selection
5-10:2,5 (between 5 and 10,select two out of 5s groups)
!5-25 (not from 5-25)
*^5-12^40-60 (select all except for 5-12 and 40-60)


6)square of value
pow(2,3)=8
    square root of a value
sqrt(144)=12

7)  Point shop:
     -create attribute eg:test and acess in the point color.
-create attribute in one branch (eg. color) and acess in seperate branch
using point ("add of node", PT num, name of attribute,component number)
eg: point ("../attributeCreate1",$PT," CD",0)

eg ..for float attrib called red (rand($PT))..in a seperate branch
in add color for point shop, red is the name
point (""./attribCreate1",$PT,"red",0)
 point can be used only to acesss point attribute ..not primitive
if number of points dont match ...for example 1st branch is 25 ..in second branch is 100...it ll return the last available point value
.

to reverse the order of color in second branch ...
point ("../attribCreate1",$NPT-($PT+1),red,0)

on every 21st point it should repeat from 0 again ...
point ("../attribCreate1",$NPR-($PR+1),red,0)
..the attribute needs to be of type primitive .and to acess it ..use primitive node ...not point node ..obviously ..

Vertex expression...to fetch vertex data ..
float vertex ( )

for details..type attribute
use detail()

Attribute Transfer
Make sure to transfer only the attribute we need ...not everything ...so that its faster to evaluate network ..

Attribute Promote:
Used to convert an attribute type to another ..for example from point to primitive ..
its also ..helpful to find the average,max,min values ..(we need to switch it to type details..for eg point to details and check it on details view )

Vectors using point...
To find the normal ..based on the two input..
$TX2-$TX,$TY2-$TY,$TZ2-$TZ

Aligning ..the tubes based on the curve ..first find the normal so that one follows another and use following expression..
replace ..x,y,z component ,,with 0,1,2
point ("../curve1",$PT+1,"P',0)-point ("../curve1",$PT,"P",0)

To make copies ..point towards the centre of circle ..
using sort node ..
using polyFrame node
using ..bbx-0.5 method.

copystamping ...
copy works only on points ..

create an attribute pscale..and paint node and override color to pscale ..now u can paint the scale...

on stamp ..create a variable test (rand$PT)*360 and specify that values in transform node after the instance stamp("../copy","test",0)
..to check the values stored (for eg ..test).....create attribute test and point that in the copy as $TEST

exersise...fit the values ..with in the new range
                create regions and have specific copies on specific regions

some more useful expressions...

floor (2.3)=2
ceil(2.3)=3
round(2.3)2
truc(4.6)=4
frac (4.6)=0.6

to find out the total number of pt in next branch ...
npoints ()
nprims ()

opninputs
for eg ..opninputs("../switch1")  ..gives number of input for switch
opdigits to extract digit from string..

 time shift node ..to shift animations ...

comparing the points behind ..the next geometry and Group them together..

$TZ < point("../xform2",1,"P",2)

solver node ..to remember previous output

For loop..
stamp("..","FORVALUE",0)


-naming the seperated group by clip node inside for each (set for each primitive/point)
group`stamp("..","FORVALUE",0)`

-using connectivity and partition nodes together to group the connected primitives.

-another approach is to use assemble node, or in vorenoi fracture create groups(inside its doing the same thing)

-For each using attribute and acess it ..to create a point on each chunk centre

Particle:
If velocity component isnt there ..it takes normal as velocity.
Impulse Birth rate/frame
Cont Birth rate /sec
life expentency is in sec
$NPRIM -total number of primitive

To create curve with points ..use add node (polygons>ByGroup>skip every nth point)

eg :create ramp to control the size of particle.
eg:map particles to the color of the image..and blow it away

Acessing Ramp parameter in point(add scale for particle)

float chramp (string ramp_path, float position, float component_index)

To map the image to points in polygon
add a point node/add color
pic("../cop2net1/default_pic",$BBX,$BBZ,D_CR) (this is slow)

Tex command
tex("Mandril.pic",$BBX,$BBZ,D_CR)
getting image path from cop2 network
tex("op:/obj/grid_object1/heightField/out",$BBX,$BBZ,l)
 eg: to transfer color from points in grid to respective copy on instances
-add a point and acess r,g,b using ..tex("Mandril.pic",$BBX,$BBZ,D_CR)
-create rgb variables ..pointing to above created values
-and stamp in copy node ...
-now we can create particle on the grid points to make image blown away..

eg ...shorter way is to just use Template Point Attributes in copy node ..that will copy each of the attributes ..



acessing the red component for scale of copies..
stamp("../copy1","scale",0.05)


Particles...
vary color based on Life of particle
$LIFE

popevent()
eg:to call event 'collided'
popevent("collided")
returns 1 when there is event or returns 0
popeventtime()....returns time value

-nodes:attracter
            property (to add physical properties like mass,etc)
           render (to select the render type)

-moving along the curve



-----------------------
Dop:-
opinputpath()- Returns the full path of the node connected to a given input

fracture vs fracture glue object:-glue object has internal bond parameter between the piece where as fracture object dont have em

rbd point object -needs to input
 use particle scale parameter in dop network ..to accept the scale variation on point objects
 To add multiple objects as point instances ?
-add mantra/instances in interface edit and switch of full point instancing to see it in render
-create point/add instance
point the different using same expression
 obj/box_box`$PT%4+1
now create rbd point object on it ..it ll add those instances
in point/add instance
/obj/instance_object`$PT%4+1`

-anim + dynamics
node  /rbd state/motion/objpos work in conjuction with active value node
use motion node to blend the velocity between animated and dynamics (set the option as always and activate it)
alternate node for this :- objpos/rbdkeyactive (easiest way)

-merge node in dop has different options of interaction
  another node for relation affecter
-relationships can be viewed in details view..lol ..wtf ..are u kidding me ??
-$OBJID (unique objects in dop)
-haspoint(),hasprim()
-dophassubdata()- to check if collision occurred and specify operation
variables:$DOPNET,$OBJNAME,$OBJID,$ST,$Affectorid,$affectedid

ex:-breaking away certains parts of objects based on glue values ...
    getting dop import as point(simulated) and using that to copy with other geometry.


















Questions:
Use ray shop to find the intersection distance ...(check point intersection option)..use that value to extrude the polygon...
..How to subdivide only the area in contacts ...?
---How to stop from moving scatterd points on every frame ..

How to iterate thru ..a value and increment by specific values on each frames ..

=Create fracture on Rolls...
=Making particles flow on the surface ..
=Particles on surface ..with particles dripping down ..
=Create Rain/snow
=Neuron effects ..with glow ..
=Dis integration effect
=Set up Animated noise map on surface and generate/kill particles based on the texture animation..
=shape changing particles from one to another ..
-







Thursday, July 11, 2013

Layered Shader In Houdini with emission

Here is an example of layered shader with emission...
add mixer for color,opacity,bsdf and add the area of emission as emission amount as well.In pbr set diffuse limit to more than 0.



Tuesday, July 9, 2013

BasicTriplanar Projection in Houdini

                                 Basic Triplanar Projection in Houdini

Wednesday, June 19, 2013

Few Questions

few questions:
1) How to import exr layers in photoshop?
ans: Some plugins like proExr helps to do that in PScs5 extended version.
       for more details:
 http://www.fnordware.com/ProEXR/
2)How to render layers in seperate files in Houdini
      create seperate mantra nodes to do this.
3)How to render out material mattes in Houdini..
  In the shop network add parameter,set export to when input is connected,create a constant,,set type to color (1,1,1).Connect costant to parameter.
  Point the name of parameter in image plane in the rop (eg. treeMatte) ...and bingo .u have matte as seperate layer..



4)How to assign different materials in different takes ?
   Create a shader, go to the take and in the object point the shop to the different material.

5)How to improve anti aliasing in Houdini renders ?

6)Linear workflow in Houdini


7)Triplanar Projection:




8) How to delete parts on zbrush.
     Mask the area u want to delete (cltr+shift marquee select), invert it (cltr+shift marque select outside).It ll make areas u want to delete as hidden.
     now go to ..Geometry> modify topology> delete hidden.

9)How to setup Volume Fog in Houdini...??
  Create an atmosphere node,create lit_fog in shop.Connect atmosphere node to lit fog shader.Render the light with depth map shadow.

10) How to shatter more along the curve drawn on surface ?
      transfer the color(Cd), add scatter node after attrib transfer, in scatter Alternate attribute type Cd and set mode to multiplication of probablity.
  To have more chunks along the curve, create second curve (using vop sop), merge them, skin them, convert to poly, now add the poly to attribtransfer for scatter node.

11) How to download videos from youtube ?
    after www. type www.ssNameOfVid ...this takes u to the link ..which has different format video ...and bingo u ..have it ?...



Tuesday, June 18, 2013

Bump And Image Displacement Basic NetWork..

                                     Basic Bump Network
                                  Basic Image Displacement Node

Harmonica Bends :P

Not ..Cg exactly but Harmonica ...
Thought i ll loose the link ...:P
http://www.harmonicalessons.com/improv_riffs.html

Flatten an object in uv space in Mudbox

Flatten an object in uv space  in Mudbox...
Shortcut-Alt+T
Mesh>Flatten to UV space..
It can be used to fill up the base textures on the object ..make sure we have tiling option on the stencil settings while painting.

http://my.safaribooksonline.com/book/-/9781849691567/5dot-get-in-and-get-out/id286767779

Repeat UV in houdini

add a parameter (type int)..multiply with s/t and plug to s/t of surface color ..

Monday, June 17, 2013

All about instancing in Houdini..

Here is the link to understanding instancing , randomizing rotation,scale,change instances and change shader attributes based on points ...enjoy !!

https://vimeo.com/52551778

God Rays in Nuke

Here is a link to basic Tutorial on How to create 2d God Rays using a simple roto shape ...

http://satheeshnuketutorials.blogspot.in/2012/08/2d-volumetric-rays-in-nuke.html



Slope Based Shader And Basic Displacement in houdini.

Slope Based Shader :
                 Dot product of Y axis and surface Normal ..gives a value between 0-1, which is fed to a ramp(to control the slope).

I have used an example of ..two shader (surfaceModel1 and 2), where the latter is basically the inverse of the first one.That means areas not covered by the first shader ll be covered with the first one.

Basic Displacement Shader:



Basic Network for Displacement.
I was getting an artifact in my render with this.
Increasing Displacement Bound or Going to  object node, Render tab - > Dicing tab -> Ray Predicing change to Full Predicing, Fixed this.

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=28934



Abt Me

Hi ..I am a cg enthusiast ..where i am planning to document , post links to the stuffs i learn...
Thankyou !!