User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mapping:cawe:editingtools:editfaceprops [2008-01-19 13:31]
Carsten Updated and revised the text
mapping:cawe:editingtools:editfaceprops [2013-01-07 12:07] (current)
Line 41: Line 41:
 ===== Orientation and Material ===== ===== Orientation and Material =====
  
-Once you have selected one or more desired ​surfaces, you can modify their orientation and material attributes+Once you have selected one or more surfaces, you can modify their orientation and material attributes.
- +
-This is easily achieved by the appropriate controls of the related dialog. While pressing one of the small ''​+''​ or ''​-''​ buttons and choosing another material takes immediate effect, entering a new numerical value into the Scale, Shift or Rotation fields by hand requires an additional press on the ''​RETURN''​ key to become effective.+
  
 If you have multiple surfaces selected at the same time, the new value of the changed attribute is applied to all of them, while all other attributes are left alone. This allows you for example to replace the material or to set a common scale on a number of surfaces all at the same time, while the individual shift, rotation and other surface aspects are left alone. If you have multiple surfaces selected at the same time, the new value of the changed attribute is applied to all of them, while all other attributes are left alone. This allows you for example to replace the material or to set a common scale on a number of surfaces all at the same time, while the individual shift, rotation and other surface aspects are left alone.
Line 58: Line 56:
     * **Apply View Aligned**: This mode works like a slide-projector:​ The material is projected onto the clicked surface, where the base of the cameras view pyramid defines the plane of projection. (Contrary to a real slide-projector though, parallel rather than perspective projection is employed. Variants of parallel projection are also employed by the other apply modes and are more appropriate for the task at hand.) The orientation attributes are also taken into account. This is a great mode for texturing a rocky wall or any other irregular shape (that consists of multiple adjacent surfaces) seamlessly.     * **Apply View Aligned**: This mode works like a slide-projector:​ The material is projected onto the clicked surface, where the base of the cameras view pyramid defines the plane of projection. (Contrary to a real slide-projector though, parallel rather than perspective projection is employed. Variants of parallel projection are also employed by the other apply modes and are more appropriate for the task at hand.) The orientation attributes are also taken into account. This is a great mode for texturing a rocky wall or any other irregular shape (that consists of multiple adjacent surfaces) seamlessly.
     * **Apply Edge Aligned**: This mode makes sure that when you click on a surface //next// to the previously picked one (i.e. left-clicked,​ possibly with ''​ALT''​),​ the material is seamlessly aligned across the common edge. This is a worthwhile feature especially when the two surfaces are not coplanar. (It even works when the clicked surface is not immediately adjacent to the other.) \\ FIXME What exactly are the restrictions when Bezier patches are used?     * **Apply Edge Aligned**: This mode makes sure that when you click on a surface //next// to the previously picked one (i.e. left-clicked,​ possibly with ''​ALT''​),​ the material is seamlessly aligned across the common edge. This is a worthwhile feature especially when the two surfaces are not coplanar. (It even works when the clicked surface is not immediately adjacent to the other.) \\ FIXME What exactly are the restrictions when Bezier patches are used?
-    * **Apply Projective**:​ Like Apply Normal, but this mode also applies the //texture planes U- and V-vectors// of the picked surface to the clicked surface. This mode is the generalization of both the Apply Normal as well as the Apply View Aligned modes, and as the underlying technique is a mathematical projection, it is called Apply Projective. Refer to the advanced section below for more technical information. \\ This is the mode of choice whenever you want to texture a Bezier patch exactly like an adjacent brush face. For example, if you have a wall or a floor that is made of both brush faces and Bezier patches, and you want to apply the material on the brush faces seamlessly to the Bezier patches, just pick up the surface attributes from a brush face, and Apply Projective to the Bezier patches. \\ Mode limitations:​ Picking up the attributes from Bezier patch surfaces may not provide sufficient attribute information for this mode to work in some cases. This is true whenever the Bezier patches surface was defined by non-projective means. This situation is pointed out by the colored backgrounds of the Orientation fields in the dialog.+    * **Apply Projective**:​ Like Apply Normal, but this mode also applies the //texture planes U- and V-vectors// of the picked surface to the clicked surface. This mode is the generalization of both the Apply Normal as well as the Apply View Aligned modes, and as the underlying technique is a mathematical projection, it is called Apply Projective. Refer to the advanced section below for more technical information. \\ This is the mode of choice whenever you want to texture a Bezier patch exactly like an adjacent brush face. For example, if you have a wall or a floor that is made of both brush faces and Bezier patches, and you want to apply the material on the brush faces seamlessly to the Bezier patches, just pick up the surface attributes from a brush face, and Apply Projective to the Bezier patches.
  
 When ''​SHIFT''​ is held during a right-click on a brush surface, the application is performed on all surfaces of the brush. When ''​SHIFT''​ is held during a right-click on a brush surface, the application is performed on all surfaces of the brush.
