SlideShare una empresa de Scribd logo
1 de 43
Beginning Direct3D Game Programming:
8. Textures
jintaeks@gmail.com
Division of Digital Contents, DongSeo University.
April 2016
Texture
 In computer graphics, a texture is a bitmap of pixel colors
that give an object the appearance of texture.
– Most textures, like bitmaps, are a two-dimensional array of color
values.
2
Texture Coordinates
 The individual color values are called a texture element, or
texel.
– Each texel has a unique address in the texture.
 Texture coordinates are in texture space.
– They are relative to the location (0,0) in the texture
3
Mapping Texels to Screen Space
 Direct3D maps texels in texture space directly to pixels in
screen space. This mapping process is actually an inverse
mapping.
– For each pixel in screen space, the corresponding texel position in
texture space is calculated.
4
Texture Coordinates and Texture Stages
 Texture coordinates are associated with textures by way of
texture stages.
 Textures get assigned to texture stages with
SetTexture(stageIndex, pTexture).
 A FVF code can define up to eight sets of texture
coordinates.
– The data is referred to with a zero based index: 0 - 7.
5
Directly Mapping Texels to Pixels
 Figure 1 shows a diagram wherein pixels are modeled as
squares. In reality, however, pixels are dots, not squares. Each
square in Figure 1 indicates the area lit by the pixel, but a
pixel is always just a dot at the center of a square.
6
 This diagram correctly shows each physical pixel as a point in
the center of each cell. The screen space coordinate (0, 0) is
located directly at the top-left pixel, and therefore at the
center of the top-left cell.
7
 Direct3D will render a quad with corners at (0, 0) and (4, 4) as
illustrated in Figure 3.
 The graphics hardware is tasked with determining which pixels
should be filled to approximate the quad. This process is
called rasterization.
8
The Problem
 Figure 6 illustrates how a quad between (0, 0) and (4, 4) is
displayed after being rasterized and textured.
9
 The texture (shown superimposed) is sampled directly at pixel
locations (shown as black dots).
 Texture coordinates are not affected by rasterization (they
remain in the projected screen-space of the original quad).
– The black dots show where the rasterization pixels are.
10
Solution
 To fix this problem, all you need to do is correctly map the
quad to the pixels to which it will be rasterized, and thereby
correctly map the texels to pixels. Figure 8 shows the results
of drawing the same quad between (-0.5, -0.5) and (3.5, 3.5).
11
Texturing Addressing Modes
 Typically, the u- and v-texture coordinates that you assign to
a vertex are in the range of 0.0 to 1.0 inclusive.
 By assigning texture coordinates outside that range, you can
create certain special texturing effects.
 You control what Direct3D does with texture coordinates that
are outside the [0.0, 1.0] range by setting the texture
addressing mode.
– Wrap Texture Address Mode
– Mirror Texture Address Mode
– Clamp Texture Address Mode
– Border Color Texture Address Mode
12
Setting the Addressing Mode
 You can set texture addressing modes for individual texture
stages by calling the IDirect3DDevice9::SetSamplerState
method.
typedef enum D3DSAMPLERSTATETYPE
{
D3DSAMP_ADDRESSU = 1,
D3DSAMP_ADDRESSV = 2,
D3DSAMP_ADDRESSW = 3,
D3DSAMP_BORDERCOLOR = 4,
D3DSAMP_MAGFILTER = 5,
D3DSAMP_MINFILTER = 6,
D3DSAMP_MIPFILTER = 7,
D3DSAMP_MIPMAPLODBIAS = 8,
D3DSAMP_MAXMIPLEVEL = 9,
D3DSAMP_FORCE_DWORD = 0x7fffffff,
} D3DSAMPLERSTATETYPE, *LPD3DSAMPLERSTATETYPE;
13
Wrap Texture Address Mode
 Direct3D repeat the texture on every integer junction.
 For example, your application creates a square primitive and
specifies texture coordinates of (0.0,0.0), (0.0,3.0), (3.0,3.0), and
(3.0,0.0).
14
Mirror Texture Address Mode
 Direct3D to mirror the texture at every integer boundary.
15
Clamp Texture Address Mode
 Direct3D to clamp your texture coordinates to the [0.0, 1.0]
range.
 That is, it applies the texture once, then expands the color of
