#tutorialreflection
Explore tagged Tumblr posts
Text
Week 07: Tutorial Reflection
We started off by going through some of the mid semester answers again. Then we covered Diffie Hellman Key exchange and a bit on certificates. We went through the various types of block ciphers.
ECB - Electronic Code Book
Break a message into blocks
Encipher each block seperately
Patterns persist - which is a problem
CBC - Cipher Block Chaining
Use the previous ciphertext XOR with the block -> put it through the block cipher encryption
Can’t decrypt the second without the first
Makes it more random
Very slow I think?
CTR - Counter Mode
Stream cipher
We went through Caff’s Buffer Overflow Questions!
I had no worries with 1.0 basic
It took me a while to figure out 1.1 whereamI, but that is only because I compiled with gcc instead of using the prescribed make file
Still strugging with 1.2 Blind
Finally we started the case study, which was a debate on whether or not we should have more or less surveillence. We were split into two groups and we had to debate with each other. I was on the side of less surveillence. I remember listening to somebody a long time ago (who did a lot of debating), who said that when you debate, regardless of what your personal beliefs are, when you fight for your side, you begin to believe it, even for just the duration of the debate.
I didn’t really take down notes for this part, as I was too engrossed in listening to the debate. Some of the points below I took down during the debate, others I took from the email sent by Max.
AGAINST
If we collect data now, how do we know what the future holds and how the data will be used in the future? Can we trust the people who hold this data?
Rwanda example
Census on everybodies race, it’s okay, countries relaxed
A couple of years later, that census was used to perform mass genocide
Insider attacks stealing the data
Employees abusing the data to stalk people
Data sold for money?
FOR
Help improve safety/ prevent crimes
Stop terrorist attacks
Perform better background checks
There was a point made from the FOR side which was something along the lines of we’ll get world peace. Dunno if it was serious but it got me thinking. World peace through mass surveillence sounds like a totalitarian state akin to 1984. I’d be terrified to live in one of those countries.
Personally though, obviously there’s no right answer here. I would lean slightly towards having more surveillence. But this kind of surveillence is guaranteed to draw bad people in who will abuse it for their own purposes.
0 notes
Text
Ior Tutorial Software
Software Testing Tutorial - Software testing helps to identify errors, gaps or missing requirements. Our free software testing tutorial & syllabus for beginners covers from basics to advanced automation or manual testing concepts.
Surface Type Summary. Here is an example that exercises most of the above options. There is a supply inlet on the right with a temperature of 50.0 C. On the bottom, a heater at 500 C supplies heat by convection and radiation. On the left, some of the air is exhausted with the surface temperature value of 20 C.
Individualized Training
No two athletes are the same, so individualize your training by identifying your unique physiological profile with the Power Duration Curve Model. Learn how you compare to other athlete types, find your strengths and limiters, and see the different ways your body creates and uses energy. You’ll get better results in less time with personalized training zones and optimized intervals tailored to your physiology.
Deeper Insights
WKO5 uses your data to surface valuable insights, turning analysis into answers that help guide your training decisions. WKO5 allows you to compare subjective feedback metrics from TrainingPeaks with objective data points to discover trends in your training. Ever wonder how perceived exertion affects your power, or how sleep quality influences your training intensity? Discover trends in your training by comparing subjective and objective data points.
Breakthrough Science
Know if you're overtraining—or if you're leaving too much on the table with powerful new metrics like the Training Impact Scores (TIS) and Dynamic Functional Reserve Capacity (dFRC). You can also create and analyze specific courses, intervals or segments to track how you perform over time using Smart Segments.
Getting started with Jira tutorial: 6 basic steps. Before you begin this tutorial, sign up for Jira Software for free. This guide will help you set up your first project, so keep this tab open while you sign up. Go on, we'll wait here. A change of either will result in the requires use if a different IOR. The IOR is generated on the OmniORB name server platform by omniNames. This IOR will then used in all the omniORB.cfg files for all the CORBA client and server computer systems. Notes: The default port is 2809 which complies with OMG's COS naming service protocol. Singularity provides a single universal on-ramp from developers’ workstations to local resources, the cloud, and all the way to edge. USERS OF SINGULARITY CAN BUILD APPLICATIONS ON THEIR DESKTOPS AND RUN HUNDREDS OR THOUSANDS OF INSTANCES—WITHOUT CHANGE—ON ANY PUBLIC CLOUD OR OUT TO THE COMPUTATIONAL EDGE.
Introduction to Shading
Software Ior Tutorial
Reflection, Refraction (Transmission) and Fresnel
Reflection and refraction are very common in the real world and can be observed every day. Glass or water are two very common materials which exhibit both properties. Light can pass through them, a phenomenon we call transmission and they can reflect light at the same time. The important question we will need to answer in this chapter is how do we know how much light is transmitted versus how much light is reflected? To answer this question, we will need to learn about the Fresnel effect. Other materials are opaque and can not transmit any light though they can certainly reflect it very well. This is the case for example of metals.
In this chapter, we will learn about simulating reflection, refraction (transmission) and the Fresnel effect which defines for transparent materials such as glass and water how much light is reflected vs. how much light is transmitted.
Reflection
Figure 1: the angle of incidence and the angle of reflection are equal.
Figure 2: computing the reflection direction can be done using simple geometry.
Let's start with reflection which is almost the simplest form of light-matter interaction. Reflection is the result of what happens to a photon, or an incident light beam if you are not familiar with the concept of photon, when it hits the surface of a reflective surface such as glass, water, or a sheet of aluminium for example. What happens to this photon, is very similar to what happens to a tennis ball when it hits the surface of the floor. It bounces back in a direction which is symmetrical to the incident direction about the surface normal at the point of impact as shown in figure 1. In other words, if the angle between the incident direction and the surface normal is denoted (theta_i) and the angle between the reflected direction and the surface normal is (theta_r), then (theta_i = theta_r). Simple! This is called the law of reflection.
Computing the reflection direction when the incident direction and the surface normal are known is very simple. As you can see in figure 2, the vectors I and R can be expressed in terms of the vector A and B:
$$ begin(array)(l) I &=& A + B, R &=& A - B. end(array) $$
The vector (B) can easily be computed. It is the projection of the vector (I) or (R) onto the vector (N). As explained in the lesson on geometry (check the dot product paragraph), this can be computed using the following equation:
$$B = cos(theta) * N.$$
The term (cos(theta)) is of course equal to: (N.I). It is the dot product between (N) and (I).
We can now replace (B) in both equations:

