Search

Loading...

Saturday, January 29, 2011

Boundary Edges

(note: deprecated for SI 2012, since it now has intrinsic ice attributes for retrieving boundary components)

 (Please note that this is an approximated method and its not meant to be literally correct. But it should output correct results about 95% of the time. That said, let's get started!)

Download Link: Is Edge Boundary Compound


Finding boundary edges is a pretty common task requested in computer graphics. It can be used to fill holes, amongst other things.



In my opinion, "isBoundary" should be a default ice attribute for an Edge. But you know, life is not easy... so let's take a look at how can we find it by ourselves:


Step 1: How to define a boundary edge? 

Simply put, edges are conections between polygons, and the difference between boundary and regular edges are the number of polygons connected to them. See image below:



Once we know how to define it, it's time for the ice stuff:


Step 2: Getting the adjacent polygons.

To retrieve the adjacent polygons of an edge we can get its position and do a geometry query from that:


The problem is that only the closest polygon position is returned, thus we have reached just half of our way to getting the 2 connected faces. 



To get the other polygon (and this is where it gets a bit hacky) I found that we could subtract the polygon vector from the edge vector and multiply it by a tiny bit, so that the lookup position gets slightly shifted and the next query will hopefully give us a different (and oposite) adjacent polygon.

Click to vew a bigger image

The search shift should be as small as possible to avoid querying polygons too far or unrelated to the actual edge. A value of 0.01 is good for most scenarios.

Step 3: Isolating the boundaries 

As soon as we have the new result from the other "get closest location" node, we can compare the polygon positions. If the edge is connecting 2 faces, it will return 2 different polygon positions... But if the edge is a boundary, the new search position will fail to reach to any other polygon, and will fall back to the same requested before. From now on a simple if node comparing the two positions will reveal the boundaries:


 ...and as we started working on the edge perspective since the beggining of the ice graph, our output will gracefully stay in a "boolean per edge" context.


Conclusion / Tips

Although this is working great so far in my tests, I should point out that this method fails in case of super folded polygons (closest polygon lookup does not return the adjacent face to the edge we are searching from), so please consider before using this method. Also be sure to put the icetree above the modeling stack, so that it always compute after any topo ops you have. And lastly, If you are getting strange results, try playing with the search shift to see how it goes.

If you don't want to rebuild the ice tree by yourself, just download the compound (link on top of the article).

Hope you find it useful!

Saturday, November 20, 2010

ICE transfer of FxTree Tracking operator

download link: Apply 2d Tracking compound

ICE transfer of FxTree Tracking operator from Fabricio Chamon on Vimeo.


The compound internally builds a camera frustum and translates fxtree tracking data to 3d data.
Two things you should know before using:

- be sure to align camera and interest Y position before applying the compound. (that's because frustum rotation is not being calculated yet)
- change the image resolution inside the compound to fit your dimensions. (didn't find a way of retrieving image resolution right inside the ice tree)

...being using this one a lot in shots involving simple 2d tracking (no rotation, or hand keyed rotations) for object replacements, prop attachments, etc..

compound will be stored under Tools > Tracking.
enjoy!

Sunday, July 4, 2010

ICE Strands to Curves

Download Link: ICE Strands to Curves Addon


ICE Strands To Curves - Softimage Addon from Fabricio Chamon on Vimeo.

Build curves from strands of a pointcloud.

It creates a snapshot of the strands at the moment the command is called, then the curves are ICE deformed to follow the original strand animation.

not the fastest performance, but it can do the job.

tip: if you are using merged curves, you can Animate > Plot Shape, then remove the icetree operator from the curves to speedup viewport playback.

Friday, May 7, 2010

Edge Detection

downloadEdge Detection Compound

Took a little time to experiment with edge detection in ice.

The main goal was to implement the Canny Edge Detection algorithm (http://en.wikipedia.org/wiki/Canny_edge_detector), but in the end it turned out to be much (MUCH!) more simple and visually oriented that that.

For now it only works on grids (planar projections) and greyscale images. The next goal is to enhance the detection by decomposing rgb channels and comparing colors.


ICE Edge Detection from Fabricio Chamon on Vimeo.

How it works:

The pseudocode for the entire detection process is:

for each particle
  get its neighbours particles
  get neighbour closest pixel brightness on grid
  get all neighbours colors average
  compare with threshold
  if low threshold < average color < high threshold, then set this particle as an edge

On the begining it doubt this would work due to the large margin of error it could produce. But using masks as inputs gave me suitable results.

Compound parameters: With closer low-high ranges you get narrower edges, zeroing out low will give you filled blacks, and totally cranking up high (=1) will give you filled whites. Increasing detection resolution will enhance accuracy, but at the price of decreased performance.



Funny enough, the hardest part of this compound was not the algorithm itself, but how to expose the final edge particle positions as an array per object. The particles considered as edge have an isImageEdge boolean attribute set to true.We can easily get all point positions in a per object context by:

get self > get closest points (no cuttoff distance or max points) > get pointpositions

But now we have to remove from pointposition array the non-edge particles. The next trick is:

if isImageEdge = false, remove the returned array subIndices from pointposition array (the non-edge particles)
if isImageEdge = true, remove -1 from pointposition array (which will do nothing)

(click for bigger image)

This way you can have a filtered per object array returning an attribute validated by another attribute. This is very handy and should be encapsulated in a compound for later use.

that's it, see you next time. =)

Tuesday, April 27, 2010

StrandTree - Simulation WIP


Tree simulation - wip from Fabricio Chamon on Vimeo.

First steps on building a dynamics framework for the trees. (Heavily based on Phil's Strand Dynamics compounds).

What's working right now:

- strand forces: gravity, drag, wind
- strand stiffness
- geometry collision

Issues still being addressed:

- mantain initial tree shape
- too much jiggling and stretching of strands
- optimization: modeling strands apart from dynamics strands
- localized branch constraints
- leaf dynamics

I hope this can get released soon.

Sunday, April 4, 2010

StrandTree - A procedural approach to tree modeling in ICE





Hi, first post here.

I hope this blog will get plenty of updates every week from now on. So to start, here are the StrandTree compounds I have been working lately:

Downloads: StrandTree Compound Pack
                   StrandTree Quick Guide
                         (thanks to Leendert - aka Hirazi Blue - from si-community for the file hosting

If you are using Softimage 7.x version, please update and reexport the "Emit Leaves" compound. it's using the "Point Index to Location" node that only comes with softimage 2010 version, but this can be replaced with the "ID to Location" node inside the compound, like in this image: emitLeaves_Fix_xsi7.jpg

16 compounds:

Emitters:
   - Emit Branches
   - Emit Leaves

Grow Control:
   - Even distribution grow
   - Random distribution grow

Modifiers:
   - Modify Branch Color by Iteration
   - Modify Branch Width by Iteration
   - Modify Particle Size by Iteration
   - Modify Value by Iteration
   - Modify Value by Normalized Strand Segment

Debug:
   - Debug Iteration

Strand Effects:
   - Deform Tree by Curve
   - Surface Grow

Rendering:
   - Tree Visibility Options
   - Use Geometry Branches

Presets:
   - Basic Tree
   - Pine Tree

(all of them located under Tasks Tab > "Strand Tree")

Videos:


Softimage ICE Procedural Tree Generator from Fabricio Chamon on Vimeo.


ICE Procedural Tree - Surface Grow from Fabricio Chamon on Vimeo.


On the nexts posts I will try to explain more in depth each compound and record other videos showing new features. Also a documentation is on the way, along with some updates (mainly a simulation workflow for the trees).

For the time being just check the Presets category and dig inside the Basic Tree compound for some insight on how to build your own trees. And don't forget to send feedback, so that I know what to improve next! =)

Pages