Search This Blog


Thursday, April 21, 2016

NaN's (not a number)

I first came across this term on Happy Feet II, I stared blankly into the TD's face feeling lost ..."what's a nairn ? " - thinking of Garlic Nairn bread...

Recently they copped up again whilst I was testing my Bullet coin sim  - sometimes I would re-render a small window around them in the render view / IPR environment and they would dissappear - other times they would stick around.

So i dug up some info:

Wednesday, April 13, 2016

FLIP render

I've been doing some FLIP sims for a potential job  in H15 with a goal of recording all parameter changes and sim times in an orderly approach.
one factor I failed to overlook how ever so far was scene size in relation to physical parameters
for this look PBR3x3 Render time was 10 mins (milkChocolate Shader with SSS on (0.5))


Render Time: approx. 20 mins (Max samples upped to 32)
Render time: approx. 28 mins (2 levels of reflections and refractions)

slap Comp

Machine Specs:
proc: i7 3930k
OS Win7

particle Sep 0.01
friction 10
Other values are at the defaults
density 1000
viscosity 500
stick scale 0.1

# particles on this frame approx. 3 Million
# frames : 40
# total sim time for all 40 frames: coming soon

bgeo total disk usage: 2.95 GB
compressed bgeo total disk usage : 1.42 GB

Sunday, February 14, 2016

VDB Research

While I've been studying Houdini has evovled is a constant challenge with CG and tech in general to stay up to date. VDB's or 'openVDB' seems to have been born and matured and come into Houdini.

online docs

Technical Paper by Ken Museth

'VDB' is a open-source hierarchical data structure (and a suite of tools) developed by Dreamworks to handle high quality volumetric rendering (as seen in The Croods, Puss in Boots, How to Train your Dragon 2).

current version (Oct 2015) 3.1.0

Due to the data structure VDB enables constant time O(1) random access to voxels.

VDB allows almost realtime boolean operations

I tried this:
convert from polygons to VDB with "VDB from polygons SOP"
I merged a sphere with a torus, (VDB Combine) then converted back to polygon soup

this work flow allows us to boolean polygons in a new way to the old cookie SOP
which had its own inherent issues, but of course the accuracy of the result is dependent
on voxel resolution. Combining voxels has been previously (a while ago now )
described as a revolutionary way of modeling that was previously restricted by polygon limits.

You can merge different resolution VDB primitives together and the result can be either the lower resolution or the higher.

Houdini's cloud tools make use of VDB data structures.

Python in Houdini - some quick research

python notes

intro to python in H11 (Waqas A.M. Siddiqui)

#when should we use python ?...when you cant do it in Houdini with HScript or nodes

# comments prefixed with a hash (#)  can be appended to the end of a line of code)
2+2 # use python like a calculator
will return 4

#baby steps : drag a node into the python interpreter/window
>>> hou.node('/obj/geo1')
(shelf tools and pane TABS can also be dragged into Houdini)

'dotting in'
>>> n = hou.node('/obj/geo1') # assigning to 'n'
>>> n. gives us the operators for n

>>> n will give us the strign representation of the node (type geo and the path)

# assign the object a variable to work with it
>>> # call its name

# Children at SOP level

# Looping through the children and print the name

# parms

# check out the HOM (Houdini Object Model) section of the Houdini help files
ie HOM cookbook and tips and  tricks

# Build a function
wrap up a snipped of code so we can call it on a whim

# note this recursive (the definition of recursion is recursion)
def childrenOfNode(node):
        result = [] # a list in python
        for c in node.children():
          result append (c)
          result += childrenOfNode(c) # this is where the recursion happens - we are calling the very function               # we have defined
return result

# recall indentation is key in python
# saving to a sessional window allows custom functions to be called with the hou.session prefix

# add your code to the shelf as a shelf tool
right click somewhere on the shelf - choose new tool
in the scripting window - add your python code ie

print 'hello world'

#CTRL-TAB will do your auto-complete for you

# set the pos of a node in a Network editor pane
n = hou.node('/obj/box1')
n.setPosition([.5, .5])

# to see more look in HFS/scripts/python

# adding python into object parameters
ie in HScript - $F/10