edge pixels.
16
Border Color Texture Address Mode
 Direct3D to use an arbitrary color, known as the border color,
for any texture coordinates outside the range of 0.0 through
1.0, inclusive.
17
Texture Filtering
 When Direct3D renders a primitive, it maps the 3D primitive
onto a 2D screen. If the primitive has a texture, Direct3D must
use that texture to produce a color for each pixel in the
primitive's 2D rendered image.
 For every pixel in the primitive's on-screen image, it must
obtain a color value from the texture.
– Nearest-Point Sampling
– Bilinear Texture Filtering
– Anisotropic Texture Filtering
– Texture Filtering with Mipmaps
18
Comparison between filterings
19
Bilinear Texture Filtering
 Textures are always linearly addressed from (0.0, 0.0) at the
top-left corner to (1.0, 1.0) at the bottom-right corner as
shown in Figure 7a.
20
 Each texel is defined at the exact center of a grid cell, as
shown in Figure 7b.
21
 Calculate the weighted average of the 4 texels closest to the
sampling point.
UV: (0.5, 0.5)
 This point is at the exact border between red, green, blue, and
white texels. The color the sampler returns is gray:
– 0.25 * (255, 0, 0)
– 0.25 * (0, 255, 0)
– 0.25 * (0, 0, 255)
– + 0.25 * (255, 255, 255)
– ------------------------
– = (128, 128, 128)
22
UV: (0.5, 0.375)
 This point is at the midpoint of the border between red and
green texels.
– 0.5 * (255, 0, 0)
– 0.5 * (0, 255, 0)
– 0.0 * (0, 0, 255)
– + 0.0 * (255, 255, 255)
– ------------------------
– = (128, 128, 0)
23
UV: (0.375, 0.375)
 This is the address of the red texel, which is the returned
color (all other texels in the filtering calculation are weighted
to 0):
– 1.0 * (255, 0, 0)
– 0.0 * (0, 255, 0)
– 0.0 * (0, 0, 255)
– + 0.0 * (255, 255, 255)
– ------------------------
– = (255, 0, 0)
24
Anisotropic Texture Filtering
 The distortion visible in the texels of a 3D object whose
surface is oriented at an angle with respect to the plane of
the screen is called anisotropy.
 When a pixel from an anisotropic primitive is mapped to
texels, its shape is distorted.
 You can use anisotropic texture filtering in conjunction with
linear texture filtering or mipmap texture filtering to improve
rendering results.
25
Anisotropic Filtering enabled or not.
26
Texture Filtering with Mipmaps
 A mipmap is a sequence of textures, each of which is a
progressively lower resolution representation of the same
image.
 The height and width of each image, or level, in the mipmap
is a power of two smaller than the previous level.
27
Mipmap enabled or not
28
Texture Blending
 Direct3D can blend as many as eight textures onto primitives
in a single pass.
 An application employs multiple texture blending to apply
textures, shadows, specular lighting, diffuse lighting, and other
special effects in a single pass.
29
Texture Stages and the Texture Blending Cascade
 Direct3D supports single-pass multiple texture blending
through the use of texture stages.
 A texture stage takes two arguments and performs a
blending operation on them, passing on the result for further
processing or for rasterization.
30
 The results from one stage flow down to another stage, from
that stage to the next, and so on.
31
Texture Blending Operations and Arguments
 Applications control what information from a texture stage is
used by calling IDirect3DDevice9::SetTextureStageState.
 You can set separate operations for the color and alpha
channels, and each operation uses two arguments
 Texture blending arguments use the D3DTSS_COLORARG1,
D3DTSS_COLORARG2, D3DTSS_ALPHARG1, and
D3DTSS_ALPHARG2 members of the
D3DTEXTURESTAGESTATETYPE enumerated type.
32
D3DTEXTURESTAGESTATETYPE Type
typedef enum D3DTEXTURESTAGESTATETYPE
{
D3DTSS_COLOROP = 1,
D3DTSS_COLORARG1 = 2,
D3DTSS_COLORARG2 = 3,
D3DTSS_ALPHAOP = 4,
D3DTSS_ALPHAARG1 = 5,
D3DTSS_ALPHAARG2 = 6,
D3DTSS_BUMPENVMAT00 = 7,
D3DTSS_BUMPENVMAT01 = 8,
D3DTSS_BUMPENVMAT10 = 9,
D3DTSS_BUMPENVMAT11 = 10,
D3DTSS_TEXCOORDINDEX = 11,
D3DTSS_BUMPENVLSCALE = 22,
D3DTSS_BUMPENVLOFFSET = 23,
D3DTSS_TEXTURETRANSFORMFLAGS = 24,
D3DTSS_FORCE_DWORD = 0x7fffffff,
} D3DTEXTURESTAGESTATETYPE, *LPD3DTEXTURESTAGESTATETYPE;
33
Assigning the Current Textures
 Applications call the IDirect3DDevice9::SetTexture method to
