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.



Tuesday, 14 January 2014

Light refraction in Frost /Ice

http://www.itp.uni-hannover.de/~zawischa/ITP/refraction.html


This site tells a detail description of how ice crystals refract light and we can expect to see is light does hit tiny ice crystal in air.

When snow is hit by light it starts glittering some of the glints are coloured and the colour changes depending if the person looking is moving. The glints can be very bright but it also depends on the light source.


What is Frost ?

FROST

frost is part of the winter season it is a deposit of small white ice crystals on a ground or any other surfaces when a temperature falls below freezing. Our question is how does frost form? because sometime people assume frost only occur when there is snow but this a misconception. frost forms because of the water vapor in the air that has condensed as because of the freezing temperature and has been deposited into a surface of an object. Normally on summer we can see water vapor on grasses early in the morning and the thing is water vapor occur naturally because air is part water (basically air carries a little bit of water). frost sticks into surface objects due to the fact that the surface has cool down and not much heat are within the object surface.

here is a much more accurate description : https://www.highlightskids.com/science-questions/how-do-jack-frost-designs-get-windows

http://www.metoffice.gov.uk/learning/frost

Frost phenomenon

You can see that the frost on a window is always on the inside. And if the outside temperature warms up, or maybe if a window is right in the sun, the frost may melt into water that runs down on the inside of the window. So, you can see that the frost is made out of ice that formed on the inside of the window.


Frost forms on a window when the temperature outside is below freezing. Inside it is warmer, and there is more water vapor in the air. Any water molecule in the air that hits the glass will stick to the surface. As it sticks, it is hooking up to other water molecules to form ice crystals.


Every water molecule is made of one oxygen atom and two hydrogen atoms, H-O-H. Water molecules can stick together by sharing their hydrogen atoms. They tend to make six-sided shapes but in all kinds of patterns. The really amazing thing about frost on windows is that it forms in such varied and beautiful patterns. If you were wondering why they make some of the particular Jack Frost patterns, I just have to say that I do not know.

heavy frost on burr oak trunk and branches             

reference: The WHY Files? , November 1, 2010, http://whyfiles.org/2010/how-does-frost-form/


There also different kinds of frost and they differ from each other partly because of their look. Here is a explanation from the metoffce.gov.uk

http://www.metoffice.gov.uk/learning/frost/types-of-frost



Types of frost





Introduction to air and hoar frost and how they differ from glaze and rime.
Ground frost


A ground frost refers to the formation of ice on the ground, objects or trees, whose surface have a temperature below the freezing point of water. During situations when the ground cools quicker than the air, a ground frost can occur without an air frost. A grass frost, an un-official type of ground frost, can occur when other surfaces - such as concrete or road surfaces - don't experience a frost, due to their better ability at holding onto any warmth. It is possible for a grass frost to occur in late spring or even early summer when the risk of more wide-spread frosts has disappeared and is something that gardeners in particular need to be aware of.
Air frost


An air frost occurs when the air temperature falls to or below the freezing point of water. An air frost is usually defined as the air temperature being below freezing point of water at a height of at least one metre above the ground.
Hoar frost


Hoar frost is composed of tiny ice crystals and is formed by the same process as dew, but when the temperature of the surface is below freezing point. The 'feathery' variety of hoar frost forms when the surface temperature reaches freezing point before dew begins to form on it. A 'white' frost, composed of more globular ice, occurs when the dew forms first, then subsequently freezes. The presence of fog tends to prevent the formation of hoar frost as it reduces the potential for radiational cooling of surfaces.
Glaze and rime


Rime (left) and glaze (right)Frost is sometimes confused with glaze or rime.


Rime is a rough white ice deposit which forms on vertical surfaces exposed to the wind. It is formed by supercooled water droplets of fog freezing on contact with a surface it drifts past.


Glaze can only form when supercooled rain or drizzle comes into contact with the ground, or non-supercooled liquid may produce glaze if the ground is well below 0 °C. Glaze is a clear ice deposit that can be mistaken for a wet surface and can be highly dangerous.

The TYPE OF FROST FOR THE MAJOR PROJECT

The frost type that I will be replicating is the Window Frost or commonly known as fern frost. Derive from its pattern generation of fern like formation.

Fern Frost 

Pattern Formation

Window frost or fern frost have crystal formation or ice formation partly because of the surface feature of the glass, like the dust and dirt particle which serves as a source point of the crystalline growth. Basically if we were to create a frost animation with would start at those points or dust/dirt particle.

File:Frost patterns 25.jpg

To know more visit Mr John W Ehman Website . http://epod.usra.edu/blog/2011/03/fern-frost.html

Major Project Revised

The decision to change to the initial Major Project was due to the fact that the initial Project was in much larger scope and this could lead into different paths such as snow accumulation, snow factory tool development and there is also the challenge of the assumed shot. This would create confusion within the overall project and I might fail to deliver the overall process.  The previous project was about the contrasting and comparing of a snow scene for example how to create a snow/ fallen snow scene in 3D and then creating another in 2D and deciding which of the two is a better approach basically this was a look in the workflow of the two process.  I failed to deliver this because of the fact that I was swimming in a large pond and no narrow idea of how to explain it to the audience of what i am doing. With this reason i needed to change the project in a much focus and straight forward route that won't compromise the quality of the major project. The idea I have settled with is one of my earlier summer idea which was the creation of a Frost shader. This will be very beneficial as i have already research some background reading on snow accumulation, ice formation and snow dynamics. This will ensure that all the past reading and research will not be a waste.

To add more as to why i am doing a frost shader is because this was my initial idea and my interest lies within creating shader as i throughly enjoy making them in the Shader/ tool Development lesson. Another reason why I am doing this is to learn more about how to create shaders and basically i am a visually derive individual basically i like creating pretty pictures. In a production reason as to why do a frost shader is because i could see it help in automating a snow challenge scene. For example it could help a shot develop the overall look of the objects that are covered with ice basically with would not just look like a with patch of snow but with some kind of ice formation. But on a simple note i can see my self using these on future projects that would involve of me having to time lapse a object which has been left out in the open environment with sub-zero temperatures.  Another example of how we can use this shader are in logo opening sequence such is shown in the trailer of Batman Arkham Origins Trailer. They showcase a 5 second scene of the Warner Brother Logo in ice or frost.






Friday, 10 January 2014

tool and shader dev assignment


Decided to look into particle exportation method into renderman system and using prman to Up-res the particle imported. Hosuk Chang gives us examples of these and he has really created interesting pieces.  the idea of our assignment is to export a particle information then render it our in Renderman. after rendering in renderman we then decide to up the value of the particle to create more points and then try do some animation sequences with like creating falling snow.