in python: (be sure that Houdini knows it is a python expression
and not HScript - Right Click - change expression language to python)

the parm window changes to pink to show the language is not the default language
if the defualt is set to Python then the HScript expression would be in pink

note in parm windows - the hou prefix can be dropped

time() = $T
lvar("PT") = $PT

ie point SOP
lvar("TX") is equivalent to $TX

pwd().curPoint().position() is equivalent to

ALT-E gives us a little editor to help write our python
in this context - if there is more than one line the code is treated as a function
(with breaks shown in the parm window)

point = pwd().curPoint()
if point.number() ==0;
      return 2
return point.position()

kwargs - used through-out houdini
describes a bunch of variables associated with the shelf tool
ie whehere or not you have ALT-clicked the tool or SHIFT-clicked the tool etc
whether or not he tool was invoked from the viewport or not

use sys.exit() to exit from a python shelf tool

shelf tools can be bound to Hot Keys - and they can be invisible form the shelves or viewport pane

in a font SOP (as a python expression):
"Frame $F %s" % int(frame())

will give you the frame number evaluated from the python expression

"%02d:%03d, 1f" % (time()/60, time() % 60)

with string parameters - add a keyframe - then change to python to edit it
you cant add a python expression as a string expression until you have a true keyframe

hou.expressionGlobals()['foo'] = foo
now foo can be called from a python expression
so if you have a lib of your own expressions
you can inject them in to expressions

make a timecode HDA's
make it a HDA - Shift-C
from the subnet create a DA
'ch' can be used just as we would in HScript

use CTRL-g to jump to a specific line in a python scripting window

code in an asset is more global - it lives with the asset
python in a shelf tool may only live on a specific desktop and python in a session may only live in that

Boolean operators ordered by ascending priority:
x or yif x is false, then y, else x(1)
x and yif x is false, then x, else y(2)
not xif x is false, then True, else False(3)
  1. This is a short-circuit operator, so it only evaluates the second argument if the first one is False.
  2. This is a short-circuit operator, so it only evaluates the second argument if the first one is True.
  3. not has a lower priority than non-Boolean operators, so not a == b is interpreted as not (a == b), and a == not b is a syntax error.

it has been said that unambiguous code is good, so I imagine writing 'not (a==b)' is preferable to 'not a == b'

use of <> is obsolete but backward compatible to the standard !=

Tuesday, November 10, 2015

Computer Science Notes

exam time again ! :|

7-state process Model - note that a process can go also from  the running state directly to the Ready/Suspended state

Some encoding schemes applied at the physical layer in a network protocol model - either the OSI model or a'5 layer model' omitting he session and Presentation layers ( Please Do Not Touch Steve's Pet Alligator, PDNTSPA, Phy, DataLink, Network , Transport, Session, Presentation, Application)

Encoding (the primary function of the PHY layer - turning bits into signals)

Services are provided to the layer above

NRZ Non Return to Zero

a high voltage indicates a one - a low voltage indicates a 0
This exhibits a problem when there is a large stream of consecutive ones or zeros - the scheme is prone to base line shift, where source and destination host clocks become out of synch

NRZI Non Return to Zero Inverted
To counter the previous problem, a one is indicated with a phase shift and a zero is indicated by no shift,
but this only solves the problem for ones, the same succeptability to baseline shift is present with zeros.

ie only half the problem is solved


there is a phase shift every clock tick as the signal is XOR'D with the clock. This solves the baseline shift problem, but costs bandwidth though - reduced by 50%. A one is encoded with a Descending voltage and a zero with a Ascending Voltage.

This is possibly counter intuitive - intuition may assume that a 1 is associated with an ascending voltage, and zero with a descending voltage - but this is opposite of the reality.

This is the strongest solution to baseline shift of all previously mentioned encoding schemes. The 16 possible combinations of every 4 bits are mapped to 16 of the 32 possible combinations of using 5 bits instead, and the other 16 combinations ignored or used for frame detection. The 16 look up codes chosen are those with phase shift in at least 2 in the Block (B) of bits - so there is no risk of baseline shift.

More bits are thus needed to encode the same message compared to NRZ and there sis the overhead of the look to dictionary process.

Follow by Email

3D Slideshow