[PDF] terminologie juridique français arabe gratuit
[PDF] repérage pavé droit exercices
[PDF] reperage espace 4eme
[PDF] oxydoréduction cuivre zinc
[PDF] motion blur photoshop traduction
[PDF] oxydoréduction pile
[PDF] la république expliquée ? ma fille extrait
[PDF] la république expliquée ? ma fille pdf
[PDF] la chose dans la clarté lunaire analyse
[PDF] autoportrait michel leiris
[PDF] les apports du judaïsme du christianisme et de l'islam ? la pensée occidentale
[PDF] gorgias platon résumé
[PDF] gorgias platon pdf
[PDF] animaux fables symbole
[PDF] quel est l'animal le plus souvent cité dans les fables de jean de la fontaine
ptg9898810www.it-ebooks.info ptg9898810
PraiseforOpenGL
R?
ProgrammingGuide,
EighthEdition
Graham,John,andBillforanamazingeffort.""
Icried,itwasmuchbetterthanCats---I
llreaditagainandagain."" ---BobKuehne,president,BlueNewtSoftware R?
ProgrammingGuidehandy.""
---MarcOlano,associateprofessor,UMBC ptg9898810 This page intentionally left blank www.it-ebooks.info ptg9898810
OpenGL
R?
ProgrammingGuide
EighthEditionwww.it-ebooks.info
ptg9898810www.it-ebooks.info ptg9898810
OpenGL
R?
ProgrammingGuide
EighthEdition
TheOfficialGuideto
LearningOpenGL
R? ,Version4.3
DaveShreiner
GrahamSellers
JohnKessenich
BillLicea-Kane
TheKhronosOpenGLARBWorkingGroup
ptg9898810 inallcapitals.
Formoreinformation,pleasecontact:
U.S.CorporateandGovernmentSales
(800)382-3419 corpsales@pearsontechgroup.com
InternationalSales
international@pearsoned.com
VisitusontheWeb:informit.com/aw
ARBWorkingGroup.---Eighthedition.
pagescm
Includesindex.
ISBN978-0-321-77303-6(pbk.:alk.paper)
T385.O6352013
006.6"63---dc232012043324
CopyrightC?2013PearsonEducation,Inc.
faxyourrequestto(201)236-3290.
ISBN-13:978-0-321-77303-6
ISBN-10:0-321-77303-9
Michigan.
ptg9898810
Tuxedo,andToby.
---DRS ---GJAS ptg9898810 This page intentionally left blank www.it-ebooks.info ptg9898810
Contents
ixwww.it-ebooks.info ptg9898810 xContentswww.it-ebooks.info ptg9898810
Contentsxiwww.it-ebooks.info
ptg9898810 xiiContentswww.it-ebooks.info ptg9898810
Contentsxiiiwww.it-ebooks.info
ptg9898810 xivContentswww.it-ebooks.info ptg9898810
Contentsxvwww.it-ebooks.info
ptg9898810 xviContentswww.it-ebooks.info ptg9898810
Contentsxviiwww.it-ebooks.info
ptg9898810 xviiiContentswww.it-ebooks.info ptg9898810
Contentsxixwww.it-ebooks.info
ptg9898810 xxContentswww.it-ebooks.info ptg9898810
Contentsxxiwww.it-ebooks.info
ptg9898810 This page intentionally left blank www.it-ebooks.info ptg9898810
Figures
attribute.112 attribute.112 frustum.207 xxiiiwww.it-ebooks.info ptg9898810 buffers.246 xxivFigureswww.it-ebooks.info ptg9898810
Figures
xxvwww.it-ebooks.info ptg9898810 function.464 example.530 xxviFigureswww.it-ebooks.info ptg9898810
Figuresxxviiwww.it-ebooks.info
ptg9898810 This page intentionally left blank www.it-ebooks.info ptg9898810
Tables
xxixwww.it-ebooks.info ptg9898810 xxxTableswww.it-ebooks.info ptg9898810
Tablesxxxiwww.it-ebooks.info
ptg9898810 xxxiiTableswww.it-ebooks.info ptg9898810
Examples
xxxiiiwww.it-ebooks.info ptg9898810 xxxivExampleswww.it-ebooks.info ptg9898810
Example6.7SimpleTextureLookupExample
Examplesxxxvwww.it-ebooks.info
ptg9898810 xxxviExampleswww.it-ebooks.info ptg9898810
Examplesxxxviiwww.it-ebooks.info
ptg9898810 xxxviiiExampleswww.it-ebooks.info ptg9898810
Example11.13SimplePer-PixelMutexUsing
Examplesxxxixwww.it-ebooks.info
ptg9898810 xlExampleswww.it-ebooks.info ptg9898810
AboutThisGuide
deliverthevisualeffectyouwant.
WhatThisGuideContains
Thisguidecontainsthefollowingchapters:
subsequentchapters. usethemwithinanapplication. techniquesinprogrammableshaders. xliwww.it-ebooks.info ptg9898810 realismandotherrenderingeffects. usingshaders. andnongraphicaluses. pipeline. browsers. transformations. usedwithinOpenGL. debugfeaturesavailablewithinOpenGL. xliiAboutThisGuidewww.it-ebooks.info ptg9898810
OpenGL.
What"sNewinThisEdition
calledthe''OrangeBook"").
WhatYouShouldKnowBeforeReadingThisGuide
experiencewiththesubject. thanonthetechniquesneededtoachievethem.
AboutThisGuidexliiiwww.it-ebooks.info
ptg9898810 searchforanswerstoyourOpenGLquestions: http://www.opengl.org/
ReviewBoardandAddison-Wesley.
programs,anddemosavailableatitsWebsite.
HowtoObtaintheSampleCode
http://www.opengl-redbook.com/
OpenGLtoanother.
xlivAboutThisGuidewww.it-ebooks.info ptg9898810 projectpageatthefollowingaddress: http://freeglut.sourceforge.net/ foundattheOpenGLWebsite"sresourcepages: http://www.opengl.org/resources/ codesamplescanbefound.
Errata
correctedassoonaspossible.
StyleConventions
Thesestyleconventionsareusedinthisguide:
commandsummariesareshadedwithgrayboxes.
AboutThisGuidexlvwww.it-ebooks.info
ptg9898810 bythesuffix. becomesunruly. xlviAboutThisGuidewww.it-ebooks.info ptg9898810
Chapter1
IntroductiontoOpenGL
ChapterObjectives
creatingcomputer-generatedimages. pipeline.
1www.it-ebooks.info
ptg9898810 do,andhowitworks. anOpenGLprogramlookslike.
OpenGLuses.
OpenGLusesincreatingimages.
theprogram.
WhatIsOpenGL?
graphicsapplications. triangles,andpatches. ptg9898810 applications. primitives. calledrasterization. position. location.
YourFirstLookatanOpenGLProgram
ptg9898810
Specifythoseobjectstoberendered.
informationtobeusedincreatinganimage. thatarespecifiedbytheirvertices. providedinExample1.1. ptg9898810 //triangles.cpp #include
usingnamespacestd; #include"vgl.h" #include"LoadShaders.h" enumVAO_IDs{Triangles,NumVAOs}; enumBuffer_IDs{ArrayBuffer,NumBuffers}; enumAttrib_IDs{vPosition=0}; GLuintVAOs[NumVAOs];
GLuintBuffers[NumBuffers];
constGLuintNumVertices=6; ptg9898810 //init void init(void) glGenVertexArrays(NumVAOs,VAOs); glBindVertexArray(VAOs[Triangles]); GLfloatvertices[NumVertices][2]={
{-0.90,-0.90},//Triangle1 {0.85,-0.90}, {-0.90,0.85}, {0.90,-0.85},//Triangle2 {0.90,0.90}, {-0.85,0.90} glGenBuffers(NumBuffers,Buffers); vertices,GL_STATIC_DRAW); ShaderInfoshaders[]={
{GL_VERTEX_SHADER,"triangles.vert"}, {GL_FRAGMENT_SHADER,"triangles.frag"}, {GL_NONE,NULL} GLuintprogram=LoadShaders(shaders);
glUseProgram(program); GL_FALSE,0,BUFFER_OFFSET(0));
glEnableVertexAttribArray(vPosition); //display void display(void) glClear(GL_COLOR_BUFFER_BIT); glBindVertexArray(VAOs[Triangles]); glFlush(); ptg9898810 //main int main(intargc,char argv) glutInit(&argc,argv); glutInitDisplayMode(GLUT_RGBA); glutInitWindowSize(512,512); glutInitContextVersion(4,3); glutCreateWindow(argv[0]); if(glewInit()){ exit(EXIT_FAILURE); init(); glutDisplayFunc(display); glutMainLoop(); anddeclareglobalvariables 1 andotherusefulprogrammingconstructs. demonstration,weusethemhere. ptg9898810 whichwedescribeinChapter6. InChapter2we"lldiscusseverythingitdoes.
examplehere. 1.ClearthewindowbycallingglClear().
OpenGLSyntax
ptg9898810 AppendixA.
OpenGLheaderfiles:glcorearb.handglext.h.
GLfloats,insteadoftwoseparateparameters.
cribedinTable1.1,alongwiththeirtypes. OpenGLSyntax9www.it-ebooks.info
ptg9898810 SuffixDataTypeTypical
Corresponding
C-LanguageType
OpenGLTypeDefinition
b8-bitintegersignedcharGLbyte s16-bitintegersignedshortGLshort i32-bitintegerintGLint,GLsizei differentimplementations. OpenGL"sRenderingPipeline
evolvedconsiderablysinceitsintroduction. Vertex
Data Geometry
Shader
Tessellation
Evaluation
Shader
Tessellation
Control
Shader
Vertex
Shader
Fragment
Shader
Primitive
Setup ClippingRasterization
Figure1.2TheOpenGLpipeline
ptg9898810 fragments. shadersareoptional. PreparingtoSendDatatoOpenGL
Chapter3.
SendingDatatoOpenGL
glDrawArrays(),aswedidinExample1.1. determinethepixel"sfinalcolor. OpenGL"".
ptg9898810 VertexShading
TessellationShading
GeometryShading
we"llseeinChapter10. PrimitiveAssembly
clippingandrasterization. ptg9898810 Clipping
OpenGL.
Rasterization
operations. FragmentShading
calledfragmentdiscard. thatfragmentwillbe. Per-FragmentOperations
ptg9898810 writtenintotheframebuffer. Chapter6.
OurFirstProgram:ADetailedDiscussion
Enteringmain()
commandshere. int main(intargc,char argv)quotesdbs_dbs7.pdfusesText_13