Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and...

54
CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain Textures http://www.pling.org.uk/cs/cgv.html

Transcript of Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and...

Page 1: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

CS 148: Summer 2016Introduction of Graphics and ImagingZahid Hossain

Textures

http://www.pling.org.uk/cs/cgv.html

Page 2: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

TextureMapping§ Atechniqueforspecifyingvariationsinsurfacereflectancepropertiesofan

object§ Storethereflectanceasanimageand“map”itontotheobject§ Thestoredimageiscalledatexturemap

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 2

Page 3: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

§ Atexturemapisdefiedinitsown2Dcoordinatesystem,parameterizedby(u,v)

§ Establishacorrespondencebyassigning(u,v)coordinatestotrianglevertices

TextureCorrespondence

(0,0) (1,0)

(0,1) (1,1)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 3

Page 4: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

OpenGLTexturingSnippet

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4

Page 5: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

§ Then,foreachpixelinsideatriangle,calculatethepixel’s(u,v)texturecoordinatesusingbarycentric interpolationofthetrianglevertices’texturecoordinates

TextureCoordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 5

Page 6: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PixelColor§ Giventhepixel’s(u,v)texturecoordinates,useinterpolationinthetexture

maptofindthepixel’scolor

??

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 6

Page 7: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PixelColor:NearestNeighbor

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 7

Page 8: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PixelColor:BilinearInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 8

LinearlyInterpolate

Page 9: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PixelColor:BilinearInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 9

AnotherLinearlyIn

terpolate

Page 10: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

NearestNeighborVsBilinear

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 10

Page 11: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

NearestNeighborVsBilinear

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 11

More on this when we discuss “Sampling”

Page 12: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ScreenSpacevs.WorldSpace§ Triangleschangeshapenonlinearlyviaperspectivetransformation,

leadingtodifferentbarycentricweightsbeforeandaftertheperspectivetransformation

§ Interpolatinginscreenspaceresultsintexturedistortion§ Interpolatinginworldspacerequiresprojectingallpixellocations

backwardsfromscreenspacetoworldspace,whichisexpensive

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 12

Page 13: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

TextureDistortion

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 13

p’0

p’1

p0

p1𝑠 ≠ 0.5

𝑡 = 0.5

𝑡: Screen-spaceparameter𝑠:World-spaceparameter

Page 14: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

TextureDistortion

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 14

p’0

p’1

p0

p1𝑡 ≠ 0.5

𝑠 = 0.5

𝑠: Screen-spaceparameter𝑡:World-spaceparameter

Screen-space and World-space parameters don’t match !

Page 15: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

TextureDistortion§ Uniformincrementsalongtheedgeinworldspacedonotcorrespondtouniformincrements

alongtheedgeinscreenspace§ Barycentric interpolation (whichislinear)doesnotaccountforthisnonlinearity

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 15

Page 16: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MeshRefinement§ Refinementofthetrianglemeshimprovestheresult§ Anonlinearfunctioncanbeapproximatedasa

piecewiselinearfunctioniftheintervalsaresmallenough

§ Howeversomeerrorsarestillobvious,especiallyatT-junctionswherelevels-of-refinementchange

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 16

Subdivide

Tjunction

Page 17: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MeshRefinement

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 17

Does not work !

Page 18: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

§ Findtherelationshipbetweenthebarycentricweightsinscreenspaceandthoseinworldspace

§ Usethisrelationshiptocomputetheworldspacebarycentric weightsfromthescreenspacebarycentric weights

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 18

Page 19: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 19

Twopoints inworldspace

Page 20: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 20

Twopoints inworldspace

Interpolation inworldspace

Page 21: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 21

Twopoints inworldspace

Interpolation inworldspace

Projecttheinterpolatedpointonthescreen

Page 22: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 22

Twopoints inworldspace

Interpolation inworldspace

Projecttheinterpolatedpointonthescreen

Page 23: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 23

Interpolationofthesametwopoints inscreenspace(afterprojection)

Page 24: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 24

Interpolationofthesametwopoints inscreenspace(afterprojection)

Screenspacepointandworld-spacepointafterprojectionmustmatch

Page 25: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 25

Interpolationofthesametwopoints inscreenspace(afterprojection)

Screenspacepointandworld-spacepointafterprojectionmustmatch

Afteralgebra

Page 26: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 26

ScreenSpaceTriangle WorldSpaceTriangle

Page 27: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 27

Finally!

Page 28: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

PerspectiveCorrectInterpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 28

Finally!

Page 29: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

Aliasing

Whatweget Whatwewant

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 29

Page 30: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

Aliasing

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 30

LargetextureSmallimage

