Wednesday, 12 February 2014

renderman Examples

I found that fundza has already made a developement into creating simple fractal like the Sierpinski triangle into RIB format that user can use in renderman. This was made using points  to replicate the 3D nature of it.

 http://www.fundza.com/algorithmic/sierpinski/python/index.html

http://www.fundza.com/algorithmic/sierpinski/python/img/sierpinski_blobby_large.jpg

Monday, 10 February 2014

Comparing fractals

 Sierpinski triangle

The first fractal i will be comparing is a Sierpinski triangle. Basically the idea to create one outer triangle and then create three small one within that outer triangle. This process is then repeated to created the higher iteration.

By using the python's graphical command called turtle I can try and replicate this in code form.



the image above is only a second iteration. 

The next fractal i will be looking into is the Sierpinski Gasket.

Monday, 27 January 2014

Different Types of fractals

Sierpinski Gasket

Start with a solid filled equilateral triangle then divide this into four smaller triangles using the midpoints of the three sides of the original triangle as the new vertices. Try and remove the middle triangle.





Sierppinski Pentagon

Try and scale a triangle and translate the copies to scale a pentagon and then translate the copies into five smaller pentagons. these will fit into the large pentagon shape.
















Friday, 17 January 2014

Schedule/Time Management



Here is the proposed timeline for our upcoming Major Project. The biggest chunk of our time is spent on creating or generating our own procedural pattern(python language) and using RSL to display it on renderman. There will be a lot of trial and error especially we are going to create the 10th iteration of the Dragon Curve.




Thursday, 16 January 2014

Previous Frost Shader Approaches


