fresnel effect lightwave

19
all you need to know about mr fresnel Topics covered: Fresnel Effects, Surface Properties, Glass, Metals Difficulty:

Upload: elinho-galvao

Post on 14-Apr-2015

126 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Fresnel Effect Lightwave

all you need to knowabout mr fresnel

Topics covered: Fresnel Effects, Surface Properties, Glass, Metals

Difficulty:

Page 2: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 2

Introduction – welcomeAugustin Jean Fresnel (1788-1827 - pronounced Frennel ) is one Frenchman that every 3D artistshould be grateful to!His life's work was varied as an engineer, mathematician and physicist, but in1815 he published his first paper on the Wave Theory of Light. Whilst this may not sound like the kind ofliterature you'd subscribe to Reader's Digest for, it began to fully explain, for the first time, some veryimportant effects observed by scientists and artists alike for many hundreds of years.

Because, in the computer age, 3D graphics software often makes use of the formulae Fresnel firstdescribed, the visual phenomena that they predict and explain have themselves become termed'Fresnel Effects'.

On the next page you can see a typical example of the 'Fresnel Effect' at work. This tutorial has beencreated to observe, explain and implement the effect within Lightwave. Enjoy!

Augustin Jean FresnelA very clever Frenchman!

Notice: The portrait of Augustin Fresnel is believed to be in the public domain. If this is not the case and you believe it is beingdisplayed iimproperly, please contact [email protected]

Page 3: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 3

Fig 1.1 shows two photos of a glass-fronted building. In the first we are looking directly through a paneof glass. Although we can see there are some reflections, we can also clearly make out the people andobjects inside. In the second photo we are still looking at the pane of glass, but this time from a muchmore acute angle. It has now become almost impossible to see inside. All we can see are thereflections from objects on our side of the glass. This is the first important observation to noteregarding the 'Fresnel effect':

Objects become more reflective the more acute the angle we look at them.

In the case of a transparent medium like glass, this also means that the material becomes lesstransparent at acute angles.

Fig1.1 - Two photos of a glass building. One front on, the other at an acute angle.

Page 4: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 4

Simple physics

Transmission and reflectance

The effect seen in the photos of Fig1.1 is a consequence of the way light behaves when it bumps intoglass. Fig2.1 demonstrates graphically what's going on. Shockwave® viewers can click and drag theeye.

Fig2.1 - Light hits a transparent surface at different angles. Reflectance and transmission change depending on the viewingangle.

When light hits glass, a percentage of it passes straight through (transmission) and a percentage isbounced back (reflectance). As the angle to the object increases, so less light is transmitted and more isreflected. From inside the building in Fig1.1, as the angle increases less light is transmitted through theglass and so we find it harder to see what's inside. From our side of the glass, more of the exteriorobjects' light becomes reflected, further obscuring the inside from view. Reflection and transmissionare therefore inversely related - as one goes up, the other goes down.

Page 5: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 5

Different materials, same effect

Different materials have different reflective and transmissive properties, but the effect always works inthe same general direction. Even totally non-transparent surfaces like stone and wood react accordingto the Fresnel principle and are in fact more reflective at acute angles (seeFig 2.2). Although thesematerials are not transparent, light is still being absorbed and scattered within. This brings us to theessence of the 'Fresnel effect':

The Fresnel principle.All real-world materials react to light differently from different viewing angles

Go out there into the real-world and try to observe this for yourselves in everyday materials.Tryparticularly hard to test the theory in ways that don't get you arrested for suspicious behaviour!

Fig2.2 - In this photo, you can see two of the granite faces of this pillar. You can see how much more reflective one is than theother due to their different viewing angles. This is the Fresnel effect at work!

Page 6: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 6

Glass v Metal

Different materials, different effects!

How pronounced the differences in reflectance are at different angles, depends to a great degree onhow conductive a material is. Conductive materials include metals - non-conductive materials includeplastics, ceramics and glass. Non-conductive materials are also known as dielectrics. Conductivematerials exhibit a much more subtle Fresnel effect than non-conductive, dielectric materials. Thismeans there is less difference in reflections at different viewing angles. For polished surfaces, our eyesuse this as an important visual cue. We get the sense that something polished is metallic because theFresnel effect is less pronounced than plastic or glass, which are dielectric in nature. Fig3.1 showsrenders of two materials. Can you tell which is meant to be ceramic and which is metal?

Fig3.1 - Apart from altering the Diffuse channels these surfaces are identical except for the differences in their Fresnel effects.Both surfaces are 85% reflective at their edges, but one is only 5% reflective when looking at it directly.