Source pixels covers many destination pixels

Page 31: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

Aliasing

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 31

LargetextureSmallimage

Source pixels covers many destination pixels

Page 32: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MIPMaps§ Multum inParvo:Muchinlittle,manyinsmallplaces

§ Precomputes thetexturemapsatmultiple resolutions, usingaveraging asalowpassfilter

§ Whentexturemapping, choosetheimagesizethatapproximatelygivesa1to1pixeltotexel correspondence

§ Theaveraging“bakes-in”allthenearbypixelsthatotherwisewouldnotbesampledcorrectly

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 32

Page 33: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MIPMaps§ 4neighboringpixelsofthehigherlevelareaveragedtoformasingle

pixelinthelowerlevel

§ Startingatabaseresolution,youcanstoreEVERYcoarserresolutioninpowersof2

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 33

Page 34: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MIPMaps§ 4neighboringpixelsofthehigherlevelareaveragedtoformasingle

pixelinthelowerlevel

§ Startingatabaseresolution,youcanstoreEVERYcoarserresolutioninpowersof2

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 34

Page 35: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MIPMaps

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 35

Page 36: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

MIPMaps

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 36

gluBuild2DMipmaps

Page 37: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

Φ

y

AssigningTextureCoordinates§ Forcertainsurfaces,the(u,v)texturecoordinatescanbegenerated

procedurally§ Example:Cylinder

§ maptheucoordinatefrom[0,1]to[0,2 π]forΦ§ mapthevcoordinatefrom[0,1]to[0,h]fory§ Thiswrapstheimagearoundthecylinder

§ Formorecomplexsurfaces,(u,v)mustbedefinedpervertexmanuallyorbyusingproxyobjects

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 37

Page 38: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProxyObjects– Step1• Assigntexturecoordinatestointermediate/proxyobjects:§ Example:Cylinder§ wraptexturearoundtheoutsideofthecylinder§ notthetoporbottom,inordertoavoiddistortingthetexture

§ Example:Cube§ unwrapthecubeandmaptextureovertheunwrappedcube§ thetextureisseamless acrosssomeoftheedges,butnotnecessarily

others

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 38

Page 39: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProxyObjects– Step2§ Maptexturecoordinatesfromtheintermediate/proxyobjecttothe

finalobject§ Threewaysofmappingaretypicallyused

§ Usetheintermediate/proxyobject’ssurfacenormal§ Usethetargetobject’ssurfacenormal§ Useraysemanatingfromcenteroftargetobject

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 39

Page 40: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

CubeMapping

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 40

http://learnopengl.com/#!Advanced-OpenGL/Cubemaps

Page 41: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 41

• TreatlightSourceasa• Renderthescenenormallyfromtheactualcamera

http://www.nvidia.com/object/Projective_Texture_Mapping.htmlSegal et.al.SIGGRAPH’92

Page 42: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing• AssignTextureCoordinates(s,t,r)toposition(x,y,z)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 42

Page 43: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing• AssignTextureCoordinates(s,t,r)toposition(x,y,z)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 43

Page 44: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing• AssignTextureCoordinates(s,t,r)toposition(x,y,z)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 44

Page 45: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing• AssignTextureCoordinates(s,t,r)toposition(x,y,z)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 45

So much work just to say (s,t,r) = (x,y,z)Much easily done in newer OpenGL

Page 46: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing

• UseasimilarView(fromthelight’spointofview)andProjectionmatrixtotransformtexturecoordinatestoNDC(-1,1)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 46

Page 47: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing

• MapNDC(-1,1)toTextureCoordinatespace(0-1)• ScaleandaddBias

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 47

Page 48: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing

• MapNDC(-1,1)toTextureCoordinatespace(0-1)• ScaleandaddBias

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 48

Finaltexturecoordinatesafterperspective-correctinterpolation of

Page 49: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing

• MapNDC(-1,1)toTextureCoordinatespace(0-1)• ScaleandaddBias

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 49

Finaltexturecoordinatesafterperspective-correctinterpolation of

Hardware does it for you :)

Page 50: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

HowToSetTextureMatrices?

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 50

Page 51: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

HowToSetTextureMatrices?

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 51

Much simpler in newer OpenGL(will discuss later)

Page 52: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing:Issues

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 52

Page 53: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

ProjectiveTexturing:Issues

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 53

SevereAliasing

Page 54: Textures - GitHub Pages · OpenGL Texturing Snippet CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4 § Then, for each pixel inside a triangle,

CS 148: Summer 2016Introduction of Graphics and ImagingZahid Hossain

Textures

http://www.pling.org.uk/cs/cgv.html