assign textures into the set of current textures.
// This code example assumes that the variable lpd3dDev is a
// valid pointer to an IDirect3DDevice9 interface and pTexture
// is a valid pointer to an IDirect3DBaseTexture9 interface.
// Set the third texture.
d3dDevice->SetTexture(2, pTexture);
34
Creating Blending Stages
 A blending stage is a set of texture operations and their
arguments that define how textures are blended.
// This example assumes that lpD3DDev is a valid pointer to an
// IDirect3DDevice9 interface.
// Set the operation for the first texture.
d3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_ADD);
// Set argument 1 to the texture color.
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
// Set argument 2 to the iterated diffuse color.
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
35
36
Tutorial 05: Using Texture Maps
 Textures can be thought of as wallpaper that is shrink-
wrapped onto a surface.
– Step 1 - Defining a Custom Vertex Format
– Step 2 - Initializing Screen Geometry
– Step 3 - Rendering the Scene
37
Step 1 - Defining a Custom Vertex Format
 Before using textures, a custom vertex format that includes
texture coordinates must be used. Texture coordinates tell
Direct3D where to place a texture for each vector in a
primitive.
// A structure for our custom vertex type. Texture coordinates were added.
struct CUSTOMVERTEX
{
D3DXVECTOR3 position; // The position
D3DCOLOR color; // The color
FLOAT tu, tv; // The texture coordinates
};
// Custom flexible vertex format (FVF), which describes custom vertex structure
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
38
Step 2 - Initializing Screen Geometry
 Before rendering, the Texture sample project calls
InitGeometry, an application-defined function that creates a
texture and initializes the geometry for a cylinder.
if( FAILED( D3DXCreateTextureFromFile( g_pd3dDevice, "Banana.bmp"
, &g_pTexture ) ) )
return E_FAIL;
 banana.bmp
39
 The following code sample fills the vertex buffer with a
cylinder. Note that each point has the texture coordinates (tu,
tv).
for( DWORD i=0; i<50; i++ )
{
FLOAT theta = (2*D3DX_PI*i)/(50-1);
pVertices[2*i+0].position = D3DXVECTOR3( sinf(theta),-1.0f, cosf(theta) );
pVertices[2*i+0].color = 0xffffffff;
pVertices[2*i+0].tu = ((FLOAT)i)/(50-1);
pVertices[2*i+0].tv = 1.0f;
pVertices[2*i+1].position = D3DXVECTOR3( sinf(theta), 1.0f, cosf(theta) );
pVertices[2*i+1].color = 0xff808080;
pVertices[2*i+1].tu = ((FLOAT)i)/(50-1);
pVertices[2*i+1].tv = 0.0f;
}
40
Step 3 - Rendering the Scene
 In order to render an object with texture, the texture must be
set as one of the current textures.
 The next step is to set the texture stage states values.
g_pd3dDevice->SetTexture( 0, g_pTexture );
 The following code sample sets the texture stage state values
by calling the IDirect3DDevice9::SetTextureStageState method.
// Setup texture. Using textures introduces the texture stage states, which
// govern how textures get blended together (in the case of multiple
// textures) and lighting information. In this case, you are modulating
// (blending) your texture with the diffuse color of the vertices.
g_pd3dDevice->SetTexture( 0, g_pTexture );
g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
41
References
42
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks

Más contenido relacionado

La actualidad más candente

Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentationDharmesh Patel
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts
Image Interpolation Techniques with Optical and Digital Zoom ConceptsImage Interpolation Techniques with Optical and Digital Zoom Concepts
Image Interpolation Techniques with Optical and Digital Zoom Conceptsmmjalbiaty
 
A comprehensive survey of contemporary
A comprehensive survey of contemporaryA comprehensive survey of contemporary
A comprehensive survey of contemporaryprjpublications
 
