1. 首页
  2. 编程语言
  3. C++ 
  4. OpenGL 4 Shading Language Cookbook Second Edition.pdf

OpenGL 4 Shading Language Cookbook Second Edition.pdf

上传者: 2019-12-30 19:07:39上传 PDF文件 5.5MB 热度 88次
Open GL 4 Shading Language CookbookSecond editionCopyright c 2013 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrieval system, ortransmitted in any form or by any means, without the prior written permission of the publisher,except in the case of brief quotations embedded in critical articles or reviewsEvery effort has been made in the preparation of this book to ensure the accuracy of theinformation presented. However, the information contained in this book is sold withoutarranty, either express or implied. Neither the author nor Packt Publishing, and its dealersand distributors will be held liable for any damages caused or alleged to be caused directly ordirectly by this bookPackt Publishing has endeavored to provide trademark information about all of the companiesand products mentioned in this book by the appropriate use of capitals. However, PacktPublishing cannot guarantee the accuracy of this information.First published: July 2011Second edition Decem ber 2013Production Reference: 1171213Published by Packt Publishing LtdLivery place35 Livery Streetgham B3 2PB, UKSBN9781782167020packtpub coCoverImagebyAniketSawant(aniketsawantphotography@hotmail.com)CreditsAuuthorProject CoordinatorDavid wolffShiksha chaturvediReviewersProofreadersBarthomiej filipekElinorThomas le guerroue-DrevillonChris smithMuhammad mobeen movaniaDario scarpaIndexerMariamman chettiyarJaved rabbani shahGraphicsAcquisition EditorsSheetal AuteGregory WildRonak dhruvEdward gordonUsha lyerProduction coordinatorileshr. mohiLead technical editorNeeshma ramakrishnanCover workNileshr mohiteTechnical editorsKunal anil GaikwadJinesh kampaniAman preet singhAbout the AuthorDavid Wolff is an associate professor in the computer Science and computer EngineeringDepartment at pacific Lutheran University(PlU). he received a phd in Physics and an Ms inComputer Science from Oregon State University. He has been teaching computer graphics toundergraduates at PLU for over 10 years, using OpenGLAbout the reviewersBartiomiej Filipek is an experienced software developer with a passion for teachingHe has been leading open gL and graphics programming courses at Jagiellonian University inCracow for around five years now. Additionally he gives lectures and workshops about modernC++ techniques at local universitiesHis professional experience focuses mostly on native application development includingrendering systems, large-scale software development, game engines, multimediaapplications, user interfaces, GPU computing, and even biofeedbackHeshareshisprogrammingstoriesathisbloghttp://www.bfilipek.com/.Thomas le Guerroue-Drevillon is a freshly graduated software engineer having aprofound interest in mathematics and drawing, it came easily to him to mix together thesetwo passions in one field: computer graphicsOriginally French, he used up all the opportunities given by his university to study and workall around the world. It allowed him to enjoy his first international experience in Estonia, thesecond in the prestigious KAIST in South Korea, and finally ending up now in Canada.Even though his university provided the mathematical background, he got his experience withOpenGL and glsl on his own He believes that the link between the well documented API andthe shader samples is missing. Thus he naturally accepted to review this cookbook, which forhim is the material he would have loved to get a hand on when he started developing interestsin OpenGL/GLSLDr Muhammad Mobeen Movania received his Phd degree in Advance ComputerGraphics and visualization from Nanyang technological University, Singapore. After finishinghis phD, he joined Institute for Infocomm Research A-star, Singapore to work on augmentedReality based virtual Tryon and Cloth Simulation systems using GPU and openGL. Beforejoining ntu, he was a junior graphics programmer at data Communication and control (dcc)Pvt Ltd, Karachi, Pakistan. He worked on DirectX and OpenGL API for producing real-timeinteractive tactical simulators and dynamic integrated training simulators. His researchnterests include GPU-based volumetric rendering techniques, GPU technologies, real-timesoft body physics, real-time dynamic shadows, real-time collision detection and responseand hierarchical geometric data structures. He is also the author of the open cloth project(http://code.googlecom/p/opencloth),whichimplementsvariousclothsimulationalgorithmsinOpengl.Hisblog(http://mmmovania.blogspot.com)listsalotofusefulgraphics tips and tricks. When not involved with computer graphics, he composes music andis an avid squash playerDr Mobeen has published several conference and journal papers on real-time computergraphics and visualization Recently, he authored a book on OpenGL (OpenGL DevelopmentCookbook by Packt Publishing, published in 2013)which details several applied recipes usingmodern OpenGL. he has also authored a book chapter in another book(Open GL Insights byAK Peters/CRC Press, published in 2012)Dr Mobeen is currently an assistant Professor at dHA Suffa University, Karachi, Pakistanwhere he is busy nurturing young minds to become outstanding programmers andresearchers of tomorrowI would like to thank almighty aLlaH for bestowing his countless blessingson me and my family. After that, I would like to extend my gratitude towardsmy family, my parents (Mr. and Mrs. abdul aziz movania), my wife(TanveerTaji), my sisters(Mrs. Azra Saleem and Mrs. Sajida shakir), my brothers(MrKhalid Movania and Mr Abdul Majid Movania), all my nephews/nieces andmy daughter(Muntaha movania)Dario Scarpa has been coding for fun and profit for the last 15 years, and has no intentionto stop. Jumping around among IT jobs as developer/sysadmin, amateur video gameprogramming, and CS exams at the University of Salerno(Italy), he also managed to work withAdventure Productions in building Zodiac, a digital delivery platform focused on adventuregames. At the time of reviewing this book, he's about to get his Master's degree, with a thesison computer graphics that got him working intensively with-guess what-OpenGLJaved Rabbani Shah received his degree in Electrical Engineering from the university ofEngineering and Technology, Lahore, Pakistan in 2004. He started his professional careerby joining delta Indus Systems (now Vision Master Inc ) where he worked with solder pasteinspection systems for statistical process control involving technologies such as ImageProcessing, 3D Machine Vision, and FPGAs. He then joined the Embedded Systems Division ofMentor Graphics in 2007 and got the opportunity to work with the Nucleus+ real-time operatingsystem, USB 2.0 middleware, WebKit, and OpengL Es 2.0. He spearheaded the effort tointegrate OpenGL Es 2.0 features in Mentors cross-platform Inflexion 3D user interface engineHe is currently working at saffron DigItal in central London, where he is involved in workrelated to cross-platform secure video playback, DRM, and Ultraviolet technologiesIn his spare time, he likes to learn emerging technologies like OpenGL ES 3.0 and openCLwww.packtpub.comSupport files, eBooks, discount offers and moreYoumightwanttovisitwww.paCktPub.comforsupportfilesanddownloadsrelatedtoyour bookDid you know that Packt offers e Book versions of every book published, with PDF and ePubfilesavailableYoucanupgradetotheeBookversionatwww.Packtpub.comandasaprint book customer, you are entitled to a discount on the eBook copy. Get in touch with us atservice@packtpub com for more detailsAtwww.Packtpub.comyoucanalsoreadacollectionoffreetechnicalarticlessignupfor a range of free newsletters and receive exclusive discounts and offers on Packt booksand ebooksPacKtLi°http://packtlIb.Packtpub.comDo you need instant solutions to your It questions? PacktLib is Packt's online digital booklibrary. Here, you can access, read and search across Packt's entire library of booksWhy Subscribe?Fully searchable across every book published by packtCopy and paste, print and bookmark contente on demand and accessible via web browserFree Access for packt account holdersIfyouhaveanaccountwithPacktatwww.packtpub.comyoucanusethistoaccessPacktlibtoday and view nine entirely free books. Simply use your login credentials for immediate access.Table of contentsPrefaceChapter 1: Getting Started with GLSLIntroductionUsing a function loader to access the latest Open GL functionality10Using GLM for mathematics13Determining the GLsL and openGL version15Compiling a shaderLinking a shader program21Sending data to a shader using vertex attributes and vertex buffer objects 25Getting a list of active vertex input attributes and locations34Sending data to a shader using uniform variables37Getting a list of active uniform variables41Using uniform blocks and uniform buffer objects43Getting debug messages49Building a C++ shader program class52Chapter 2: The Basics of GLsL Shaders57Introduction57Implementing diffuse per-vertex shading with a single point light source60Implementing per-vertex ambient, diffuse, and specular(ADs)shading65Using functions in shadersImplementing two-sided shading75ImplementIng flat shading79Using subroutines to select shader functionality81Discarding fragments to create a perforated look86Chapter 3: Lighting, Shading, and optimization91Introduction91Shading with multiple positional lights92
下载地址
用户评论