Title: Constant Tiled Textures
1Constant Tiled Textures
Mach Kobayashi Square USA
2Plane
surface tile() Oi 1 Ci Oi (s, t,
0)
3Textured Plane
surface tile(string tex "") Oi float
texture(tex3, s, t) Ci Oi texture(tex,
s, t)
4Tiled 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)
5Tiled 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)
6Constant Tiled Textured Plane
- how is this done?
- for each point, look at every tile
- calculate distance in world space
- look up texture
7Constant 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
8Constant 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
9Constant 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
10Constant 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
11Constant 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
12Constant 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
13Constant 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
14Constant 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
15Constant 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
16World 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
17World 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)
18World 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)
19World 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)
20World 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)
21Calculating 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)))
22Calculating 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)
23Calculating 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)
24Calculating 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)
25Calculating 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)
26Calculating 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)
27Constant 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
28Manipulating 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
29Manipulating 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
30Manipulating 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
31Manipulating 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
32Point Sampling
- texture(tex, ss, tt, "swidth?, 0, "twidth?,
0) - texture(tex, ss, tt, ss, tt, ss, tt, ss,
tt)
33Point Sampling
- texture(tex, ss, tt, "swidth", 0, "twidth",
0) - texture(tex, ss, tt, ss, tt, ss, tt, ss,
tt)
34The End