ShaderX³: Geometry Manipulation - Morphing between two different objects
ShaderX³: Geometry Manipulation - Morphing between two different objectsShaderX³: Geometry Manipulation - Morphing between two different objects
ShaderX³: Geometry Manipulation - Morphing between two different objectsRonny Burkersroda
 
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGESAUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGEScsitconf
 
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGESAUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGEScscpconf
 
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space IJEEE
 
Mm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithmsMm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithmsEellekwameowusu
 
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...Ech a novel multilevel thresholding technique for minutiae based fingerprint ...
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...eSAT Publishing House
 
An efficient approach to wavelet image Denoising
An efficient approach to wavelet image DenoisingAn efficient approach to wavelet image Denoising
An efficient approach to wavelet image Denoisingijcsit
 
CS 354 Graphics Math
CS 354 Graphics MathCS 354 Graphics Math
CS 354 Graphics MathMark Kilgard
 
Image Processing
Image ProcessingImage Processing
Image ProcessingTuyen Pham
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & DescriptorsPundrikPatel
 
iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)Moniroth Suon
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantizationBCET, Balasore
 

La actualidad más candente (19)

Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentation
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts
Image Interpolation Techniques with Optical and Digital Zoom ConceptsImage Interpolation Techniques with Optical and Digital Zoom Concepts
Image Interpolation Techniques with Optical and Digital Zoom Concepts
 
A comprehensive survey of contemporary
A comprehensive survey of contemporaryA comprehensive survey of contemporary
A comprehensive survey of contemporary
 
ShaderX³: Geometry Manipulation - Morphing between two different objects
ShaderX³: Geometry Manipulation - Morphing between two different objectsShaderX³: Geometry Manipulation - Morphing between two different objects
ShaderX³: Geometry Manipulation - Morphing between two different objects
 
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGESAUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
 
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGESAUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
 
DCT
DCTDCT
DCT
 
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
 
wzhu_paper
wzhu_paperwzhu_paper
wzhu_paper
 
Mm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithmsMm chap08 -_lossy_compression_algorithms
Mm chap08 -_lossy_compression_algorithms
 
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...Ech a novel multilevel thresholding technique for minutiae based fingerprint ...
Ech a novel multilevel thresholding technique for minutiae based fingerprint ...
 
PPT s10-machine vision-s2
PPT s10-machine vision-s2PPT s10-machine vision-s2
PPT s10-machine vision-s2
 
An efficient approach to wavelet image Denoising
An efficient approach to wavelet image DenoisingAn efficient approach to wavelet image Denoising
An efficient approach to wavelet image Denoising
 
CS 354 Graphics Math
CS 354 Graphics MathCS 354 Graphics Math
CS 354 Graphics Math
 
Image Processing
Image ProcessingImage Processing
Image Processing
 
International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & Descriptors
 
iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantization
 

Destacado

Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksBeginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksBeginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeks
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeksBeginning direct3d gameprogrammingmath04_calculus_20160324_jintaeks
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksBeginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksBeginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksBeginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...JinTaek Seo
 
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksBeginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksBeginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksBeginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksJinTaek Seo
 
GDC 2016 Using Substance in Lumberyard
GDC 2016 Using Substance in LumberyardGDC 2016 Using Substance in Lumberyard
GDC 2016 Using Substance in LumberyardWes McDermott
 
中級グラフィックス入門~シャドウマッピング総まとめ~
中級グラフィックス入門~シャドウマッピング総まとめ~中級グラフィックス入門~シャドウマッピング総まとめ~
中級グラフィックス入門~シャドウマッピング総まとめ~ProjectAsura
 
HoloLens x Graphics 入門
HoloLens x Graphics 入門HoloLens x Graphics 入門
HoloLens x Graphics 入門hecomi
 

Destacado (19)

Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksBeginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
 
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksBeginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
 
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeks
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeksBeginning direct3d gameprogrammingmath04_calculus_20160324_jintaeks
Beginning direct3d gameprogrammingmath04_calculus_20160324_jintaeks
 
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksBeginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
 
Beginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksBeginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeks
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
 
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksBeginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
 
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
 
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksBeginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
 
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksBeginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
 
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksBeginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
 