Which looks like ceramic and which looks like metal?

In Fig3.1 the non-conductive ceramic - or dielectric - is hardly reflective at all looking straight at it, butis very reflective at acute angles. The metal is slightly more reflective at the edges, but the effect ismuch more subtle. In the Pshelf metals collection we have actually exaggerated the Fresnel effect ofmetals slightly because, in the end, it looked nicer! This brings us to our second important idea:

Art is an art, not a science!

Page 7: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 7

Fig 3.2 shows the same surfaces as before but as two diagrams, showing the reflectance amounts asthe viewing angle changes. It's hard to consciously perceive these differences, because our brainscleverly process the information to produce the idea of "metal" or "plastic" or "ceramic". But as a 3Dartist it's important to realise that, subconsciously, it's these reflectance changes that are influencing ourjudgement.

Fig3.2 - Hopefully, you're thinking that the sphere on the left looks metallic and the sphere on the right looks ceramic! Thereflection amounts change as the viewing angle changes. Our eyes use this as a visual cue, telling us what a material is made

from. The bigger the difference, the more 'dielectric' the material appears.

folders v saucepans

Fig 3.3 shows two photos. We'd like you to answer a simple question about them:

Q. Which of these two objects is reflective?

Fig3.3 - Which of these two objects is reflective?

Page 8: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 8

The natural answer to give is, that the metal saucepan is reflective and the blue folder is not. Foreveryday life this conclusion is sufficient. We are all happy to observe that a mirror is reflective but awall isn't. However as an artist this isn't good enough. You must ask yourself more questions, such asthe following:

Q. If the blue folder isn't reflective, how come we can see it and know that it's blue?!

This second question requires a much deeper understanding of how light works in order to answer.Discussions about this very subject raged throughout Augustin Fresnel's own lifetime. A commonlyheld belief was that people's eyes actually emitted light and illuminated the objects all around them!The true answer to the second question is therefore not as obvious as we might like to think.

What is reflective?

OK. Let's eliminate the possibility that our eyes are sending out light particles. This is not true! A morehelpful way to think of light bouncing around our environment is as follows:

When light hits a surface, that surface can deal with the light in several ways:

• It can absorb the light and convert it into something else - usually heat.• It can ignore certain light frequencies and let them pass straight through - known as transmission

or transparency (just as glass or water lets through most visible light frequencies).• It can absorb the light but immediately reflect it back out in the general direction of where it

came from. This is known as reflection.

If, on a microscopic level, the surface is very flat and polished, all the reflected light will come back atuniform and predictable angles. This gives the surface a mirrored appearance, as with the metalsaucepan. This is known as SPECULAR reflection.

If the surface is random and rough on the microscopic level, the reflected light will be scatteredoutwards with a degree of randomness. This is a little like pool balls scattering after a break-off shot.This kind of reflection is known as DIFFUSE reflection and is what's happening to the blue folder.

The concept of two reflection types - SPECULAR and DIFFUSE - explains the differences between theappearance of the blue folder and the metal saucepan.

Page 9: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 9

When we look at the blue folder, the surface is absorbing most of the light frequencies sent into it,converting them into small amounts of heat. The exception is visible blue light, which causes thematerial's molecules to vibrate and bounce that frequency of light outwards. This is why we perceivethe surface as 'blue'. However, because the surface is also rough, the light is scattered randomly,meaning that we can't perceive any mirror-like reflections. This is DIFFUSE reflection at work.

Therefore, the complete answer to our original question is as follows:

Q. Which of these two objects is reflective?A. They both are. The folder exhibits DIFFUSE reflection, the saucepan exhibits SPECULAR

reflection.

Fig3.4 - There are two basic types of reflection - DIFFUSE and SPECULAR.

Many surfaces can show various degrees of both types of reflection; the real world is a complicatedplace! However, the sum of diffuse and specular reflection can never be greater than the amount oflight originally hitting the surface.In 3D raytracing there is no equivalent of heat conversion, so we can simplify the sum of reflectionsinto a neat formula:

The amount of light shining on a surface (100%) = Diffuse % + Reflection %

For transparent objects we need to add to this formula:

The amount of light shining on a surface (100%) = Diffuse % + Reflection % + Transparency %

This is simply a fancy way of saying that what goes in must come out! The sum of these settings shouldalways be 100%.

Page 10: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 10

Specular and the ‘specularity’ channel