$$ begin(array)(l) I &=& A + cos(theta) * N, R &=& A - cos(theta) * N. end(array) $$
We can re-write the first equation as follows:
$$A = I - cos(theta) * N.$$
We can write the second equation using this result as follows:
$$ begin(array)(l) R &=& I - cos(theta) * N - cos(theta) * N, R &=& I - 2cos(theta) N, R &=& I - 2(N cdot I)N. end(array) $$
Figure 3: the eye only 'sees' the image of the object whose reflection direction coincidences with the view direction.
Ior Tutorial Software For Beginners
A reflection of a light ray can only be seen if the reflected ray direction is traveling in the same direction that then view direction. In figure 3, you can see the reflection of three rays with distinct incident directions and distinct colors. While the light beams intersects the surface in the same exact point on the surface, the observer will only see the reflection of the ray in the middle (the ray with the orange color). If you fix the view direction and change the direction of the incident ray in the middle even just slightly, then the observer will stop seeing the reflection of that ray. To see the reflection of the ray again, the observer would need to change his/her position to align his/her view direction with the direction of the orange reflected ray. If the direction of the incident is fixed but that the observer moves, then if the view direction is aligned with the reflection direction of the red, orange and green reflected ray successively, then the viewer would see in turn a red, orange and then green point on the surface of the object. This is very similar to what happens when we observe the reflection of the sun by a wavy water surface. We can see the reflection of the sun when the angle of the wave with respect to the viewer is right but because the shape of the wave changes rapidly the reflection can appear as well as disappear quickly (glittering effect).
The fact that the reflected image of the objects in the scene from which these light rays are emitted changes with the view direction, is the reason why we say that reflection is view dependent. If you look at the reflection of a static object in the mirror and change direction, you will see that the image of that object changes. This is something that we find natural when we look at object from a different angle, but that we find maybe less natural when we change our position with respect to a mirror reflecting that same object, though the reason why this is happening is essentially the same. We look at a different part of the object. By opposition we say that diffuse reflections are view independent because they don't vary with the angle of view as explained in the chapter on Lambertian material.
Figure 4: if the surface that the primary ray intersects is a mirror we then cast a ray in the reflection direction. The shaded point (P) either takes on the color of the background if the reflection ray didn't intersect any geometry or the color of the object that the reflection ray intersected otherwise.
Simulating reflection in our ray-tracer is very simple. If the object that the primary ray hit is a mirror like surface, then we compute the reflection direction using the incident view direction (the primary ray direction) and the normal of the surface at the intersection point. We then call the castRay() function recursively (the function calls itself) and assign to the primary ray color the color of the reflected ray. The reflection ray can be called a reflection or also sometimes a specular ray (we will explain what the term specular means in more detail in the next chapter). Note that this technique can only produce perfectly sharp reflections. To learn how to produce blurry or glossy reflections, please refer to the next chapter or the second lesson on shading from this section. Because the plane in our example reflects the background color when it doesn't reflect the sphere, the plane and the background image wouldn't visually be distinguishable from each other. For this reason we reduce the brightness of the reflection by a small amount (20% in our example - line 24). This is not totally wrong, as mirror like surfaces generally never reflect 100% of the incident light anyway. The Fresnel effect which we will talk about later in this chapter can also have an effect on how much light a surface reflects.
Vec3f reflect(const Vec3f &I, const Vec3f &N) ( return I - 2 * dotProduct(I, N) * N; ) Vec3f castRay( const Vec3f &orig, const Vec3f &dir, const std::vector<std::unique_ptr<Object>> &objects, const std::vector<std::unique_ptr<Light>> &lights, const Options &options, const uint32_t & depth = 0) ( if (depth > options.maxDepth) return options.backgroundColor; ... if (trace(orig, dir, objects, isect)) ( ... switch (isect.hitObject->type) ( case kDiffuse: ... case kReflection: ( Vec3f R = reflect(dir, hitNormal); hitColor += 0.8 * castRay(hitPoint + hitNormal * options.bias, R, objects, lights, options, depth + 1); break; ) ... ) ) ... return hitColor; )
Figure 5: reflection of the sphere in the plane. The attenuated the reflection to more easily differentiate the plane from the background.
Note that the process is potentially recursive. It is entirely possible to have a situation in which a ray intersects a reflective surface from which we cast another reflection ray, that will intersect in turn another reflective surface, etc. In other words, the process will keep casting reflection rays unless the ray intersects an object which is not a mirror or if it doesn't intersect anything at all (in which case we return the background color). If a ray kept reflecting other reflecting surfaces without ever reflecting anything else, we would then enter some kind of infinite recursive process. To prevent this from happening, we generally put a cap or limit on the number of recursions. The number of times a reflection ray is reflected off of surfaces is called the ray depth. When we cast a reflection ray from the primary ray, we say that the ray has a depth of 1. After two reflections, the ray has a depth of 2 and so on. The ray depth is incremented each time we call the castRay() function recursively. At the beginning of the function (line 14), we test whether the ray depth is greater than the maximum ray depth allowed. If this is the case, we stop from going any further in the execution of the function and simply return the background color (as if the ray had not intersected any object at all). Of course, introducing this cap, means that our produced image will deviate from reality. Though for most scenes using a depth much greater than 4 or 5 generally doesn't make much of visual difference. It's only when very complex transparent surfaces are rendered (such as water splashes) that using a depth much greater than 5 is necessarily for producing images that are similar to the real thing. But these cases are hopefully generally rare. Keep in mind that another reason for putting a cap on the recursion depth is also because ray-tracing is expensive. The higher the recursion the longer it will take to render a frame. Setting the maximum recursion depth is always a trade-off between image quality and render time.
Note that reflection (as many of the other shading effect we will study from now on) can be perfectly simulated with the ray-tracing algorithm. Remember that ray-tracing is essentially a technique for computing the visibility between two points. In this particular case, we compute the visibility between the point from which the ray is cast to the first surface that the ray intersects in the ray's direction (the reflection direction in this example). This is primarily why ray-tracing is better than rasterization for example when it comes to simulating effects such as reflection.
Refraction
In this lesson, we will only deal with the case of clear transparent objects. For many transparent objects light is attenuated as it travels through the medium. In this lesson we will ignore the effect of light attenuation and absorption by a medium. You will find information on this effect in the advanced lessons on shading.
Figure 7: when light rays pass from one 'transparent' medium to another, they change direction.
When light rays pass from one 'transparent' medium to another, they change direction. This phenomenon is illustrated in figure 7. As you can see the light ray represented in this figure is bent at the boundary or interface between the two mediums (this can be air-glass, air-water, glass-water, etc.). The new direction of the ray depends on two factors. The ray angle of incidence and the new medium refractive index or index of refraction (also sometimes referred to as ior). The index of refraction for glass and water is around 1.5 and 1.3 respectively. For a fixed angle of incidence, the amount of bending depends on the index of refraction. (as shown in the image below).
When light travels in vacuum, we all know that it travels at the speed of light which is often denoted with the constant (c). But when it travels through another medium, its speed decreases. If we denote the speed of light in this medium (v), then the index of refraction is simply the ratio of (c) over (v):
$$eta= dfrac(c)(v).$$
Figure 9: effect of refraction (not the inverted image of the background scene in the glass ball).
Figure 10: the reflection and refraction rays lie in the plane of incidence.
Figure 11: compute the refraction ray direction using geometry.
Refraction indices are generally denoted with the letter (eta) (the Greek letter eta). Light travels faster in water than in glass, but slower than in air (air has an refractive index very close to 1 and in CG we almost always treat air as if it was a vacuum). Refraction or the bending of light rays explains why objects seen through transparent objects such as glass or water, look deformed. It can create some really strange effects such as the illusion of a broken pen shown in figure 8. Looking at objects through a glass ball can inverse the image of the objects seen through the ball as shown in figure 9. These are some effects caused by refraction (which fits into the category of optical effects). Explaining the phenonemon of refraction is beyond the scope of this lesson. We will just stick for now to the equation that can be used to compute the refracted ray direction.
Refraction is described by the Snell's law, which states that for a given pair of media, the ratio of the sines of the angle of incidence (theta_1) and angle of refraction (theta_1) is equivalent to the opposite ratio of the indices of refraction (figure 7):
$$dfrac(sintheta_1)(sintheta_2) = dfrac(eta_2)(eta_1).$$
As you can see, the equation is really simple. We already know (theta_1), is the dot product between the incident ray direction and the surface normal as well as the refraction indices. Although how does it work in 3D space? In fact, if you look at figure 10, you can see that the incident ray, the reflected ray and the transmitted ray all lie in the same plane which is called the plane of incidence (in this plane lies the incident ray and the surface normal). In other words we can really think in terms of geometric construction in the plane of incidence. Look at figure 11. First, you can see that the vector (T) the transmission ray that we want to build, is the sum of the vector (A) and (B)
$$T = A + B.$$
(A) and (B) can easily be computed using the following two equations:
$$ begin(array)(l) A = Msin(theta_2), B = -Ncos(theta_2). end(array) $$
We already know about (N) but what about vector (M)? Well this vector can also be easily found by construction. You can see that (M) can be computed as follows:
$$M = dfrac((I + C))(sin(theta_1)).$$
The first part of the equation is simple. The term (I + C) gives a vector perpendicular to (N) or if you prefer to say it differently, tangent to the surface. Though this vector is normalized. To normalise it, you just need to divide it by (sin(theta_1)). You can see that the length of (I + C) is exactly equal to (sin(theta_1)). If the length of the unnormalized vector is 0.7 and that you divide it by 0.7, its length after the division will be 1. The vector will be normalized. We have (M) and (N). The vector (C) is simply equal as usual to:
$$C = cos(theta_1)N.$$
If we put all these elements together we get:
$$ begin(array)(l) T = A + B, T = Msin(theta_2) - Ncos(theta_2), T = dfrac((I + C)sin(theta_2))(sin(theta_1)) - Ncos(theta_2), T = dfrac((I + cos(theta_1)N)sin(theta_2))(sin(theta_1)) - Ncos(theta_2). end(array) $$
We know that (Snell's law):
$$dfrac(sin(theta_2))(sin(theta_1)) = dfrac(eta_1)(eta_2).$$
Thus:
$$T = dfrac(eta_1)(eta_2)(I + cos(theta_1)N) - Ncos(theta_2).$$
We also know that:
$$cos^2(theta) + sin^2(theta) = 1 rightarrow cos(theta) = sqrt(1 - sin^2(theta)).$$
And since:
$$sin(theta_2) = dfrac(eta_1)(eta_2) sin(theta_1).$$
We finally have:
$$T = dfrac(eta_1)(eta_2)(I + cos(theta_1)N) - Nsqrt(1 - left( dfrac(eta_1)(eta_2) right) ^2 sin^2(theta_1)).$$
If we write:
$$ begin(array)(l) eta = dfrac(eta_1)(eta_2), c_1 = cos(theta_1) = N cdot I, c_2 = sqrt(1 - left( dfrac(n_1)(n_2) right) ^2 sin^2(theta_1)) rightarrow sqrt(1 - left( dfrac(n_1)(n_2) right) ^2 (1 - cos^2(theta_1))) end(array) $$
Then:
$$ begin(array)(l) T = eta(I + c_1 N) - N c_2, T = eta I + (eta c_1 - c_2) N. end(array) $$
Figure 12: is the incident ray inside or outside the medium with the highest refraction index? If inside the object and leaving it, we then need to flip the normal direction to compute the refraction direction.
Maybe you should take a moment to contemplate the beauty of nature (and of mathematics). It was quite astonishing to think that light follows such simple mathematic geometric rules and yet, what causes the phenomenon of refraction is quite a complex physical effect. Congratulations, you now can compute the direction of the refracted ray. There are a couple of details we need to take care of though in the actual implementation of this equation. First in some cases the ray will hit the surface from outside. This is the case when the light ray enters a volume of water for example. But when the ray leaves that volume of water, the normal will be pointing on the other side of the water surface. In this particular case if we want our equation to work we will need to invert the normal direction. Finding if the incident ray hits the surface from outside or inside can simply be done by checking the sign of the dot product between the normal and the incident ray direction (as shown in figure 12). Keep in mind that the result of (cos(theta_1)) also needs to be positive. If it is negative (if the incident ray hits the surface from outside) we will need to reverse the sign of the dot product. Finally keep in mind that (eta_1) and (eta_2) are the refraction indices of the first and second medium respectively. If the ray leaves the second medium and enter the first one, we will need to inverse the order of the two medium refraction index to compute (eta).
Vec3f refract(const Vec3f &I, const Vec3f &N, const float &ior) ( Vec3f Nrefr = N; float NdotI = Nrefr.dotProduct(I); float etai = 1, etat = ior; // etai is the index of refraction of the medium the ray is in before entering the second medium if (NdotI < 0) ( // we are outside the surface, we want cos(theta) to be positive NdotI = -NdotI; ) else ( // we are inside the surface, cos(theta) is already positive but reverse normal direction Nrefr = -N; // swap the refraction indices std::swap(etai, etat); ) float eta = etai / etat; // n_1 / n_2 ... )
In this particular piece of code, ior is the refraction index of the material of the physical object the ray has either hit or is about to leave (glass, water, etc.). As stated before air has a refraction index close to 1, and for this reason, in CG, we generally ignore it. We treat air as if it was a vacuum.
One final detail needs to be accounted for. When the angle of incident is greater than some value called the critical angle, then 100% of the light incident on the surface is reflected. In another words, when the angle of incident is greater than the critical angle, there isn't any refraction at all. This only happens though when the light ray passes from one medium to another medium with a lower index of refraction, such as in the case of a water-air, diamond-water or glass-water interaction. This phenomenon is called total internal reflection.
We can compute this angle if desired, though when we compute the refraction direction, there is a simpler way of knowing when this happens. It happens when the term within the square root of the term (c_2) is negative (the square root in this case is a negative number or imaginary):
Vec3f refract(const Vec3f &I, const Vec3f &N, const float &ior) ( Vec3f Nrefr = N; ... float k = 1 - eta * eta * (1 - cosi * cosi); if (k < 0) // total internal reflection. There is no refraction in this case return 0; else eta * I + (eta * NdotI - sqrtf(k)) * Nrefr ; )
There is another way of computing or finding out when the incident light is totally reflected rather than being refracted. You need to compute the sine of the angle of refraction. If (sintheta_2) is greater than 1, then we have a case of total internal reflection. Note that this value can easily be computed using Snell's law:
float sint = etai / etat * sqrtf(std::max(0.f, 1 - cosi * cosi));
Finally here is a complete implementation of the refraction function:
Vec3f refract(const Vec3f &I, const Vec3f &N, const float &ior) ( float cosi = clamp(-1, 1, dotProduct(I, N)); float etai = 1, etat = ior; Vec3f n = N; if (cosi < 0) ( cosi = -cosi; ) else ( std::swap(etai, etat); n= -N; ) float eta = etai / etat; float k = 1 - eta * eta * (1 - cosi * cosi); return k < 0 ? 0 : eta * I + (eta * cosi - sqrtf(k)) * n; )
You can see a render of a glass sphere on the right. As in the example of the real glass ball from figure 9, you can see that the image of the background geometry is inverted in the sphere. If you follow the path of the refracted rays through the ball, you will understand why. The problem with this image though, is that it is not completely realistic. Glass spheres as well as pretty much every other transparent surface (water, diamonds, crystal, etc.) transmit as well as reflect light. They are both refractive and reflective. The problem is how do we know how much light they transmit vs. the amount of light they reflect? This ratio is actually given by the Fresnel equations which we will study next.
Fresnel
As mentioned just above, transparent objects such as glass or water are both refractive and reflective. How much light they reflect vs the amount they transmit actually depends on the angle of incidence. The amount of transmitted light increases when the angle of incidence decreases. And since by the principle of the conservation of energy, the amount of reflected light plus the amount of refracted light is necessary equal to the total amount of incident light, you can deduce that the amount of reflected light increases when the angle of incidence increases, up to 100% as the angle gets closer to 90 degrees. Technically, the edges of a glass ball are 100% reflective. In its center though, the sphere only reflects about 6% of the incident light.
The amount of reflected vs. refracted light can be computed using what we call the Fresnel equations. Explaining the origin of these equations and how they can be derived goes far beyond the level of explanation we are willing to give in this lesson. Light is composed of two perpendicular waves which we call parallel and perpendicular polarised light. Don't worry too much if you don't know about this detail. Suffice to know that we need to compute the ratio of reflected light for these two waves using two different equations (one for each type of wave) and average the results to find the solution. The two Fresnel equations are:
$$ begin(array)(l) F_(Rparallel) = left( dfrac(eta_2 costheta_1 - eta_1 cos theta_2)(eta_2 costheta_1 + eta_1 cos theta_2) right)^2, F_(Rperp) = left( dfrac(eta_1 costheta_2 - eta_2 cos theta_1)(eta_1 costheta_2 + eta_2 cos theta_1) right)^2. end(array) $$
By taking the average of the two we get the actual ratio of reflected light:

$$F_R = dfrac(1)(2)(F_(Rparallel) + F_(Rperp)).$$
The terms (eta_1), (eta_2) are the refraction indices of the two mediums. The terms (costheta_1) and (costheta_2) are the angle of incidence and refraction respectively. As mentioned before, due to conservation of energy, the ratio of refracted light can simply be computed as:
$$F_T = 1 - F_R.$$
Keep in mind that if light goes from a medium to another medium with a lower refraction index, it may be subject to the phenomenon of total internal reflection. This is obviously happening in the case of material such as glass or water, so we need to take this into account. We do so by computing as in the case of reflection, the sine of the angle of refraction or (theta_2). If (sintheta_2) is greater than 1, then we have a case of total reflection. In this particular case, there is no need to compute the Fresnels formulas. We can just set (F_R) to 1. As usual, you will need to swap the refraction indices if you find out that the incident ray is inside the object with the greatest refraction index. This can be done again by testing the sign of the cosine of the angle between the surface normal and the incident ray direction (the sign of (costheta_1)). Here is a possible implementation of the Fresnel formula:
void fresnel(const Vec3f &I, const Vec3f &N, const float &ior, float &kr) ( float cosi = clamp(-1, 1, dotProduct(I, N)); float etai = 1, etat = ior; if (cosi > 0) ( std::swap(etai, etat); ) // Compute sini using Snell's law float sint = etai / etat * sqrtf(std::max(0.f, 1 - cosi * cosi)); // Total internal reflection if (sint >= 1) ( kr = 1; ) else ( float cost = sqrtf(std::max(0.f, 1 - sint * sint)); cosi = fabsf(cosi); float Rs = ((etat * cosi) - (etai * cost)) / ((etat * cosi) + (etai * cost)); float Rp = ((etai * cosi) - (etat * cost)) / ((etai * cosi) + (etat * cost)); kr = (Rs * Rs + Rp * Rp) / 2; ) // As a consequence of the conservation of energy, transmittance is given by: // kt = 1 - kr; )
If you plot this function here is what the curves look like:
The curve on the left shows the ratio of reflected light in the case of an air-glass transition. The curve on the right shows the same ratio for a transition glass-air. As you can see, 100% of the light is reflected when we reach an angle of incidence much smaller than 90 degrees in the second cube. This is due to the phenomenon of total internal reflection.
Figure 15: the ratio of reflected light increases as the angle between the view direction and the surface normal increases.
Figure 16: the ratio of reflected light increases as the angle between the view direction and the surface normal increases.
The fresnel effect can easily be observed in nature. If you look at the picture of the lake with some mountains in the background and pebbles in the foreground at the beginning of this chapter, you can see that the reflection seems to increase with distance. Note also that while reflections are strong in the distance, we see more clearly through the water in the foreground that we do in the far distance. This is due to fresnel. The angle of incidence increases with the distance as shown in figure 16, and we know that the ratio of reflection vs. transmission increases with the angle of incidence. Thus naturally as we look in the distance, the water surface reflects more light. Though if we look almost directly down on the water surface, a few meters from where we stand, the angle incidence is low and most of the light is actually transmitted. Thus we see through the water more clearly than when we look in the distance. You can easily observe this effect on a large variety of objects: the facade of building made out of glass, glass balls which are more reflective on the edges, etc.
Implementation

Let's now put everything we learned so far, and try to reproduce the image of the pen in a glass of water. For this exercise we will just model the volume of water with a simple cylinder. To keep things simple we haven't created a model of the glass containing the volume of water. This is left as an exercise. The scene is rendered with a distance light. To keep things simple, the water volume doesn't cast shadow. Shadow casting of transparent objects will be studied in a separate lesson. The pen is rendered using a flat shading model. The rest of the scene uses smooth shading (interpolation of vertex normals). First we declare the volume model as both a reflective and refractive surface. We also added an ior member variable to the object class to store the object index of refraction:
TriangleMesh *mesh3 = loadPolyMeshFromFile('./cylinder.geo', Matrix44f::kIdentity); if (mesh3 != nullptr) ( mesh3->type = kReflectionAndRefraction; mesh3->ior = 1.3; objects.push_back(std::unique_ptr<Object>(mesh3)); )
Figure 17: because of numerical precision issues, the intersection point may actually be under the surface of the object the ray has hit. For this reason we need to push the reflection ray origin above the surface and the refracted ray origin below the surface by adding some artificial bias along the normal direction.
In the castRay function, we just added one case to the material switch. If the surface is both transparent, we then first compute the ratio of reflected light using the fresnel equation. Note that, as a small optimisation, we only compute the transmitted light if the ratio of reflected light is lower than 1 (this is not a case of total internal reflection). The reflected and refraction ray are then computed (lines 22 and 27) and the reflected and transmitted light is computed by tracing a ray in both the reflected and refracted direction. Note that we have to add a small bias again to the ray origin to avoid the phenomenon of acne which we already described in the chapters on shadows. In the case of reflection we need to push the point on the same side of the surface hit by the incident ray, and in the case of refraction, the points need to be pushed inward (figure 17).
The way we deal with acne in ray-tracing by pushing the ray origin in the normal direction is a very naive solution to this problem. Research to address this problem has been done and can be found on the web. An ideal solution is one in which the bias can be computed automatically as opposed to being fixed for the entire scene, or fixed on an object basis.
Finally the results are mixed using the result of the fresnel equation (line 32).
switch (isect.hitObject->type) ( case kDiffuse: ( ... break; ) case kReflection: ( ... break; ) case kReflectionAndRefraction: ( Vec3f refractionColor = 0; // compute fresnel float kr; fresnel(dir, hitNormal, isect.hitObject->ior, kr); bool outside = dir.dotProduct(hitNormal) < 0; Vec3f bias = options.bias * hitNormal; // compute refraction if it is not a case of total internal reflection if (kr < 1) ( Vec3f refractionDirection = refract(dir, hitNormal, isect.hitObject->ior).normalize(); Vec3f refractionRayOrig = outside ? hitPoint - bias : hitPoint + bias; refractionColor = castRay(refractionRayOrig, refractionDirection, objects, lights, options, depth + 1); ) Vec3f reflectionDirection = reflect(dir, hitNormal).normalize(); Vec3f reflectionRayOrig = outside ? hitPoint + bias : hitPoint - bias; Vec3f reflectionColor = castRay(reflectionRayOrig, reflectionDirection, objects, lights, options, depth + 1); // mix the two hitColor += reflectionColor * kr + refractionColor * (1 - kr); break; ) default: break; )
Note that the result we get is very similar to the same scene rendered with a commercial renderer (Mental Ray in this case). The difference between the two images come from the fact that in the reference image we set the max depth to 10 while in the image on right (our render), we set the max depth limit to 4. If you set the limit to 10, you will get the same image:
Note that the effect of the refracted pen in the water is very similar to the image in figure 8. While subtle, the fresnel effect on the edges of the water volume is also visible. Some people don't feel that this image is actually photo-real. Through from a physical point of view, it is. If you do not simulate the internal reflections though, you get an image like the one of the right, which might seem visual more real. This is also what the art of shading is all about. To the contrary of nature, you have a control on many different aspects of the simulation and by changing various settings (whether you similar internal reflections or not, the maximum ray depth, etc.) you can control the look of the final rendered image.
Other Things You Should Know About Reflection: Conductor and Dielectric.
This is already a long chapter in which we introduced many fondamental concepts from shading. Namely we talked about:
Reflection,
Refraction,
Fresnel,
and ray scene and bias as a side effect of using ray-tracing to compute or simulate these effects.
There is many more things to say about these different effects. For example that reflections is a wavelength effect. Indeed material do not refract light of different wavelength the same way. We will study these details later. Though one thing you may want to know before we close this chapter, is that metallic objects too reflect light. In fact, in computer graphics we like to classify materials in two broad categories: the dielectric materials and the conductor materials. Conductors as you may have guessed are metals. Metals too reflect light and they also reflect more light at grazing angle. Though the fresnel equation used to reflect the ratio of reflected light by metals is different than the one we studied in this lesson which is used to simulate the fresnel effect of dielectric materials. Dielectric are essentially non conducting materials or electric insulators for example. In this category you find things such as glass or plastic as well as water. Pure water is an electric insulator indeed. Remember the names conductor and dielectric as they are used a lot in shading and computer graphics.
0 notes
Text
Web/Identity Tutorial 22/1
This tutorial was really helpful for understanding what is needed for the identity task of this unit. Everyone got individual feedback but the points discussed were mainly generic. I have outlined key points from each section.
Portfolio Digital and Print
Images must be high quality (can be edited), Type can be adjusted, A title page that makes an impact (minimal contact details), Think about how pages work together with a grid system, Text must be minimal think like a tweet, Simple Hierarchy, 3/4 projects min 6-10 max, Start strong and end strong, Keep all original images.
Web
I think at this stage I am going to use wordpress for the hand in of this unit however I think that perhaps when I have some more time I may look to use muse as this may give me a bit more flexibility to show my identity. Although Rich said I could do this just as successfully by using wordpress as well by showing images of my identity on the home page.
CV
Look at incorporating identity, keep it simple again using hierarchy and using nice set type. We also got given a list of things to include in the CV. Think about paper stock this can be included in a spec.
For next week
Next week there will be one on one tutorials for identity and I am aiming to try and get a working idea for my portfolio, website, cv and business card to make the most of the feedback.
0 notes
Text
Week 06: Tutorial Reflection
In the tutorial this week, we covered cyber warfare. The topic was, what kind of cyber attracks will the russians use if we go to war with them?
Fake news - spread false info online, quickly spreading
It makes people mistrust the news, each other etc.
What is real what is false anymore?
Attack power grids
Attack telecommunications
EMP’s
Mass surveillence
Destroy infrastructure like water supplies
Compiled list from class
Insider attacks (military secrets)
DDOS attacks
Ransomware attacks on infrastructure
Sabotaging power
Hijack military drones
Attack GPS
Backdooring software and logging/survillence
Denial of tech gear (hardware) from enemy
I think this was like, attacking shipments
Jamming signals
Data theft
Tutorial Question - Consider the main threats we face in the cyber domain of war and produce 10 recommendations for actions to be taken
I could only come up with 5
1. Increase security on the software that controls infrastructures like electricity & water
Air gaps
Secondary backups
True, this one was too broad
2. Increased background checks for higher ups in the military + surveillence
On any worker in critical roles to be honest
Military, Government, Programmers
3. Develop our own GPS system as a backup in case the American GPS system is taken down
4. Auditing software companies to check if their workers have been compromised, or their software has been compromised
5. Funding to educate the public/workers (especially if they work in military/government) on basics of cyber security
How to watch out for social engineering etc ...
List made by the class
Compartamentalise knowledge of intelligence
Background checks on programmers
Risk type 1 / type 2 errors
What if we let someone in, who is an insider
What if we deny someone, who isn’t
Make most valuable people anonymous
Doesn’t work in a democracy
Can’t deny reputation damage
Backdoor everything now
What if it’s found out early, and it’s the reason we go to war
Virus that kills enemy data, wipes our own data if it’s been compromised
Could be too dangerous to use, leaked out early?
Stay offline if possible
Limit internet access to prevent cyber attacks
Create nationwide intranet
Prepare financial resources for war
In event of DDOS, have redundancies for online services
International war games as training
Locally sourced software & hardware
After the class, we covered buffer overflows in more details, as well as other forms of attacks like format string attacks. I thought it was really cool, I’ll try out the challenges that caff posted on open learning.
Oh also, we went through the mid sem exam in class. I was kind of confident when I left the exam room, but after going through it in class, definitely not haha. Don’t think I did that well :(
0 notes
Text
Week 04: Tutorial Reflection
In the tutorial we covered some of the theory in the course, preparing for our midsem exam. We went through bits of security, I found the video in the module 4 activities really nice by Adam Smallhorn. And then we spent some time on covering recon, active vs passive, online vs offline. Followed by some cryptography that’ll probably in the mid sems, we went through an example in class.
The case study was “Secret”, how would you go about protecting a new research lab from Google.
1. List the main things you need to protect for the new office
Access to servers / computers
Access into the building
Access to any sensitive data
Can’t risk anything being leaked out/ smuggled out/ secretly recorded
Protect the workers from harm?
2. List three features of your security
Security badges, need to be scanned in order to access the building. Security guard at gate to verify badge plus something akin to airport security, like facial recognition plus to check what you’re bringing into the lab.
Once through, you’ll need an access code to enter different parts of the building, only areas you need to be in, are the areas you can access with the access code. This stems from the compartamentalization idea, different parts of the project are held in different locations, need different badges/ security clearance in order to access them. Guards everywhere
Security check as you exit as well, to double check who you are and to check what you are bringing out
My ideas were critiqued and some interesting points were made which I agree with
Security guards everywhere - social engineering, they can be compromised
Check what you’re bringing out - what if it’s a USB? encrypted? how pedantic do you want to be
Ideas from other students:
Part 1:
IP / Physical Design / Data
Design of the place
Remote access
Insider attacks - protect from employees
Protect reputation of the company
Protect keycards / passwords/ codes
Technology used in production
Part 2:
Timelock
Access only at certain times, corrupt data if password entered incorrectly
Tap card + security has to tap their card as well
Important stuff - glass in the room, everyone can see what you’re doing
Security by hiding in plain sight - the outside of the building is plain and broken down, nobody would suspect a high tech google lab would be inside
Faraday cages - no signals can be leaked out
0 notes
Text
Week 03: Tutorial Reflection
So this weeks tutorial was based on airplane doors. The prereading was a bunch of news articles on incidents that occured during flights, revolving around airplane doors. The question in the tutorial was to give 5 recommendations on how to prevet future disasters on airplanes.
Our group came up with these:
1. Dual key system in order to access the cockpit, the keys are changed on every flight. Each staff knows only one of the two codes. This does make threatening a bigger issue, an attacker could just threaten the lives of the staff, and get them to enter the code in.
2. Lower the need for the the pilots to exit the cockpit. We could add a toilet into the cockpit so they wouldn’t need to leave. This does have an added cost associated with it. As a side note, imagine if the cockpit was similar to like a bank teller desk. Pilots are barred from leaving the cockpit, there’s a toilet in the cockpit. Food/water is passed through like a little slot, so they won’t even need to exit the cockpit for food/water. More secure, but they might go insane.
3. Aircrafts overidable from aircraft control. This does introduce a big risk that the controls could be compromised by an attacker.
4. Mandatory mental/physical health checkups. It would mainly focus on mental health, maybe mandatory checkups with a psychiatrist every two months or something. The downsides to this is, it puts a lot of pressure on the checkups, if the psychiastrist thinks theres something wrong, you could lose your job. This might lead to pilots trying to fake being fine.
5. Better quality control while manufacturing. This has an added cost associated with it. It’s mainly used in response to those news articles where the door would jam, and the co pilot couldn’t come back into the cockpit.
0 notes
Text
Week 02 Case Study Reflection - Houdini
The article in the first link for the case study material, I felt like the way that the writer wrote the article, he/she was heavily biased towards believing in mediums, going so far as to write down about houdini. The articles just talked about a lady called Mina/Margery who became a medium at the insistence of her husband who was a doctor who belived in mediums. She did a lot of seances, and was tested by a harvard committee, where houdini tried to prove she was a fraud.
Case Study Questions: How could houdini and his wife develop a protocol so that when houdini passes, his wife could use a medium to contact houdini’s spirit, and that she could verify that it really was houdinis spirit.
1. State and briefly justify the most important properties your protocol should have
Using the CIA principles, our group chose authenticity as the major property
2. Give your protocol
Houdini and his wife would memorise a list of one time pads
Other groups:
1. Computable by humans, high enough entrophy/randomness
2. list of ordered random words - greeting “handshakes”
Tutors sample answer:
Keep asking questions about their personal life until they’re content
After the tute, I was thinking about it and I came up with a similar idea to the OTP answer. So houdini and his wife would both memorise a list of phrases. Each phrase is matched to another phrase. For example, if the wife says “Hello my darling”, the expected response back should be “Hello my beautiful wife”. If the response is even slightly different, she would know that the medium is fake. The trick would be to create a list of phrases that are innoculus enough yet unique enough that it wouldn’t accidently be said by the medium. The other trick would be kind of like “security by obscurity”, if the medium says the wrong phrase back, the wife shouldn’t react at all, and should continue on with the seance as though she believed the medium was real. This way the medium would never realise the phrases were the key.
0 notes
Text
Week 08: Tutorial Reflection
Most of the tutorial was spent watching everybody’s something awesome presentation, and they were all really cool!. We didn’t end up going over the case study so I had a go at it a copy of days after the tutorial.
I haven’t watched Stargate SG1, but I have seen one and a bit seasons of Stargate Atlantis. It’s a really good show!
So the problem is, I’m Major “M”, who can speak to an alien A, but I can’t see the invisible man X (Jack, from the Youtube clip). Jack can speak to the alien, who can in turn speak to me. This does seem really similar to the Houdini case, and the question was raised in the tutorial. But it does make sense, houdini focused more on authentication, while this case study is focusing more on integrity.
Now... we can’t get Jack to do RSA in his head... if only
So how do we guarantee the integrity of our conversation, so that we know the alien is tampering with our conversation like a man in the middle attack
I remember from the BBC show Sherlock, there was a scene when Sherlock was about to open a safe, which had a trap (gun) rigged inside of it. He looked at Irene and realized it was a trap. He shouted out “Vatican Cameos”, and Holmes immediately knew there was danger. It’s a stretch but I would be hoping I would know Jack well. Maybe Jack could say something which seems innocent/random to the Alien, but to me it would immediately scream “danger, I’m/we’re in danger”. Or better yet, inspired by the Youtube clip listed on the case study page. The way Jack would talk through the alien, could be an indication of who is talking. If Jack had a very peculiar way of speaking/was very rude/worded his sentences in such a way that I knew it was Jack... that would prove integrity I think.
Looking at it, I think it still comes down to a pre-shared secret of some kind. I was thinking of asking Jack something I knew only he would know, but I guess that falls under authentication instead of integrity. So yeah, I think the best way to guarantee integrity would be to notice the wording of how “Jack” is speaking through the Alien. A very peculiar way of speaking, that screams “I am Jack” would be a viable option.
0 notes
Text
Week 05: Tutorial Reflection
We covered some of the content for the mid semester exam
The case study question was you’re the CSO of Giggle, and you’ve arranged a meeting we’re you’ll discuss the security implications of driverless cars.
1. List the assets of the company you are concerned about
Company Reputation
Stock Price
Money
Time
When I saw the word assets I just kind of jumped into a finance point of view, where money was the goal, kind of neglecting safety and lives ://
2. List the top 3 / 4 risks you are concerned about
Driving system compromised by an attacker, risking the lives of the passengers i.e. driving them into oncoming traffic or locking the doors and driving them into a river (doctor who flashbacks: Doctor Who Series 4 Episode 4 “The Sontaran Stratagem”)
Driving system has a bug, safety risk for both passengers and pedestrians
What if the car suddenly veered onto the sidewalk
Ethics - Should the car swerve to avoid a pedestrian, risking the life of the passenger?
3. What the company should do to address each risk
Don’t let the car start until the latest security patches are installed
Defintely make manual driving an option - kind of like the AI driving the car is the autopilot, and you can switch it off anytime
4. Should we continue with the project
Yes, AI is the future
Automation is taking over, from self service checkouts to machines that spit out cars at an insane rate, cars will be no different in the future
Besides, if other companies are doing it (Tesla, Audi, VW), we should as well, because $$$
Answers from other groups:
1. People, Tech/Intellectual Property, Image and reputation, Car itself, Costs, Privacy (GPS tracking, but phones do that anyways), jobs + growth, infrastructure
2. Privacy, IP Theft, insider attacks, money, corruption of the government/insider, legal issues - who to blame if an accident happens, reputation risk for damages, injury and death, hijacking, of car controls
3. Good security, minimise amount that the car connects to outside networks (decrease attack surface), stronger employee vetting, careful testing, added requirements for testing/standards (quality control)
The reveal that one of the groups had a different case study question (I think it was like, they worked for the government and wanted to analyse the impact AI cars had on safety or something), and it was interesting how they basically all said no to AI cars, while other groups mostly said yes.
0 notes
Text
Chemise - Feedback
The tutors have examined my work so far on the chemise, to improve my practice and to evaluation the work.
There are a few things on the chemise that could be improved. I have t ore do the machining of the lace trim to the neckline of the chemise, i did not notice at the time that the tension on the bobbin was not tight enough so has caused the sewing to be weak.
The sleeves are well placed however the tension on the sleeve is tighter than the main body of the fabric, this is due to too much ruching in the sleeve head. To combat this tension in later garments in make i will ruch the sleeves less, so it is the same on the sleeve and main body of garment.
Slight improvements could be made on the hem and baby locking. The hem is well sized however is slightly wobbly in places. The baby locking does not match exactly at the seams, to combat this fault in the future i will baby lock once the sleeve is sewn together rather than when it is flat.
I shall take this knowledge into the construction of the complicated garment, the blazer. I need to learn to be my own quality control. I shall do this by checking each stage, for example stitching or cutting, and make a decision weather it is good enough or weather it could be improved by redoing that area. Learning from my mistakes will overall help me improve my practice as a practitioner, after all i am here to learn and refine my skills to become successful in my future profession.
0 notes
Text
National Theatre Tour Briefing
Briefing
On Thursday 17th April we shall be going the that National Theatre costume department work rooms for a meeting about our allocated garments and then we will visit the hire department for which we are making our costumes for. I will have the opportunity to ask the tailors and dressmaker about techniques that they use, for creating the costumes for the National Theatre. I shall use this unique opportunity to gain knowledge of constructing garments and ask questions about how they have achieved their career ambitions, to help me with my own. This will help me establish the requirements for the costume I am making for their hire department.
I will need to ask some questions regarding the patterns, blazer and chemise these shall include-
Is the seam allowance included on the patterns?
what is the size of the seam allowance?
What are the pockets on the blazer; welt, jet or patch?
Are shoulder pads provided for the blazer?
This visit will be vital primary research for this project, helping me understand the purpose for the garments I shall construct. From my visit i hope to gain answers to the questions I have regarding the construction and patterns for the garments.
I am excited to experience the workroom of the work famous theatre. I will seize this opportunity by asking as many questions as possible about the garment i am to make but also what it is like to work in the Costume department at the National Theatre.
0 notes