Virtual Reality Development for the Google Daydream by Matthew Scarpino
Author:Matthew Scarpino [Scarpino, Matthew]
Language: eng
Format: azw3
Tags: Computer programming
Publisher: Quiller Technologies LLC
Published: 2017-03-28T04:00:00+00:00
10.1 Textures
Chapter 8 explained how fragment shaders assign colors to fragments and Chapter 9 explained how the Blinn-Phong Model computes colors mathematically. But in many applications, fragment shaders select colors from images. That is, the fragment shader reads (or samples) pixel data from an image and assigns the color to its fragment. The image data used in this process is stored in objects called textures.
Applying a texture to a surface is like putting up wallpaper. In both cases, blank surfaces are made more appealing by attaching decorative images. In both cases, the corners of the pattern must be carefully matched to the corners of the surface. It's also important to make sure that the pattern is oriented correctly.
But textures are easier to work with than wallpaper because there's no need to do any measuring. OpenGL will stretch or shrink the texture as needed. And if a texture needs to be reduced in size, you can tell OpenGL to use a miniaturized version of the texture called a mipmap.
The goal of this section is to explain how to apply textures in Android-GLES applications. The first part of the section presents the code needed to initialize a texture and pass it to the fragment shader. The second part explains how the fragment shader can read color data from the texture and use it to set a fragment's color. The section ends with example code that demonstrates how textures are used in practice.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12612)
Hello! Python by Anthony Briggs(9931)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9806)
The Mikado Method by Ola Ellnestam Daniel Brolund(9798)
Dependency Injection in .NET by Mark Seemann(9355)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8317)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7777)
Grails in Action by Glen Smith Peter Ledbrook(7711)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7573)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7251)
Microservices with Go by Alexander Shuiskov(7020)
Practical Design Patterns for Java Developers by Miroslav Wengner(6928)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6878)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6431)
Angular Projects - Third Edition by Aristeidis Bampakos(6294)
The Art of Crafting User Stories by The Art of Crafting User Stories(5817)
NetSuite for Consultants - Second Edition by Peter Ries(5748)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5560)
Kotlin in Action by Dmitry Jemerov(5080)
