71
Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771- 001

Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Introduction to Computer Graphics

Illumination modelsPramod Merugu

U91656461

EEL 5771-001

Page 2: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Light sources

• Light source: The object that radiates energy

e.g.Sun, lamp, globe, sky…

Intensity I = (Ired , Igreen , Iblue)

If Ired = Igreen = Iblue : white light

• Point light source• Infinitely distant light sources• Directional light sources

Page 3: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Point light source

• A point source is the simplest model we can use for a light source

• We simply define:– The position of the light– The RGB values for the colour of the light

• Light is emitted in all directions• Useful for small light sources

Page 4: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Infinitely distant light sources

• A large light source, like the sun, can be modelled as a point light source with direction V and intensity I

• However, it will have very little directional effect radial intensity attenuation is not used

Page 5: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Directional light sources

• To turn a point light source into a spotlight we simply add a vector direction and an angular limit θl

Page 6: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Damping: intensity of light decreases with distance

Energy is distributed over area sphere, hence

Il = I / d2,

with d distance to light source.

In practice often too ‘aggressive’,

hence Il = I / (a0 +a1d+a2d2)

If light source at infinity: No damping with distance

Page 7: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Directed light source, spotlight:

Directed light source, spotlight:

Light is primarily send in direction of Vlight .

PQ

d.illuminate is then cos||

If

:Or d.illuminate is then coscos If

llight

l

QVPQ

PQ

Q

l

light cone

a

Vlight

Page 8: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001
Page 9: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

• More subtle: Let I decrease with increasing angle a.

decreases.light hestronger t the,larger The

. cos:usedOften

n

II nl

PQ

la

Vlight

light cone

Page 10: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001
Page 11: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Lighting and shading

• Those Were the Days……...• “In trying to improve the quality of the synthetic images, we

do not expect to be able to display the object exactly as it would appear in reality, with texture, overcast shadows, etc. We hope only to display an image that approximates the real object closely enough to provide a certain degree of realism.”

– Bui Tuong Phong, 1975• Lighting designates the interaction between materials and light

sources. The process of computing the illuminious intensity at a particular 3D point

• Shading is the process of determining the color of a pixel

Page 12: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Lighting Models

– Lambert.• Purely diffuse surfaces.

– Phong.• Adds perceptually-based specular term.

– Torrance-sparrow:• Provides a physical approximation.

Page 13: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Lambert’s Cosine Law

• The reflected luminous intensity in any direction from a perfectly diffusing surface varies as the cosine of the angle between the direction of incident light and the normal vector of the surface.

• Intuitively: cross-sectional area of the “beam” intersecting an elementof surface area is smaller for greater angles with the normal.

Page 14: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Lambert’s Cosine Law• Lambert's cosine law says that the radiant

intensity or luminous intensity observed from an ideal diffusely reflecting surface or ideal diffuse radiator is directly proportional to the cosine of the angle θ between the direction of the incident light and the surface normal.

• Ideally diffuse surfaces obey cosine law.– Often called Lambertian surfaces.

• Id = kd Iincident cos = kd Iincident (N·L).

– kd is the diffuse reflectanceof the material.

• Wavelength dependent, so usually specified as a color.

IN

Page 15: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Phong Lighting Model

• Phong adds Specular highlights.• His original formula for the Specular term:

– W(i)[cos s ]n

• s is the angle between the view and Specular reflection directions.

• “W(i) is a function which gives the ratio of the Specular reflected light and the incident light as a function of the incident angle i.”

– Ranges from 10 to 80 percent.• “n is a power which models the Specular reflected light

for each material.”– Ranges from 1 to 10

Page 16: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

• More recent formulations are slightly different.– Replace W(i) with a constant ks, independent of the incident

direction.• What do we lose when we do this?

– Is= ks Iincident cosn= ks Iincident (V·R)n.

• V is the view direction.• R is the specular reflection direction.

Page 17: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Blinn- Phong Model

• Popular variation of Phong model.• Uses the halfway vector, H.• Is = ks Iincident (N·H)n.

– H = L+V / | L+V |• Popular variation of Phong model.• Uses the halfway vector, H.• Is = ks Iincident (N·H)n.

– H = L+V / | L+V |

• Faster to compute than reflection vector.• Still view-dependent since H depends on V.

LN

HV

Page 18: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Torrance-Sparrow Model• Introduced by Torrance and Sparrow in 1967 as a theoretical

model.Introduced to CG community by Blinn in 1977.– same paper as “Halfway Vector” (Blinn-Phong).

• Attempts to provide a more physical model for specular reflections from real surfaces.– Points out that intensity of specular highlights is dependent

on the incident direction relative to normal.– Phong attempted to model this with w(i) factor?

