Back to photostream

Texture Mapping in Structure Synth / SunFlow

An example of applying textures to Structure Synth -> SunFlow output.

 

You will have to modify the Structure Synth export templates to use the desired texture, e.g.:

 

shader {

name "shader05"

type phong

texture "texture.png"

spec { "sRGB nonlinear" 1.0 1.0 1.0 } 50

samples 4

}

 

(Notice Phong shading requires a light to be present in the scene)

 

In order to apply the texture you also need to assign UV (texture) coordinates to the polygons making up the standard box. Modify the existing box definition to the following:

 

object {

shader none

transform col 0.001 0 0 0 0 0.001 0 0 0 0 0.001 0 0 0 0 1

type generic-mesh

name "Box"

points 8

1 1 1

1 0 1

0 0 1

0 1 1

0 1 0

0 0 0

1 0 0

1 1 0

triangles 12

0 3 2

0 2 1

2 3 4

2 4 5

3 0 7

3 7 4

0 1 6

0 6 7

1 2 5

1 5 6

5 4 7

5 7 6

normals none

uvs facevarying

1 1 0 1 0 0

1 1 0 0 1 0

0 0 1 0 1 1

0 0 1 1 0 1

0 0 1 0 1 1

0 0 1 1 0 1

1 0 0 0 0 1

1 0 0 1 1 1

1 0 0 0 0 1

1 0 0 1 1 1

0 0 0 1 1 1

0 0 1 1 1 0

}

 

For the shader above, the texture image is repeated on each face of the box. If you want finer control over the orientation and position of the textures, you have to modify the UV coords above.

15,203 views
6 faves
12 comments
Uploaded on May 4, 2009