Intro to DirectX Part 3 - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Intro to DirectX Part 3

Description:

Companion to the more detailed s available on the ... Specular Maps. Detail Textures. Store Data. Up Next... Putting it all together. bovicide_at_gmail.com ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 10
Provided by: tagdC
Category:
Tags: directx | bovicide | intro | part

less

Transcript and Presenter's Notes

Title: Intro to DirectX Part 3


1
Intro to DirectX Part 3
  • Texturing

Danny Dyer
2
Information about these slides
  • Companion to the more detailed slides available
    on the TAGD resources page.
  • http//www.gettagd.com/resources.php
  • You can find the page numbers that reference the
    other slides at the bottom right of these slides.

3
Texturing
  • Objects in a scene will look very bland just
    colored and lit.
  • Texturing can add a lot of detail to a scene.
  • One step closer to being somewhat realistic.
  • What we are trying to achieve is to apply a
    texture onto some surface (or model).

4
Polygons and Vertices
  • Talked briefly about polygons and vertices
    before.
  • Lets look at the problem at a per-polygon level.
  • If we can get one polygon textured, then it will
    be easy to get all of them textured in the same
    way.
  • We need some new information at each vertex.
  • Appropriately called texture coordinates.
  • Textures can be thought of as wallpaper that is
    shrink-wrapped onto a surface.

5
Texture Coordinates
  • Texture coordinates are two-dimensional
    coordinate in texture space in the range 0.0
    1.0. (0.0, 0.0) represents the top-left side of
    the texture and (1.0, 1.0) represents the
    lower-right side of the texture.
  • Using these texture coordinates we can figure out
    which area in the texture belongs over the
    polygon.
  • Note from Nathan
  • If you cant understand this, go castrate
    yourself any questions??

6
How it works for a whole model
  • Unwrapping process of generating texture
    coordinates so that we can apply a texture to a
    model.
  • Usually dont need to know how to do this just
    that your model already has texture coordinates.

7
Syntax
  • Declare our data type
  • IDirect3DTexture9 g_pTex
  • Load in our texture can load most standard
    formats.
  • D3DXCreateTextureFromFile(pd3dDevice,
    Ltexture.bmp,g_pTex)
  • Set our texture before rendering
  • pd3dDevice-gtSetTexture(0, g_pTex)

8
Other Applications of Textures
  • Multi-texturing
  • Normal Maps
  • Specular Maps
  • Detail Textures
  • Store Data

9
Up Next
  • Putting it all together
  • bovicide_at_gmail.com
Write a Comment
User Comments (0)
About PowerShow.com