Line 69: Line 67:
 The materials of selected //brush faces// (not Bezier patches) can be automatically aligned at the top, bottom, left or right edge of the face by the related button in the **Alignment** section of the dialog. The material can also be centered or made fit on the brush face. In all cases, the effect is achieved by auto-adjusting the Shift and/or Scale attributes of the selected brush faces appropriately. The materials of selected //brush faces// (not Bezier patches) can be automatically aligned at the top, bottom, left or right edge of the face by the related button in the **Alignment** section of the dialog. The material can also be centered or made fit on the brush face. In all cases, the effect is achieved by auto-adjusting the Shift and/or Scale attributes of the selected brush faces appropriately.
  
-( FIXME The above applies to brush faces only. ) \\ 
 ( FIXME Re-pick the first selected surface in order to update the dialog attributes! ) ( FIXME Re-pick the first selected surface in order to update the dialog attributes! )
  
Line 75: Line 72:
  
 ==== Fit on Bezier patches ==== ==== Fit on Bezier patches ====
-Note that for Bezier patches, the **Fit** button works a little ​differently than for brush faces: +For Bezier patches, the (highly useful!) ​**Fit** button works slightly ​differently than for brush faces: 
-Although in both cases the material will be made "​fit" ​on the underlying surface, Bezier patches are from then on in a different texture-coordinate generation ​mode than brush faces. This is because for brush faces, you could have achieved the same effect by manipulating the Scale and Shift manually until the result is identical. With Bezier patches, which can be curved to any shape (e.g. cylindrical or spherical), this is impossible.+Although in both cases the material will be made "​fit" ​to the underlying surface, Bezier patches are then in a different ​mode regarding ​texture-coordinate generation than brush faces.
  