Within most 3D software programs, the term 'specularity' is used in a specific context. It's importantnot to get confused here. The factual term 'Specular Reflection' refers to all mirror-like reflections. It'sonly in 3D software that the word represents something more specific. See Fig3.6The specular settingin 3D software is a workaround. It has evolved to deal with the problem of representing very brightlight sources reflecting off surfaces in 24bit color rendering. The notion of a separate specularity settinghas no basis in real life.

As a 3D artist, you need to know that whatever principle you apply to the 'Reflection' channel, youshould also apply to the 'specularity' channel. They do, in fact, both represent specular reflections in thescientific sense.

This doesn't mean that Specularity and Reflection should be set to the same number - specularity needsto be tailored to best suit each scene and surface - but if Reflection is high then Specularity should behigh also and if one is set low, then the other should be as well.

The next section uses the ideas we've learned here and implements them within a simple Lightwaveproject. Make sure you download the project files for this tutorial now from our website.

Fig3.6 - In Lightwave's Surface Editor, there are separate controls for Specularity and Reflection. In real life, there's no suchdistinction. These settings both represent Specular reflection in the scientific sense. The settings should therefore always rise

and fall in the same general direction.

Page 11: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 11

Practical – polished gold

In this practical, we're going to create a simple but gorgeous polished gold!

• Run Lightwave and load up scene [Taps_Working.lws] from the project files for this tutorial.

• Hit 'F9' to make a test render. You should see something like Fig4.1

These taps have been given a basic, muted yellow color, but no other surface properties. You can seethat they look a bit ordinary at the moment and certainly not particularly gold-like! We're going torectify this by creating a surface based on the two new principles we've learned in previous sections:

1. Objects react to light differently at different viewing angles2. Diffuse% and Reflection% should always add up to 100% on non-transparent objects.

Fig4.1 - A first render of scene [Taps_Working.lws]

Page 12: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 12

Objects react to light differently from different viewing angles

In Lightwave speak, the angle the camera presents to each point on a surface is known as the'incidence angle'. See Fig4.2. This is the equivalent of the angle that our eyes see surfaces from in reallife. Lightwave allows us to vary the properties of a surface according to its 'incidence angle' to thecamera. This is achieved through the use of Gradient Layers within the Surface Editor.

We're going to put gradient layers into the Reflection, Diffuse and Specularity channels in order tocontrol those properties of our gold surface depending on the angle each point presents to thecamera. The changes will be continuous as the objects the gold is applied to curve and flow.

Fig4.2 - The incidence angle is what we're going to use to mimic surface changes at different viewing angles.

In Lightwave, an incidence angle of 90º means the camera is looking directly at a point on the surface. An angle of 0º meansthe camera is looking straight along the edge, as with the edge of a sphere.

The gold surface needs to be applied to the faucet object (we call them 'taps' in the UK).

• Open up the Surface Editor (Cntl + F3) and select the surface 'Taps_Surface' which belongs tothe object 'bath_taps'.

Page 13: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 13

The default surface properties for 'Taps_Surface' are very basic, so we're going to start adding to theseby creating a Gradient Layer in the Reflection channel. This will control how reflective the surface isdependent on the 'incidence angle'.

• Click the 'T' symbol next to the Reflection heading.

• The texture window will open with a default texture layer already created. We need to changethe type of this layer to a gradient. Do this by selecting the 'Gradient' option from the 'LayerType' dropdown, located in the top right corner of the texture window.

A gradient layer with default settings will appear. Fig4.3 shows an example gradient layer. By using'incidence angle' as the Input Parameter, we'll be able to vary the Reflection amounts across thissurface.

Fig4.3 - This gradient has been assigned 'incidence angle' as the Input Parameter.We're going to do this also, in order to control the Reflections across our gold surface.

Page 14: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 14

• Change the Input Parameter of your newly created gradient layer to 'Incidence Angle'.

Look at the Start and End range of this gradient, located at the top and bottom of the gradient bar.You'll see that at the top is 0º, which represents totally oblique angles to the camera; at the bottom is90º, which represents the surface when the camera is directly facing it.

Fig4.4 shows a graph which represents a good approximation to the way gold reflects dependent onthe viewing angle. These figures are slightly altered from reality, but have been arrived at throughmany boring hours of experimentation in Lightwave!

Fig4.4 - This graph represents the figures for Reflection we're going to recreate using a gradient layer. You may rememberfrom earlier sections that because gold is very conductive, the differences in reflection across its surface are quite subtle.

• Using the Gradient Layer you've created in the Reflection channel, recreate the values shown inthe graph on the previous page. Fig4.5 shows you the equivalent values. New arrow Keys can becreated by simply clicking somewhere on the main gradient bar. The selected Key is yellow.

