Difference between revisions of "Mapping:What is a patch"

From Custom Map Makers Wiki
Jump to: navigation, search
Line 1: Line 1:
{{Stub}}
+
== General information ==
 +
{{Info|Way too much tech stuff, doesn't matter for mappers}}
 
Bezier Patches or "curves" are one type of Parametric Surface.  
 
Bezier Patches or "curves" are one type of Parametric Surface.  
  
Line 25: Line 26:
  
 
One Patch can only have one Shader, for the same reason one brush face can only have one Shader.
 
One Patch can only have one Shader, for the same reason one brush face can only have one Shader.
 +
 +
== Tutorial (by postit, originally posted at [http://www.urtjumpers.com/forum/viewtopic.php?id=595 urtjumpers.com forum]) ==
 +
The aim of this tutorial is to guide a mapper in creating curved walls using patches, as pictured below:
 +
 +
http://img26.imageshack.us/img26/8066/sc3small.jpg
 +
 +
Creating a curved wall is about moving vertices into the right positions. I've tried to use pictures more than words to show this.
 +
 +
Start With A Quarter Circle
 +
 +
1. In the menu select Curve -> Simple Patch Mesh
 +
2. Accept default settings (3 X 3)
 +
3. Use x/y/z axis rotate or change view (CTRL+TAB) until you are viewing the patch edge on - it looks like a line.
 +
4. Press V to enter Vertex Selection mode. Your screen should look like the image below. The vertices have been numbered.
 +
 +
http://img824.imageshack.us/img824/2601/30103152.jpg
 +
 +
5. Drag vertices 3 and 2 as shown below. A quarter circle is achieved.
 +
 +
http://img204.imageshack.us/img204/8466/64033911.jpg
 +
 +
http://img692.imageshack.us/img692/6927/81779537.jpg
 +
 +
6. Texture the wall. With the wall selected, press S to bring up the Surface Inspector and select "Natural" in the patch texturing section.
 +
 +
NOTE: If you can't texture the correct side of the patch, you need to invert the matrix: Menu -> Curve -> Matrix -> Invert
 +
 +
http://img89.imageshack.us/img89/4665/sc1small.jpg
 +
 +
Semi Circle
 +
 +
1. This time create a 5 X 5 patch mesh.
 +
 +
http://img705.imageshack.us/img705/2186/90795203.jpg
 +
 +
2. Move the vertices as shown to create a semi circle.
 +
 +
http://img18.imageshack.us/img18/1853/74684979.jpg
 +
 +
http://img96.imageshack.us/img96/592/54033388.jpg
 +
 +
http://img713.imageshack.us/img713/2183/22678100.jpg
 +
 +
http://img824.imageshack.us/img824/6995/70046165.jpg
 +
 +
3. Texture and voila:
 +
 +
http://img574.imageshack.us/img574/294/sc2small.jpg
 +
 +
Go Nuts
 +
 +
1. Create a 15 x 15 patch mesh.
 +
 +
http://img651.imageshack.us/img651/635/82332801.jpg
 +
 +
2. Arrange vertices to an interesting kidney shape.
 +
 +
http://img594.imageshack.us/img594/8978/67233821.jpg
 +
 +
This gives the result shown in the picture at the top of this tutorial.
  
 
[[Category:Mapping]]
 
[[Category:Mapping]]

Revision as of 12:07, 4 December 2011

General information

Info.png Way too much tech stuff, doesn't matter for mappers

Bezier Patches or "curves" are one type of Parametric Surface.

A parametric surface is a surface with a shape defined by a set of parameters, so the shape of the surface can change depending on the values of the parameters.

For Bezier Patches in Quake 3, the parameter is the LOD, or Level Of Detail.

Patches in Quake 3 are rendered with triangles, so the curves must be 'tessellated' (subdivided) into a number of triangles.

The higher the LOD value, the more the curve is subdivided, and the more triangles are created in tessellation.

The LOD can be set to change with the viewer's distance from the Patch, decreasing as they get further away.

In Q3 "r_lodCurveError" controls how much the LOD changes with distance, and "r_subdivisions" fixes the maximum LOD for all curves.

A Patch is stored as a 2-dimensional matrix of points.

A 2-dimensional matrix is a table containing sets of values arranged in rows and columns.

Each point is stored as two sets of values.

One set contains the XYZ coordinates defining the location of the point in the 3-dimensional volume of the map.

The other set contains the UV coordinates defining the location of that point on the 2-dimensional area of the Shader.

One Patch can only have one Shader, for the same reason one brush face can only have one Shader.

Tutorial (by postit, originally posted at urtjumpers.com forum)

The aim of this tutorial is to guide a mapper in creating curved walls using patches, as pictured below:

http://img26.imageshack.us/img26/8066/sc3small.jpg

Creating a curved wall is about moving vertices into the right positions. I've tried to use pictures more than words to show this.

Start With A Quarter Circle

1. In the menu select Curve -> Simple Patch Mesh 2. Accept default settings (3 X 3) 3. Use x/y/z axis rotate or change view (CTRL+TAB) until you are viewing the patch edge on - it looks like a line. 4. Press V to enter Vertex Selection mode. Your screen should look like the image below. The vertices have been numbered.

http://img824.imageshack.us/img824/2601/30103152.jpg

5. Drag vertices 3 and 2 as shown below. A quarter circle is achieved.

http://img204.imageshack.us/img204/8466/64033911.jpg

http://img692.imageshack.us/img692/6927/81779537.jpg

6. Texture the wall. With the wall selected, press S to bring up the Surface Inspector and select "Natural" in the patch texturing section.

NOTE: If you can't texture the correct side of the patch, you need to invert the matrix: Menu -> Curve -> Matrix -> Invert

http://img89.imageshack.us/img89/4665/sc1small.jpg

Semi Circle

1. This time create a 5 X 5 patch mesh.

http://img705.imageshack.us/img705/2186/90795203.jpg

2. Move the vertices as shown to create a semi circle.

http://img18.imageshack.us/img18/1853/74684979.jpg

http://img96.imageshack.us/img96/592/54033388.jpg

http://img713.imageshack.us/img713/2183/22678100.jpg

http://img824.imageshack.us/img824/6995/70046165.jpg

3. Texture and voila:

http://img574.imageshack.us/img574/294/sc2small.jpg

Go Nuts

1. Create a 15 x 15 patch mesh.

http://img651.imageshack.us/img651/635/82332801.jpg

2. Arrange vertices to an interesting kidney shape.

http://img594.imageshack.us/img594/8978/67233821.jpg

This gives the result shown in the picture at the top of this tutorial.