-As a result, the Bezier patches ​whose material is applied with the **Fit** button ​(a highly useful button with Bezier patchesputs them into a different texture-coordinate generation ​mode that is not compatible with that of brush faces: You cannot pick such Bezier patch surfaces and apply them directly to brush faces (but still to other Bezier patches), and -- more importantly -- the Scale attributes now indicate the number of repetitions of the material on the surface, rather than the number of texels per world unit as usual. The background of the Orientation attribute fields is colored in order to indicate that a Bezier patch surface has been picked that is in this special texture-coordinate generation mode.+This is because for brush facesyou could have achieved ​the same result by manipulating the Scale and Shift manually. With Bezier patches, which can be curved to any shape (e.g. cylindrical or spherical), the same mathematics cannot achieve the same effect, and thus using the **Fit** button ​on Bezier patches puts them into Fit mode that yields ​the desired result.
  
-You can "​revert"​ the behaviour ​of such a Bezier ​patches ​surface by picking the surface attributes of a brush face and right-click ​applying them to the Bezier patch in **Apply Projective** mouse-button mode.+The essence of Fit mode is that the Scale attributes now indicate the number of repetitions of the material along the surface, rather than the number of texels per world unit as usual. 
 + 
 +Because of this difference, while applying the surface properties of such Bezier patches to other Bezier patches is straightforward and intuitive, applying the same attributes to brush faces is sometimes not possible without distortion. Such cases are easily fixed though by clicking and editing the affected brush surface. 
 + 
 +The line “Mode: Fit” near the Orientation controls indicates that the current surface values were taken from a Bezier patch that was in Fit mode. 
 + 
 +You can "​revert"​ the mode of such a Bezier ​patch surface ​back to normal ​by picking the surface attributes of a brush face and applying them to the Bezier patch in **Apply Projective** mouse-button mode.
  
 ==== Plane Indicators ==== ==== Plane Indicators ====
Line 86: Line 89:
  
 The **wrt. Face plane** checkbox indicates whether the texture plane of the surface is parallel to the spatial plane of the surface. This is never true for Bezier patches (they in general have no inherent spatial plane), and normally always true for brush faces; however you can use the **Apply Projective** right-click apply mode in order to force any texture plane onto any surface. The **wrt. Face plane** checkbox indicates whether the texture plane of the surface is parallel to the spatial plane of the surface. This is never true for Bezier patches (they in general have no inherent spatial plane), and normally always true for brush faces; however you can use the **Apply Projective** right-click apply mode in order to force any texture plane onto any surface.
- 
-( FIXME Update code so that these are indeed indicators only. Move into Orientation section? ) 
  
  
Line 93: Line 94:
  
 ==== ... texture brush faces? ==== ==== ... texture brush faces? ====
 +
 +Individual brush faces are easily textured by left-clicking them to pick their attributes into the dialog.
 +Then you use the controls in the dialog to directly modify the orientation,​ alignment, etc.
 +The changes become immediately visible on the selected face in the 3D view.
 +You may check the **Hide Selection Overlay** checkbox in order to hide the selection mask.
 +
 +For texturing a larger area of your map where many brush faces are to be textured in a similar style,
 +you should first texture one of the surfaces as described above, then use the [[#​right-click_application|Right-Click Application]] feature to apply the texture to all desired surfaces in the 3D view quickly.
 +Make sure that you understand the apply modes of the right mouse button in order to get the best out of them.
 +
 +Repeat this with other textures of your choice, and fine-tune them individually in the end.
 +
  
 ==== ... texture Bezier patches? ==== ==== ... texture Bezier patches? ====
  
-==== ... deal with the "​Picking [...] is not possible"​ message? ====+This is as easy as texturing brush faces, but sometimes Bezier patches are textured for a specific purpose:
  
-This message can occur when picking (left-clicking) ​Bezier patches that were created with previous versions ​of CaWE, or Bezier patches ​that were imported from other games and file formatsSuch Bezier patches got custom ​texture-coordinates assigned and are in "​Custom"​ tex-coord generation mode; you may refer to section [[#​advanced_settings]] below for more details.+Bezier patches that are a part of a floor or ceiling plane are often to be textured so that the transition to the adjacent brush is seamlessThis is easily achieved by picking the texture ​from the nearby brush, select **Apply Projective** as the **Right MB mode**, then right-click apply the material ​to the Bezier patch.
  
-Nothing is inherently wrong with Bezier patches ​in Custom modeyou just cannot pick their surface properties and apply them to anything else. As soon as you assign surface properties from another brush face or Bezier patch (that is not in Custom mode) though, ​the Custom mode is overwritten with the newly applied properties, and the Bezier patch acts normally then.+Bezier patches ​that represent bulgesdents or small terrains ​that are expected to blend seamlessly into neighboring brushes are also well approach by the projective or view aligned apply modes.
  
 +Pipes, pillars, wall arches and similar objects are best textures by using the **Fit** alignment button.
 +The material then covers them naturally, and you can conveniently set the number of texture repetitions by the Scale values in the dialog.
  
-==== ... deal with yellow-colored Orientation attributes? ==== 
  
-Bezier patches that are newly created or whose material has been applied using the **Fit** button ​are in the "Fit" ​texture-coordinate ​generation mode; you may refer to section [[#Fit_on_Bezier_patches]] above and [[#​advanced_settings]] below for more details.+==== ... deal with the "​Picking [...] is not possible"​ message? ==== 
 + 
 +This message can occur when picking (left-clicking) ​Bezier patches that were created ​with previous versions of CaWE, or Bezier patches that were imported from other games and file formats. Such Bezier patches got custom texture-coordinates assigned and are in "Custom" ​tex-coord generation mode; you may refer to section [[#advanced_considerations|Advanced Considerations]] below for more details
 + 
 +Nothing is inherently wrong with Bezier patches in Custom mode, you just cannot pick their surface properties and apply them to anything else. As soon as you assign surface properties from another brush face or Bezier patch (that is not in Custom mode) though, the Custom mode is overwritten with the newly applied properties, and the Bezier patch acts normally then.
  
-The essence is that the Scale attributes now indicate the number of repetitions of the material on the surface, rather than the number of texels per world unit as usual. Please refer to section [[#​Fit_on_Bezier_patches]] for more details. 
  
-Because of this issue, applying the surface properties of such Bezier patches to other Bezier patches is never a problem, but applying the same attributes to brush faces may cause unexpected results.+==== ... deal with "Mode: Fit" orientation attributes? ====
  
-The yellow-colored background ​is a reminder of that issue.+Bezier patches that are newly created or whose material has been applied using the **Fit** button are in the "​Fit"​ texture-coordinate generation mode, whose essence ​is that the Scale attributes now indicate the number of repetitions of the material along the surface, rather than the number of texels per world unit as usual.
  
-FIXME Can we not fix that?? E.g. implicitly "​Fit-Apply to faces, then scale accordingly"​ ??+Refer to section [[#​fit_on_bezier_patches|Fit on Bezier patches]] above and [[#​advanced_considerations|Advanced Considerations]] below for more details.
  
  
Line 145: Line 162:
 The parameters of the plane are determined by the Orientation controls in the dialog. The parameters of the plane are determined by the Orientation controls in the dialog.
  
-The following ​image presents the setup in a top-down view: \\+The following ​figure ​presents the setup in a top-down view: \\
 {{:​mapping:​cawe:​editingtools:​texturemapping.png}} {{:​mapping:​cawe:​editingtools:​texturemapping.png}}
  
 The texture plane P is indicated by the dark blue color, its normal vector in dark green. The texture plane P is indicated by the dark blue color, its normal vector in dark green.
 The x-axis span vector is indicated in red, as well as integral multiples of its length in both directions. The x-axis span vector is indicated in red, as well as integral multiples of its length in both directions.
-The y-axis span vector is not included in the image, as it points up or down, into or out of the image.+The y-axis span vector is not included in the image, as it points up or down, into or out of the figure.
  
 A texture plane is obtained by picking a surface in Plane Projective mode. A texture plane is obtained by picking a surface in Plane Projective mode.
 For example, texture plane P in the image was obtained by left-clicking on the highlighted face of brush A. For example, texture plane P in the image was obtained by left-clicking on the highlighted face of brush A.
  
-FIXME Continue revision here. +Note that the x-axis represents one width of the material that is to be applied to the surfaces: 
- +If you change the Scale values in the dialog, the length of the x-axis (and y-axis) changes, too, implying that more or fewer repetitions of the material span given distance in the world. 
- +Changing the Shift values in the dialog moves the x-axis arrow and its multiples along the plane. 
-This graphic shows how textures are mapped onto faces. ​Note that the graphic shows top down viewso the texture planes ​y axis is not visible ​in it+If rotation was applied, the x-axis would rotate "​into"​ our "out of" the image, while the y-axis became ​visible.
  
-Textures are mapped on a face by parallel projecting ​the texture from a texture plane P onto a face. +In the dialog, ​the **wrt. World axes** and **wrtFace plane** checkboxes indicate whether ​the dialogs last picked ​plane happens ​to be parallel to the major world axes and/or parallel to the physical surface ​of the picked-from face.
-The texture ​plane from which the texture is projected can be any plane in worlds coordinate system, but is usually chosen ​to be parallel to the face on which the texture should be projected (see faces of brushes A and D in the graphic).+
  
-In the texture plane, a point of origin is needed to determine where the first texture ​is drawn onto the plane. This point of origin is the normal vector from the plane to the world origin and therefore unique for every plane.  +The dotted lines indicate how the material would be applied from the texture-plane to the objects surfaces
-Starting from this point the texture ​is tiled onto the plane whereat ​the length ​of the x axis vector ​is the textures width and the y axis vector (not visible ​in this graphic) is the textures height. The texture repeats itself along the x and y axis (see red dashes).+At object A there is a natural fit, because integral multiples of the material match the extends ​of the object. 
 +Object D is also natural case, but the material would appear shifted on it's surface. You would have to modify ​the Shift attributes ​in order to align it with the extends of the surface.
  
-The vectors ​that decide ​the width and height ​of the texture can be increased or decreased in size to scale the texture. This is what happens when you increase or decrease ​the **Scale** value in the Edit Face Properties dialog (see above). The **Shift** values in the dialog are added as an offset the point of origin of the texture plane to shift the texture in x or y direction. The **Rotation** value is used to rotate the point of origin and in this way rotate ​the texture.+Note that objects B and C are special cases: When you normally apply the attributes ​of plane P to their surfaces, P is moved and rotated first so that it gets parallel ​to the desired surface. This is what the **Apply Normal** mode of the right mouse button does.
  
-How a texture is projected onto face depends on the position of the face in relation ​to the texture plane. In this example ​the face of brush A lies exactly ​in the dimensions of the x axis vector and therefore the texture fits exactly on the faces width. The face of brush D however lies outside the regular tiling of the texture plane and therefore the texture is mapped shifted onto the face starting at the first half of the textures x coordinates.+The **Apply Projective** mode however does not include the additional move and rotate step, and applies ​texture-coordinates //directly as indicated in the figure//. This is sometimes ​very useful feature ​in order to achieve certain effects, for example ​with texturing Bezier patches ​in some cases.
  
-As said above the texture ​plane can be any plane in the worlds coordinate system. This results in texture planes that are not parallel to the face the texture is projected on. +The **Apply View Aligned** mode works similarly, except for the fact that plane P is always forced to be parallel to the base of the view pyramid of the currently active 3D camera.
-In this case the texture is projected in the same way as before, but the result is a contorted texture on the face due to the fact that a smaller texture area is mapped onto a bigger face area (see brushes B and C in graphic).+
  
-In the Edit Face Properties dialog the **wrt. World axes** and **wrt. Face plane** show if the texture plane of this face is parallel to the world axes or to the face plane. It is also possible to set these values and therefore explicitly set the texture plane to world axes or face plane. 
mapping/cawe/editingtools/editfaceprops.1200745893.txt.gz · Last modified: 2013-01-07 12:07 (external edit)