• When you've created your Key arrows as shown in Fig4.5 on the next page, hit 'F9' to makeanother test render. It should look quite different, but not quite right!

Page 15: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 15

Fig4.5 - This is the gradient for the Reflection channel of our gold surface. It shows the settings for the Key at 0º.Roll over the other Key arrows to view their settings.

'Parameter' means the incidence angle and 'Value' means the Reflection% at that point.

A test render of the scene will show that our taps (faucets) are now very reflective, but also way tooyellow and bright! This is because we haven't yet conformed to our second important rule.

The amount of light shining on a surface (100%) = Diffuse % + Reflection %

At the moment, we have a flat value of 100% Diffuse adding to our already high Reflection values. Thisis creating a sum value of way above 100% right across the surface.

We can rectify this problem by creating a similar Gradient Layer in the Diffuse channel but with eachvalue just high enough, so that Diffuse% + Reflection% for each incidence angle is equal to 100%.

On the next page, Fig4.6 shows this process graphically. But first, take the following steps to create agradient layer in the Diffuse channel.

Page 16: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 16

• With your Reflection gradient still open, copy the gradient layer to the clipboard by selectingCopy > Current Layer from the top left of the texture window.

• Close the Reflection texture window by clicking 'Use Texture' from the bottom right of thewindow.

• Create a texture for the Diffuse channel by clicking the 'T' next to the Diffuse heading.

• Paste > Replace Current Layer from the top left of the texture window. Your Reflectiongradient will be copied in, ready for editing. Change the values for each Key arrow according toFig4.6 on the next page.

Using Fig4.6 below, alter the gradient layer you've added to the Diffuse channel. The Diffuse andReflection amounts for each Key 'parameter' (incidence angle) should finally add up to 100%.

• Hit F9 to make another test render when you've finished the Diffuse gradient.

Fig4.6 - Alter the Diffuse gradient layer so that its Key arrows reflect the values shown here. The sum of Reflection andDiffuse will now always add up to 100%, ensuring that our surface is not too bright or too dark, just like real life!

Page 17: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 17

The first image of Fig4.7 shows a render of the scene after we've created our Diffuse and Reflectiongradients. It looks much more metallic, but now our lovely yellow color has disappeared!

This is because we've lowered our diffuse amount which determines how much of the base colorinfluences the surface. Metals are unusual in that they can be highly SPECULAR but still retain color,which is also related to their conductive properties. Lightwave has a special setting to deal with thisissue. It's called 'Color Highlights' and can be found within the surface editor, under the 'Advanced' tab.

• Locate the 'Color Highlights' setting within the 'Advanced' tab and change it from 0% to 80%.This is a figure that, again, we've found to work well through trial and error.

• Hit 'F9' to make another test render. It should now look like the second image of Fig4.7. Thislooks much better!

Fig4.7 - two more renders of the scene [Taps_Working.lws] The first image is without Color Hilights, the second one uses asetting of 80% to restore our gorgeous gold color!

We're so nearly done! The final step we need to undertake is to put some Specularity onto the surface.This needs to be done because of something covered in previous sections:

The Specularity and Reflection settings both represent elements of the same thing - SPECULARreflection. Therefore, when one is high so the other should be as well.

This is most easily achieved by copying the gradient layer from the Reflection channel, pasting it intothe Specularity channel and tweaking the values for each Key arrow.

Page 18: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 18

• Go into the Reflection channel and Copy the gradient layer located there (Copy -> CurrentLayer)

• From the main Surface Editor, click the 'T' located next to the Specularity heading.• From within the texture window that appears - Paste -> Replace Current Layer to insert the

gradient layer. The Key arrows are now located at the correct angles.• Change the Key values to those shown in Fig4.8. Once again, we've found these figures to work

through trial and error. However, you can see for yourselves that the increase in Specularityflows in the same general direction as the increase in Reflection.

Fig4.8 - Copy these settings for your gradient layer in the Specularity Channel. These figures tend to look good for polishedmetals in Lightwave. We know this through trial and error!

Page 19: Fresnel Effect Lightwave

All you need to know about Mr Fresnel

© 2002-2003 The Worms of Art Ltd (9/5/03). All rights reserved 19

conclusion

Congratulations, your final render of [Taps_Working.lws] should look pretty spectacular! See Fig4.9

We hope you've found this tutorial useful. The ideas you've learned here are just some of the trickswe've used to create the Pshelf metals collection. Check out the Pshelf section of our website if you'reinterested in learning more about metals and surfacing in general.

email: [email protected]

Fig4.9 - The final render!