GDC 2016 Using Substance in Lumberyard
GDC 2016 Using Substance in LumberyardGDC 2016 Using Substance in Lumberyard
GDC 2016 Using Substance in Lumberyard
 
中級グラフィックス入門~シャドウマッピング総まとめ~
中級グラフィックス入門~シャドウマッピング総まとめ~中級グラフィックス入門~シャドウマッピング総まとめ~
中級グラフィックス入門~シャドウマッピング総まとめ~
 
HoloLens x Graphics 入門
HoloLens x Graphics 入門HoloLens x Graphics 入門
HoloLens x Graphics 入門
 

Similar a Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks

3Dtexture_doc_rep
3Dtexture_doc_rep3Dtexture_doc_rep
3Dtexture_doc_repLiu Zhen-Yu
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture MappingMark Kilgard
 
Bt9301, computer graphics
Bt9301, computer graphicsBt9301, computer graphics
Bt9301, computer graphicssmumbahelp
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptxssuser255bf1
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_openglManas Nayak
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an ObjectAnkur Tyagi
 
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...CSCJournals
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentationManchireddy Reddy
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf AtlantaJanie Clayton
 
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION cscpconf
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clusteringishmecse13
 
The Technology behind Shadow Warrior, ZTG 2014
The Technology behind Shadow Warrior, ZTG 2014The Technology behind Shadow Warrior, ZTG 2014
The Technology behind Shadow Warrior, ZTG 2014Jarosław Pleskot
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Takao Wada
 
Ijdmta v1i1
Ijdmta v1i1Ijdmta v1i1
Ijdmta v1i1IJDMTA
 
Fuzzy c means_realestate_application
Fuzzy c means_realestate_applicationFuzzy c means_realestate_application
Fuzzy c means_realestate_applicationCemal Ardil
 

Similar a Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks (20)

3Dtexture_doc_rep
3Dtexture_doc_rep3Dtexture_doc_rep
3Dtexture_doc_rep
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
MATLAB
MATLABMATLAB
MATLAB
 
Bt9301, computer graphics
Bt9301, computer graphicsBt9301, computer graphics
Bt9301, computer graphics
 
paper
paperpaper
paper
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_opengl
 
matlab pde toolbox
matlab pde toolboxmatlab pde toolbox
matlab pde toolbox
 
A0280105
A0280105A0280105
A0280105
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
 
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...
A Simple Method to Build a Paper-Based Color Check Print of Colored Fabrics b...
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta
 
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clustering
 
The Technology behind Shadow Warrior, ZTG 2014
The Technology behind Shadow Warrior, ZTG 2014The Technology behind Shadow Warrior, ZTG 2014
The Technology behind Shadow Warrior, ZTG 2014
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5
 
Ijdmta v1i1
Ijdmta v1i1Ijdmta v1i1
Ijdmta v1i1
 
Fuzzy c means_realestate_application
Fuzzy c means_realestate_applicationFuzzy c means_realestate_application
Fuzzy c means_realestate_application
 

Más de JinTaek Seo

Neural network 20161210_jintaekseo
Neural network 20161210_jintaekseoNeural network 20161210_jintaekseo
Neural network 20161210_jintaekseoJinTaek Seo
 
05 heap 20161110_jintaeks
05 heap 20161110_jintaeks05 heap 20161110_jintaeks
05 heap 20161110_jintaeksJinTaek Seo
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseoJinTaek Seo
 
Hermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksHermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksJinTaek Seo
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seoJinTaek Seo
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksJinTaek Seo
 
Boost pp 20091102_서진택
Boost pp 20091102_서진택Boost pp 20091102_서진택
Boost pp 20091102_서진택JinTaek Seo
 
아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택JinTaek Seo
 
3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택JinTaek Seo
 
Multithread programming 20151206_서진택
Multithread programming 20151206_서진택Multithread programming 20151206_서진택
Multithread programming 20151206_서진택JinTaek Seo
 
03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택JinTaek Seo
 
20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택JinTaek Seo
 
Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택JinTaek Seo
 

Más de JinTaek Seo (14)

Neural network 20161210_jintaekseo
Neural network 20161210_jintaekseoNeural network 20161210_jintaekseo
Neural network 20161210_jintaekseo
 
05 heap 20161110_jintaeks
05 heap 20161110_jintaeks05 heap 20161110_jintaeks
05 heap 20161110_jintaeks
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo
 
Hermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksHermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeks
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks
 
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
 
Boost pp 20091102_서진택
Boost pp 20091102_서진택Boost pp 20091102_서진택
Boost pp 20091102_서진택
 
아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택
 
3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택
 
Multithread programming 20151206_서진택
Multithread programming 20151206_서진택Multithread programming 20151206_서진택
Multithread programming 20151206_서진택
 
03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택
 
20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택
 
Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택
 

Último

Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 

Último (20)

Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 

Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks

  • 1. Beginning Direct3D Game Programming: 8. Textures jintaeks@gmail.com Division of Digital Contents, DongSeo University. April 2016
  • 2. Texture  In computer graphics, a texture is a bitmap of pixel colors that give an object the appearance of texture. – Most textures, like bitmaps, are a two-dimensional array of color values. 2
  • 3. Texture Coordinates  The individual color values are called a texture element, or texel. – Each texel has a unique address in the texture.  Texture coordinates are in texture space. – They are relative to the location (0,0) in the texture 3
  • 4. Mapping Texels to Screen Space  Direct3D maps texels in texture space directly to pixels in screen space. This mapping process is actually an inverse mapping. – For each pixel in screen space, the corresponding texel position in texture space is calculated. 4
  • 5. Texture Coordinates and Texture Stages  Texture coordinates are associated with textures by way of texture stages.  Textures get assigned to texture stages with SetTexture(stageIndex, pTexture).  A FVF code can define up to eight sets of texture coordinates. – The data is referred to with a zero based index: 0 - 7. 5
  • 6. Directly Mapping Texels to Pixels  Figure 1 shows a diagram wherein pixels are modeled as squares. In reality, however, pixels are dots, not squares. Each square in Figure 1 indicates the area lit by the pixel, but a pixel is always just a dot at the center of a square. 6
  • 7.  This diagram correctly shows each physical pixel as a point in the center of each cell. The screen space coordinate (0, 0) is located directly at the top-left pixel, and therefore at the center of the top-left cell. 7
  • 8.  Direct3D will render a quad with corners at (0, 0) and (4, 4) as illustrated in Figure 3.  The graphics hardware is tasked with determining which pixels should be filled to approximate the quad. This process is called rasterization. 8
  • 9. The Problem  Figure 6 illustrates how a quad between (0, 0) and (4, 4) is displayed after being rasterized and textured. 9
  • 10.  The texture (shown superimposed) is sampled directly at pixel locations (shown as black dots).  Texture coordinates are not affected by rasterization (they remain in the projected screen-space of the original quad). – The black dots show where the rasterization pixels are. 10
  • 11. Solution  To fix this problem, all you need to do is correctly map the quad to the pixels to which it will be rasterized, and thereby correctly map the texels to pixels. Figure 8 shows the results of drawing the same quad between (-0.5, -0.5) and (3.5, 3.5). 11
  • 12. Texturing Addressing Modes  Typically, the u- and v-texture coordinates that you assign to a vertex are in the range of 0.0 to 1.0 inclusive.  By assigning texture coordinates outside that range, you can create certain special texturing effects.  You control what Direct3D does with texture coordinates that are outside the [0.0, 1.0] range by setting the texture addressing mode. – Wrap Texture Address Mode – Mirror Texture Address Mode – Clamp Texture Address Mode – Border Color Texture Address Mode 12
  • 13. Setting the Addressing Mode  You can set texture addressing modes for individual texture stages by calling the IDirect3DDevice9::SetSamplerState method. typedef enum D3DSAMPLERSTATETYPE { D3DSAMP_ADDRESSU = 1, D3DSAMP_ADDRESSV = 2, D3DSAMP_ADDRESSW = 3, D3DSAMP_BORDERCOLOR = 4, D3DSAMP_MAGFILTER = 5, D3DSAMP_MINFILTER = 6, D3DSAMP_MIPFILTER = 7, D3DSAMP_MIPMAPLODBIAS = 8, D3DSAMP_MAXMIPLEVEL = 9, D3DSAMP_FORCE_DWORD = 0x7fffffff, } D3DSAMPLERSTATETYPE, *LPD3DSAMPLERSTATETYPE; 13
  • 14. Wrap Texture Address Mode  Direct3D repeat the texture on every integer junction.  For example, your application creates a square primitive and specifies texture coordinates of (0.0,0.0), (0.0,3.0), (3.0,3.0), and (3.0,0.0). 14
  • 15. Mirror Texture Address Mode  Direct3D to mirror the texture at every integer boundary. 15
  • 16. Clamp Texture Address Mode  Direct3D to clamp your texture coordinates to the [0.0, 1.0] range.  That is, it applies the texture once, then expands the color of edge pixels. 16
  • 17. Border Color Texture Address Mode  Direct3D to use an arbitrary color, known as the border color, for any texture coordinates outside the range of 0.0 through 1.0, inclusive. 17
  • 18. Texture Filtering  When Direct3D renders a primitive, it maps the 3D primitive onto a 2D screen. If the primitive has a texture, Direct3D must use that texture to produce a color for each pixel in the primitive's 2D rendered image.  For every pixel in the primitive's on-screen image, it must obtain a color value from the texture. – Nearest-Point Sampling – Bilinear Texture Filtering – Anisotropic Texture Filtering – Texture Filtering with Mipmaps 18
  • 20. Bilinear Texture Filtering  Textures are always linearly addressed from (0.0, 0.0) at the top-left corner to (1.0, 1.0) at the bottom-right corner as shown in Figure 7a. 20
  • 21.  Each texel is defined at the exact center of a grid cell, as shown in Figure 7b. 21
  • 22.  Calculate the weighted average of the 4 texels closest to the sampling point. UV: (0.5, 0.5)  This point is at the exact border between red, green, blue, and white texels. The color the sampler returns is gray: – 0.25 * (255, 0, 0) – 0.25 * (0, 255, 0) – 0.25 * (0, 0, 255) – + 0.25 * (255, 255, 255) – ------------------------ – = (128, 128, 128) 22
  • 23. UV: (0.5, 0.375)  This point is at the midpoint of the border between red and green texels. – 0.5 * (255, 0, 0) – 0.5 * (0, 255, 0) – 0.0 * (0, 0, 255) – + 0.0 * (255, 255, 255) – ------------------------ – = (128, 128, 0) 23
  • 24. UV: (0.375, 0.375)  This is the address of the red texel, which is the returned color (all other texels in the filtering calculation are weighted to 0): – 1.0 * (255, 0, 0) – 0.0 * (0, 255, 0) – 0.0 * (0, 0, 255) – + 0.0 * (255, 255, 255) – ------------------------ – = (255, 0, 0) 24
  • 25. Anisotropic Texture Filtering  The distortion visible in the texels of a 3D object whose surface is oriented at an angle with respect to the plane of the screen is called anisotropy.  When a pixel from an anisotropic primitive is mapped to texels, its shape is distorted.  You can use anisotropic texture filtering in conjunction with linear texture filtering or mipmap texture filtering to improve rendering results. 25
  • 27. Texture Filtering with Mipmaps  A mipmap is a sequence of textures, each of which is a progressively lower resolution representation of the same image.  The height and width of each image, or level, in the mipmap is a power of two smaller than the previous level. 27
  • 29. Texture Blending  Direct3D can blend as many as eight textures onto primitives in a single pass.  An application employs multiple texture blending to apply textures, shadows, specular lighting, diffuse lighting, and other special effects in a single pass. 29
  • 30. Texture Stages and the Texture Blending Cascade  Direct3D supports single-pass multiple texture blending through the use of texture stages.  A texture stage takes two arguments and performs a blending operation on them, passing on the result for further processing or for rasterization. 30
  • 31.  The results from one stage flow down to another stage, from that stage to the next, and so on. 31
  • 32. Texture Blending Operations and Arguments  Applications control what information from a texture stage is used by calling IDirect3DDevice9::SetTextureStageState.  You can set separate operations for the color and alpha channels, and each operation uses two arguments  Texture blending arguments use the D3DTSS_COLORARG1, D3DTSS_COLORARG2, D3DTSS_ALPHARG1, and D3DTSS_ALPHARG2 members of the D3DTEXTURESTAGESTATETYPE enumerated type. 32
  • 33. D3DTEXTURESTAGESTATETYPE Type typedef enum D3DTEXTURESTAGESTATETYPE { D3DTSS_COLOROP = 1, D3DTSS_COLORARG1 = 2, D3DTSS_COLORARG2 = 3, D3DTSS_ALPHAOP = 4, D3DTSS_ALPHAARG1 = 5, D3DTSS_ALPHAARG2 = 6, D3DTSS_BUMPENVMAT00 = 7, D3DTSS_BUMPENVMAT01 = 8, D3DTSS_BUMPENVMAT10 = 9, D3DTSS_BUMPENVMAT11 = 10, D3DTSS_TEXCOORDINDEX = 11, D3DTSS_BUMPENVLSCALE = 22, D3DTSS_BUMPENVLOFFSET = 23, D3DTSS_TEXTURETRANSFORMFLAGS = 24, D3DTSS_FORCE_DWORD = 0x7fffffff, } D3DTEXTURESTAGESTATETYPE, *LPD3DTEXTURESTAGESTATETYPE; 33
  • 34. Assigning the Current Textures  Applications call the IDirect3DDevice9::SetTexture method to assign textures into the set of current textures. // This code example assumes that the variable lpd3dDev is a // valid pointer to an IDirect3DDevice9 interface and pTexture // is a valid pointer to an IDirect3DBaseTexture9 interface. // Set the third texture. d3dDevice->SetTexture(2, pTexture); 34
  • 35. Creating Blending Stages  A blending stage is a set of texture operations and their arguments that define how textures are blended. // This example assumes that lpD3DDev is a valid pointer to an // IDirect3DDevice9 interface. // Set the operation for the first texture. d3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_ADD); // Set argument 1 to the texture color. d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); // Set argument 2 to the iterated diffuse color. d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); 35
  • 36. 36
  • 37. Tutorial 05: Using Texture Maps  Textures can be thought of as wallpaper that is shrink- wrapped onto a surface. – Step 1 - Defining a Custom Vertex Format – Step 2 - Initializing Screen Geometry – Step 3 - Rendering the Scene 37
  • 38. Step 1 - Defining a Custom Vertex Format  Before using textures, a custom vertex format that includes texture coordinates must be used. Texture coordinates tell Direct3D where to place a texture for each vector in a primitive. // A structure for our custom vertex type. Texture coordinates were added. struct CUSTOMVERTEX { D3DXVECTOR3 position; // The position D3DCOLOR color; // The color FLOAT tu, tv; // The texture coordinates }; // Custom flexible vertex format (FVF), which describes custom vertex structure #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1) 38
  • 39. Step 2 - Initializing Screen Geometry  Before rendering, the Texture sample project calls InitGeometry, an application-defined function that creates a texture and initializes the geometry for a cylinder. if( FAILED( D3DXCreateTextureFromFile( g_pd3dDevice, "Banana.bmp" , &g_pTexture ) ) ) return E_FAIL;  banana.bmp 39
  • 40.  The following code sample fills the vertex buffer with a cylinder. Note that each point has the texture coordinates (tu, tv). for( DWORD i=0; i<50; i++ ) { FLOAT theta = (2*D3DX_PI*i)/(50-1); pVertices[2*i+0].position = D3DXVECTOR3( sinf(theta),-1.0f, cosf(theta) ); pVertices[2*i+0].color = 0xffffffff; pVertices[2*i+0].tu = ((FLOAT)i)/(50-1); pVertices[2*i+0].tv = 1.0f; pVertices[2*i+1].position = D3DXVECTOR3( sinf(theta), 1.0f, cosf(theta) ); pVertices[2*i+1].color = 0xff808080; pVertices[2*i+1].tu = ((FLOAT)i)/(50-1); pVertices[2*i+1].tv = 0.0f; } 40
  • 41. Step 3 - Rendering the Scene  In order to render an object with texture, the texture must be set as one of the current textures.  The next step is to set the texture stage states values. g_pd3dDevice->SetTexture( 0, g_pTexture );  The following code sample sets the texture stage state values by calling the IDirect3DDevice9::SetTextureStageState method. // Setup texture. Using textures introduces the texture stage states, which // govern how textures get blended together (in the case of multiple // textures) and lighting information. In this case, you are modulating // (blending) your texture with the diffuse color of the vertices. g_pd3dDevice->SetTexture( 0, g_pTexture ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); 41

Notas del editor

  1. When rendering 2D output using pre-transformed vertices, care must be taken to ensure that each texel area correctly corresponds to a single pixel area, otherwise texture distortion can occur.