• Back to micro facets. • Assumptions:

– Diffuse component comes from multiple reflections between facets and from internal scattering.

– Specular component of surface comes from facets oriented in direction of H.

Page 19: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

• Is = DGF / (N·V)

– D is the distribution function of the micro facet directions on the surface.

– G is the amount that facets shadow and mask each other.– F is the Fresnel reflection law.

D: Micro Facet Distribution• T-S used simple Gaussian distribution:

– D = e -()2

– = deviation angle from halfway vector, H.– = standard deviation.

• Large values = dull, small values = shiny

Page 20: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Denominator• Intensity proportional to number of facets in H direction.

– So, must account for fact that observer sees more surface area when surface is tilted.

• Change in area proportional to cosine of tilt angle.– Hence, N·V in denominator.

Page 21: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

G: Geometrical Attenuation Factor

• Remember micro facet shadowing and masking?

• Blinn derives this factor for symmetrical v-shaped groove facets.

shadow shadowMasked Light

Page 22: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

F: Fresnel Reflection

• Fraction of light incident on a facet that is actually reflected rather than absorbed.

• Function of angle of incidence and index of refraction.– F(, ).– For metals (large ), F(, ) nearly constant at 1.– For non-metals (small ), F(, ) has exponential

appearance. Near zero for = 0, to 1 at = / 2.

Page 23: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Rendering• Rendering is the process of generating an image from a 2D or 3D model

by means of computer programs. Also, the results of such a model can be called a rendering. A scene file contains objects in a strictly defined language or data structure it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene. 

• This makes the scene to look relatively realistic and predictable under virtual lighting.

• Natural processes , different patterns and all the dramatic effects with the overtime can be done by using rendering.

Page 24: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Approaching photorealism

• Pixar-quality cartoon rendering in real-time is also on its way. In 2012, Unity Technologies revealed The Butterfly Effect, a short film running in real-time in the Unity engine with Nvidia GPUs. Using techniques traditionally reserved for offline rendering, its visual quality is hard to distinguish from the work being produced by Hollywood CG studios.

Page 25: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

An image created by using POV-Ray3.6

Page 26: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Two components of light source

• Light Source Properties– Color (Wavelength(s) of light)– Shape– Direction

• Object Properties– Material– Geometry– Absorption

Page 27: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Contributions from lights

• Contribution that a light has on the surface, regardless of viewing direction.

• Diffuse surfaces, on a microscopic level, are very rough. This means that a ray of light coming in has an equal chance of being reflected in any direction.

• We will breakdown what a light does to an object into three different components. This APPROXIMATES what a light does. To actually compute the rays is too expensive to do in real-time.– Light at a pixel from a light = Ambient + Diffuse +

Specular contributions.– Ilight = Iambient + Idiffuse + Ispecular

Page 28: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Ambient Term - Background Light

• It represents the approximate contribution of the light to the general scene, regardless of location of light and object

• Indirect reflections that are too complex to completely and accurately compute

• Iambient = color

Page 29: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Attenuation

• Radial intensity attenuation• Angular intensity attenuation

Page 30: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Radial Intensity attenuation

• As light moves from a light source its intensity diminished• At any distance dl away from the light source the intensity

diminishes by a factor of • However, using the factor does not produce very good

results so we use something different• We use instead in inverse quadratic function of the form

• where the coefficients a0, a1, and a2 can be varied to produce optimal results

2210