There are a couple of frost related work today but the fact is they are always used in visual effect scenes( e.g. Rise of the Guardians, The Day after Tomorrow, Narnia the Lion witch and the Wardrobe and the latest one from Disney's Frozen. All of these feature films showcase some kind of snow accumulation and ice crystal formation. Example in the Disney's Frozen it features a ice crystal growing and turning into a huge castle. But the most intriguing I think is Dreamworks Rise of the Guardians which showcases Jack frost and its ability to create phenomenal frost pattern in solid lakes and windows.

         


The Rise of the Guardian Film was actually featured in a 2013 Siggraph paper. In which the paper talks about Cellular Automata to model the animating growth of the frost and then using Curve to generate the scattering of the frost pattern.

http://dl.acm.org.v-ezproxy.smu.ac.uk/citation.cfm?id=2504459.2504479&coll=DL&dl=ACM&CFID=283020813&CFTOKEN=44873710

There a couple more example of how to model frost but as we know there are different kinds of frost and these paper talks about specific ones. Example the one below talks about visual simulation of Glazed Frost, a Frost that actually creates a ice around a object. This was a very handy insight on my part but one the technique i was looking for.
http://delivery.acm.org.v-ezproxy.smu.ac.uk/10.1145/2510000/2503400/a14-ishikawa.pdf?ip=212.219.61.169&id=2503400&acc=ACTIVE%20SERVICE&key=C2716FEBFA981EF1AE9BA548B9F4B8578844D11695F731CC&CFID=283020813&CFTOKEN=44873710&__acm__=1389868807_5edb570b8164ec7e83dc4bf24e6907e3

Another amazing shot is the The Day After Tomorrow running frost in which the scene shows the frost spreading infecting the whole room.  This was mainly done in 3Ds max and was created using a mapped texture and animated and tweaked in OpenGL.
http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4387869&linkID=14271594

Frost shader work from other people:

http://www.kai-w.com/renderman/frost_shader/frost_shader.html

https://facultypages.scad.edu/~mkesson/vsfx419/wip/winter07/matthew_burdette/frost/index.html

http://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc09/Salas/mr_cool_ice_manual.pdf

All of the work mention above used renderman's rendering software and its language. Kai wang created an impressive shader that generates Barnsley Fern pattern within the RIB file and using a simple surface shader.
Matthew Burdette creates a simple shader within the surface shader and utilizing the noise function to create a distorted pattern for the frost.

There a few paper that talks about frost shader creation but there are tons of paper that talk about snow acuumulation and snow dynamics this might be handy but not useful of what i am trying to achieve. Surprisingly i came across a paper that talks about how to model venation pattern into a leaf and its algorithm is kind of applicable to how i can animate my frost.
http://delivery.acm.org.v-ezproxy.smu.ac.uk/10.1145/1080000/1073251/p702-runions.pdf?ip=212.219.61.169&id=1073251&acc=ACTIVE%20SERVICE&key=C2716FEBFA981EF1AE9BA548B9F4B8578844D11695F731CC&CFID=283020813&CFTOKEN=44873710&__acm__=1389870012_fd684bb2434fc066e7d5699ab9ad7957






Wednesday, 15 January 2014

Dragon Curve Creation



The idea of making a dragon curve fractal is very simple at first it might be a little confusing but once the idea is perceive it will come easy and look amazing.

Step One: Draw a line and then rotate the coy of this line 90 degrees( always clockwise) and attach it to the end of the first line.



Here the black line is the first line then the red line is the rotated line in 90 degrees but in clockwise.

Step Two: We now have an L shaped line. Rotate a copy of this ENTIRE line 90 degrees, and attach it to the end as in Step 1.



The number of lines it takes to draw this fractal doubles with each iteration. It is important to always rotate a copy of the entire previous shape and attach it to the end of the previous iteration.

Step Three: We now have a backwards question mark. Rotate a copy of this ENTIRE line 90 degrees, and attach it to the end of the previous step.



Hopefully now you’re beginning to get the idea. This next iteration is where it gets a bit tricky.

Step Four: Repeat Step Three for the ENTIRE new line we’ve constructed.



As you can see our rotated segment intersects with the previous step to form a box. While the Dragon Curve never crosses itself, there are a number of intersections like the one in this step.

Step Five: Repeat Step Three for the ENTIRE new line we’ve constructed.



By five iterations we’re starting to get an idea of the whole shape. As in all of the previous drawings, the section in red is the rotated copy, and the black is the previous stage. Let’s see a couple more iterations:

Step Six: Repeat Step Three for the ENTIRE new line we’ve constructed.



Step Seven: Repeat Step Three for the ENTIRE new line we’ve constructed.




As you can see the seventh iteration is starting to show a bit of its final shape pattern. Once we repeat this process we will get a much more resolution version of the curve.

Here is an example.
I made this in Photoshop and only use a line then duplicated it and followed the instruction i mention.









The approach for the Project



The approach for creating our Window Frost shader is to generate a procedural pattern that will derive the look of the overall shader and aswell affect the displacement shader. These two are the primary focus of our project and will then add more characteristics to our shader e.g. light and animting the shader.


The two main books that will help me through the process are these:

Renderman Shading Language Guide , Rudy Cortes
Essential Renderman Fast , Ian Stephenson

And other reference book such as :
Advanced renderman: Creating CGI for Motion Pictures , Morgan kaufman ,
The Renderman Companion: Programmer's Guide to Realistic Computer Graphics by Steve Upstill
Texturing and Modeling: A Procedural Approach (The Morgan Kaufmann Series in Computer Graphics)
The surface shader is the perfect type of shder that will derive the look of our Window frost. Surface shader has the capability to render value of the surface position (very handy to randomize pattern position) and normalizing. Here is an example from the book , Renderman Shading Language Guide , Rudy Cortes.

This is only an example!!
s_RP_showst.sl.
surface s_RP_showVars(
string showVar = "s";
)
{
/* Variables */
// Assign pure RED to sc, if the value provided by the user is not
// recognized the use red.
varying color sc = (1,0,0);
if (showVar == "s")
sc = color(s,0,0);
else if (showVar == "t")
sc = color(0,t,0);
else if (showVar == "st")
sc = color(s,t,0);
else if (showVar == "P")
sc = color(P);
else if (showVar == "N")
sc = color(normalize(N));
Ci = sc;
}








All of this will be derive by a RIB file that will display it into renderman. The real work is creating the procedural pattern that will derive the look of our shader. for this project i propose to use the the Dragon curve algorithm to create our 2D procedural texture.


http://en.wikipedia.org/wiki/Dragon_curve










we can approximatethe dragon curve by recursive methods such as Lindenmayer systems.


This is an example This is not my WOrk .

Example 6: Dragon curve[edit]

The dragon curve drawn using an L-system.variables : X Yconstants : F + −start : FXrules : (X → X+YF), (Y → FX-Y)angle : 90°

Here, F means "draw forward", - means "turn left 90°", and + means "turn right 90°". X and Y do not correspond to any drawing action and are only used to control the evolution of the curve.