Constant Tiled Textures - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Constant Tiled Textures

Description:

surface tile() { Oi = 1; Ci = Oi * (s, t, 0); Textured Plane. surface tile(string tex ... Oi = float texture(tex[3], ss, tt) ... Oi = 0; float startS, startT; ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 35
Provided by: rende3
Learn more at: http://www.renderman.org
Category:
Tags: constant | oi | textures | tiled

less

Transcript and Presenter's Notes

Title: Constant Tiled Textures


1
Constant Tiled Textures
Mach Kobayashi Square USA
2
Plane
surface tile() Oi 1 Ci Oi (s, t,
0)
3
Textured Plane
surface tile(string tex "") Oi float
texture(tex3, s, t) Ci Oi texture(tex,
s, t)
4
Tiled Textured Plane
surface tile(string tex "") float ss
mod(s 5, 1) float tt mod(t 5, 1) Oi
float texture(tex3, ss, tt) Ci Oi
texture(tex, ss, tt)
5
Tiled Textured Plane
surface tile(string tex "") float ss
mod(s 5, 1) float tt mod(t 5, 1) Oi
float texture(tex3, ss, tt) Ci Oi
texture(tex, ss, tt)
6
Constant Tiled Textured Plane
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

7
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

5.0
8
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

5.0
9
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

5.0
10
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

5.0
1.25
11
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

2.5
5.0
1.25
12
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

2.5
5.0
.75
13
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

2.5
5.0
.25
14
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

.5
5.0
.75
15
Constant Tiled Textured Plane
2.5
  • how is this done?
  • for each point, look at every tile
  • calculate distance in world space
  • look up texture

.5
5.0
.25
16
World Space Distance
2.5
  • (s, t)
  • (startS, startT)
  • ss (s-startS) width,tt (t-startT) length
  • ss (.5-.4) 2.5 .25,tt (.5-.4) 5.0 .5

5.0
17
World Space Distance
2.5
  • (s, t)
  • (startS, startT)
  • ss (s-startS) width,tt (t-startT) length
  • ss (.5-.4) 2.5 .25,tt (.5-.4) 5.0 .5

5.0
(.5, .5)
18
World Space Distance
2.5
  • (s, t)
  • (startS, startT)
  • ss (s-startS) width,tt (t-startT) length
  • ss (.5-.4) 2.5 .25,tt (.5-.4) 5.0 .5

(.4, .4)
5.0
(.5, .5)
19
World Space Distance
2.5
  • (s, t)
  • (startS, startT)
  • ss (s-startS) width,tt (t-startT) length
  • ss (.5-.4) 2.5 .25,tt (.5-.4) 5.0 .5

(.4, .4)
5.0
(.5, .5)
20
World Space Distance
2.5
  • (s, t)
  • (startS, startT)
  • ss (s-startS) width,tt (t-startT) length
  • ss (.5-.4) 2.5 .25,tt (.5-.4) 5.0 .5

(.4, .4)
.5
5.0
.25
(.5, .5)
21
Calculating Length
  • consider coordinates of polygon
  • ?P/?t (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( world?, Deriv(P, t)))

22
Calculating Length
P (0, 2.5, 0)
  • consider coordinates of polygon
  • ?P/?t (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( world?, Deriv(P, t)))

P (0, -2.5, 0)
23
Calculating Length
P (0, 2.5, 0)(s, t) (0, 0)
  • consider coordinates of polygon
  • dP/dt (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( world?, Deriv(P, t)))

P (0, -2.5, 0)(s, t) (0, 1)
24
Calculating Length
P (0, 2.5, 0)(s, t) (0, 0)
  • consider coordinates of polygon
  • dP/dt (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( world?, Deriv(P, t)))

P (1.875, .25, 0)
P (1.875, 0, 0)
P (0, -2.5, 0)(s, t) (0, 1)
25
Calculating Length
P (0, 2.5, 0)(s, t) (0, 0)
  • consider coordinates of polygon
  • dP/dt (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( world?, Deriv(P, t)))

P (1.875, .25, 0)(s, t) (.75, 45)
P (1.875, 0, 0)(s, t) (.75, .5)
P (0, -2.5, 0)(s, t) (0, 1)
26
Calculating Length
P (0, 2.5, 0)(s, t) (0, 0)
  • consider coordinates of polygon
  • dP/dt (0, -5.0, 0)
  • consider coordinates of micro polygon
  • dP/dt (0, -5.0, 0)
  • length(vtransform( "world", Deriv(P, t)))

P (1.875, .25, 0)(s, t) (.75, 45)
P (1.875, 0, 0)(s, t) (.75, .5)
P (0, -2.5, 0)(s, t) (0, 1)
27
Constant Tiled Textured Plane
surface tile( string tex "" ) float
dPdsLength length(vtransform("world",
Deriv(P,s))) float dPdtLength
length(vtransform("world", Deriv(P,t))) Oi
0 float startS, startT for (startS 0
startS lt 1 startS .2) for (startT 0 startT
lt 1 startT .2) float ss (s - startS)
dPdsLength float tt (t - startT)
dPdtLength if (ssgt0 sslt1 ttgt0
ttlt1) float tileAlpha texture(tex3,
ss, tt) color tileColor texture(tex, ss,
tt) Ci (1 - Oi) tileAlpha
tileColor Oi (1 - Oi) tileAlpha

28
Manipulating Points
  • ss2 ss sTranslatett2 tt tTranslate
  • ss3 ss2 cos(angle) - tt2
    sin(angle)tt3 ss2 sin(angle) tt2
    cos(angle)
  • ss4 ss3 sScalett4 tt3 tScale

29
Manipulating Points
  • ss2 ss sTranslatett2 tt tTranslate
  • ss3 ss2 cos(angle) - tt2
    sin(angle)tt3 ss2 sin(angle) tt2
    cos(angle)
  • ss4 ss3 sScalett4 tt3 tScale

30
Manipulating Points
  • ss2 ss sTranslatett2 tt tTranslate
  • ss3 ss2 cos(angle) - tt2
    sin(angle)tt3 ss2 sin(angle) tt2
    cos(angle)
  • ss4 ss3 sScalett4 tt3 tScale

31
Manipulating Points
  • ss2 ss sTranslatett2 tt tTranslate
  • ss3 ss2 cos(angle) - tt2
    sin(angle)tt3 ss2 sin(angle) tt2
    cos(angle)
  • ss4 ss3 sScalett4 tt3 tScale

32
Point Sampling
  • texture(tex, ss, tt, "swidth?, 0, "twidth?,
    0)
  • texture(tex, ss, tt, ss, tt, ss, tt, ss,
    tt)

33
Point Sampling
  • texture(tex, ss, tt, "swidth", 0, "twidth",
    0)
  • texture(tex, ss, tt, ss, tt, ss, tt, ss,
    tt)

34
The End
Write a Comment
User Comments (0)
About PowerShow.com