1)(

ll

lradattendadaa

df

Page 31: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Angular intensity attenuation•We can denote Vlight as the unit vector in the direction of the light and Vobj as the unit vector from the light source to an object. The dot-product of these two vectors gives us the angle between them. If this angle is inside the light’s angular limit then the object is within the spotlight.•As well as light intensity decreasing as we move away from a light source, it also decreases angularly. A commonly used function for calculating angular attenuation is: where the attenuation exponent al is assigned some positive value and angle is measured from the cone axis

laangattenf cos)(

0

Page 32: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Spotlights

• A spotlight is a light source which has a cone of effect, eg. a desk lamp or a torch. 

• Like a directional light, it has a basic direction, but it also has a defined conic volume in which its light can fall. The angle of the cone determines how much of the scene is illuminated.

• Spotlights can also have a drop-off rate; this is the degree to which light nearer the edge of the cone becomes less and less bright compared to light at the center.

• Pointlights and spotlights are local light sources, ie. they are usually close to the observer  

Page 33: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Multiple lights in a scene

Page 34: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

• The image shows the effect of multiple lights in a scene. The landscape now includes:

--a red spotlight, positioned as above but only emitting red light (thus, it does not affect the mainly blue and green low-lying aspects of the scene)

--a green point light, positioned as above

--a blue directional light, aimed towards the far left of the scene.

Page 35: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Flaps and cones

• To restrict lights to a limited area of scene, Warn implemented flaps and cones.

• Flaps are the professional photographic lights confine the lights to a desired range in x, y and Z.

• Each light has six flaps corresponding to min and max value and also has a flag to indicate on or off state.

• If the point coordinates are with in range specified by min and max coordinates of those that are on.

Page 36: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

a. Use of X flaps in situation, Y can also restrict the light in a way that has no physical

counterpart

b. Cone with a generating angle Delta to restrict the light sourse effect

Page 37: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Illumination modelsColor of an object

Rendering without global illumination. Areas that lie outside of the ceiling lamp's direct light lack definition. For example, the lamp's housing appears completely uniform. Without the ambient light added into the render, it would appear uniformly black.

Rendering with global illumination. Light is reflected by surfaces, and colored light transfers from one surface to another. Notice how color from the red wall and green wall (not visible) reflects onto other surfaces in the scene. Also notable is the caustic projected onto the red wall from light passing through the glass sphere.

Page 38: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

• So…given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we’re � �attempting to create a realistic image, we need to simulate the lighting of the surfaces in the scene - Fundamentally simulation of physics and optics.

• Illumination : Global illumination or indirect illumination is a general name for a group of algorithms used in 3D computer graphics that are meant to add more realistic lighting to 3D scenes.

• This illumination makes images more photorealistic.• Illumination of a scene is computed and the information is

stored with the radiocity. That stored data can then be used to generate images from different viewpoints for generating walkthroughs of a scene without having to go through expensive lighting calculations repeatedly

Page 39: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Ambient occlusion Example for global illumination

• Ambient occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting.

•  Ambient occlusion can be seen as an accessibility value that is calculated for each surface point

• Ambient occlusion can be calculated as the occlusion  at a point  on a surface with normal  can be computed by integrating the visibility function over the hemisphere  with respect to projected solid angle:

• It is a technique to produce film like lightening quality with real time performance. It calculates the brightness of a pixel in relation to nearby objects in the scene.

Page 40: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

With ambient occlusion and with out ambient occlusion

Page 41: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

•Using AO the smooth shadows have been added to the image. Unlike standard shadows which appears as a solid region enclosed by blurred edges, AO based shadows have wide and smooth radiations.•Here GI calculates the color of each pixel based on the light contributed fromthe surrounding hemisphere.•The end result after a large number of raytracing operations and the AO makes the images softly lit and shadowy images with a global illumination look and the real time feel

With out ambient occlusion With ambient occlusion

Page 42: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Mechanisms of Refection

• Body reflection-Diffuse reflection• Surface reflection

-Specular reflection

source

surfacereflection

surface

incidentdirection

bodyreflection

Image Intensity = Body Reflection + Surface Reflection

Page 43: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

viewingdirection

surfaceelement

normalincidentdirection

in

v

s

d

rriif ),;,(• Lambertian BRDF is simply a constant :

• Surface appears equally bright from ALL directions! (independent of )

• Surface Radiance :

v

• Commonly used in Vision and Graphics!

snIIL di

d .cos

source intensity

source intensity I

Diffuse Reflection

Page 44: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

White-out: Snow and Overcast Skies

CAN’T perceive the shape of the snow covered terrain!

CAN perceive shape in regions lit by the street lamp!!

WHY?

Page 45: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Diffuse Reflection from Uniform Sky

• Assume Lambertian Surface with Albedo = 1 (no absorption)

• Assume Sky radiance is constant

• Substituting in above Equation:

Radiance of any patch is the same as Sky radiance !! (white-out condition)

2/

0

sincos),;,(),(),( iiiirriiiisrc

rrsurface ddfLL

skyii

src LL ),(

1

),;,( rriif

skyrr

surface LL ),(

Page 46: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Specular Reflectionsource intensity I

viewingdirectionsurface

element

normal

incidentdirection n

v

s

rspecular/mirror direction

),( ii ),( vv

),( rr

• Mirror BRDF is simply a double-delta function :

• Valid for very smooth surfaces.

• All incident light energy reflected in a SINGLE direction (only when = ).

• Surface Radiance : )()( vivisIL

v r

)()(),;,( vivisvviif

specular albedo

Page 47: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Specular reflection

• Specular reflection is the mirror-like reflection of light from a surface, in which light from a single incoming direction is reflected into a single outgoing direction.

• Specular reflection is a phenomenon in which we see an illuminated shiny surface, we observe a highlight or bright spot at certain viewing directions. Specular reflection is distinct from diffuse reflection, where incoming light is reflected in a broad range of directions.

• This bright spot is view independent as it is related to the surface normal of the object and the lights incoming direction. An ideal mirror is a purely Specular reflector.

• An example of the distinction between Specular and diffuse reflection would be glossy and matte paints. Matte paints have almost exclusively diffuse reflection, while glossy paints have both Specular and diffuse reflection.

Page 48: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Reflections on still water examples of specular reflection

Page 49: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Diffuse and Specular Reflection

diffuse specular diffuse+specular

Page 50: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Ambient light

• A surface that is not exposed to direct light may still be lit up by reflections from other nearby objects – ambient light

• The total reflected light from a surface is the sum of the contributions from light sources and reflected light

• Due to reflections on the other objects even object that are not directly lit by a light source are visible.

• To model indirect illumination a hack of ambient light is used.• No position nor direction • Constant for all surfaces in the scene• Independent on object orientation and position• Surfaces properties are to determine how much ambient light

is reflected.

Page 51: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Here the ambient light is produced by a heavy fog. It’s a neutral diffused light

Page 52: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Color component

• To see color, three essential elements must be present: light, an illuminated object, and an observer.

• We perceive electromagnetic energy having wavelengths in the range 400-700 nm as visible light.

Page 53: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Transparent objects

• Transparency is something which is completely invisible.• One color entry in a single GIF or PNG image's palette can be

defined as "transparent" rather than an actual color.• An image that is not rectangular can be filled to the required

rectangle using transparent surroundings.• Raster file formats that support transparency

include GIF, PNG, BMP, TIFF, and JPEG 2000.

Page 54: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Transparency

Transparent object:- reflected and transmitted

light- refraction- scattering

Page 55: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Snells law

• It is the relationship between angle of incidence and refraction.• Snell's law states that the ratio of the sines of the angles of

incidence and refraction is equivalent to the ratio of phase velocities in the two media, or equivalent to the reciprocal of the ratio of the indices of refraction

Page 56: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Snells law representation

Snell’s law of refraction:

N

qi

L R

T

refraction ofindex : ,sinsin i

r

ir

qi

qr

LNTr

iri

r

i

coscos

and for solve and,

,cos,1.

law, sSnell' Use

:Derivation

LNT

NTTT

r

Page 57: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Transparency 3

Thin surface:- double refraction- shift of light ray

Page 58: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Transparency 3

Very thin surface:- Discard shift

opacity :1

ncy transpara:

10

)1(

:model Simple

transrefl

t

t

t

tt

k

k

k

IkIkI

Poor result for silhouette edges…

Page 59: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Translucent objects

• Light is scattered through the object.• Incident illumination smoothed due to diffuse scattering inside

the media.• Rendering translucent materials using photon diffusion.• Combing photon tracing with diffusion for rendering the

translucent materials.• Light entering the translucent materials (e.g: milk, wax, skin,

marble ) may exit at different location and direction than it entered.

Page 60: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Opacity and multiple objects

• Opacity describes how opaque an object is. It allows you to adjust the transparency of an object.

• An opaque object is completely impervious to light, which means you cannot see through it.

• By sliding the opacity of each layer somewhere in between 0 and 100, you can overlay multiple layers on top of each other, creating a multilayer image mosaic.

Page 61: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Halftoning

• When an Image has to be displayed on a device with a much larger resolution than the original image, resolution may be traded off for dynamic range.

• In printing where dot density is very high this is usually possible.

Page 62: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Half Toning

Page 63: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Digital halftoning

Page 64: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Original

Page 65: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Half Toning

Page 66: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Dithering and Halftoning

Trade spatial for intensity resolution(works well for printing where dot printing is very high)• Thresholding. • Random dither; Robert’s algorithm• Ordered dither• Error diffusionYour eye will average over an area

- Spatial Integration

Page 67: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Dithering

Page 68: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Error Diffusion

Here the error is distributed across the layers.With this method, the average quantization error is reduced by propagating the error from each pixel to some of its neighbours in the scan order

Page 69: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Original Picture

Page 70: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Dithering resultError diffusion result

Page 71: Introduction to Computer Graphics Illumination models Pramod Merugu U91656461 EEL 5771-001

Set AccErr[] to zero;For each pixel in the image scanning from left to right: value= Pixel_value(x,y) + AccErr[x,y]; if (value > WHITE/2) {

Set_pixel(x,y, WHITE);Error = value - WHITE;}

else { Set_pixel(x,y, BLACK); Error = value - BLACK; }

if scanning from left to right { AccErr[x+1, y] += 3/8 * Error; AccErr[x, y+1] += 3/8 * Error; AccErr[x+1,y+1] += 2/8 * Error; }

Error Diffusion