Texturing in DarkRadiant: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
m Added links
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In DarkRadiant there are quite some texturing tools available. In order to yield the best results, it's of course useful to know how these tools work, which is what this document is trying to cover.  
In DarkRadiant there are some quite useful texturing tools available. This document describes these tools and how and when to use them.


== Brushes vs. Patches ==
== Brushes vs. Patches ==
There are some texturing commands that work differently for brushes and patches, because of the way these primitives store their texture information. So beware that using the same command on a brush doesn't always yield the same result when used on patches, although DarkRadiant tries to do its best. Read here to gain some insight about [[how patches and brushes are technically textured]].
There are some texturing commands that work differently for brushes and patches, because of the way these primitives store their texture information. So beware that using the same command on a brush doesn't always yield the same result when used on patches, although DarkRadiant tries to do its best.  


== Natural ==  
== Natural ==  
'''Natural''' for one works differently for patches as for brushes. Basically it tries to apply an undistorted texture with the default scale on the target. This is of course more easily accomplished for brushes (because their textures are always undistorted) than for patches.
'''Natural''' for one works differently for patches than for brushes. Basically it tries to apply an undistorted texture with the default scale on the target. This is of course more easily accomplished for brushes (because their textures are always undistorted) than for patches.


== Texture Copy & Paste ==
== Texture Copy & Paste ==
These are the most powerful texturing tools in DarkRadiant. There are several of them available, all can be accessed via the Middle Mouse Button (MMB):
These are the most powerful texturing tools in DarkRadiant. There are several of them available, all can be accessed via the Middle Mouse Button (MMB):


* MMB: Copy Texture to Clipboard
* [[DarkRadiant - Copy Texture|MMB]]: [[DarkRadiant - Copy Texture|Copy Texture]] to Clipboard
* [[DarkRadiant - Paste Texture Projected|Ctrl-MMB]]: [[DarkRadiant - Paste Texture Projected|Project Texture]] from Clipboard onto Target
* [[DarkRadiant - Paste Texture Projected|Ctrl-MMB]]: [[DarkRadiant - Paste Texture Projected|Project Texture]] from Clipboard onto Target
* [[DarkRadiant - Paste Texture Natural|Shift-MMB]]: [[DarkRadiant - Paste Texture Natural|Paste Texture Natural]] (undistorted and seamless) onto Target
* [[DarkRadiant - Paste Texture Natural|Shift-MMB]]: [[DarkRadiant - Paste Texture Natural|Paste Texture Natural]] (undistorted and seamless) onto Target
* [[DarkRadiant - Paste Texture Coordinates|Alt-MMB]]: [[DarkRadiant - Paste Texture Natural|Clone Texture Coordinates]] (Patches only, must have same dimensions)
* [[DarkRadiant - Paste Texture Coordinates|Alt-MMB]]: [[DarkRadiant - Paste Texture Coordinates|Clone Texture Coordinates]] (Patches only, must have same dimensions)
* Ctrl-Alt-MMB: Paste Texture to entire Brush: Copies shader from Clipboard to all faces of the targetted brush.


Please follow the links for a short introduction of these copy & paste operations.
Please follow the links for a short introduction of these copy & paste operations.


== Copy Texture ==
==Scrolling Textures with the Mouse==
This command is available via the MMB (click into the cam view) or the Menu > Edit > Copy Shader. When using the MMB to select a texture, the shader of the clicked object is loaded into the ShaderClipboard. Once you picked your texture the name of the texture appears in the status bar and it's highlighted in the Media and the Texture Browser.


== Paste Texture (Projected) ==
This was thought up by SneaksieDave. You can scroll a texture around to align it using the mouse as follows...
This is useful to texture patch caps or brush faces that are adjacent to each other. It can be accessed via '''Ctrl-MMB''' and the Menu > Edit > Paste Shader command. Let's have a look at the following example:


[http://img19.imageshack.us/img19/3447/texturingbeforehandca0.jpg http://img19.imageshack.us/img19/3447/texturingbeforehandca0.th.jpg] [http://img266.imageshack.us/img266/405/texturingafterwardsqk2.jpg http://img266.imageshack.us/img266/405/texturingafterwardsqk2.th.jpg]
* Select translate mode with the W key
* Put texture lock ON (yes ON)
* All in the camera view....
* Select the WHOLE brush. The red/blue translate arrows should show on it
* Click the Select Faces button - it should lock down and the selected brush loses its red highlight and the translate arrows and a green dot appears on surfaces.
* Now select the FACE (Shift+Ctrl+LMB), it turns pink and the translate arrows re-appear.
* Select either translate arrow to get direction
* LMB to drag the texture around. You can drag outside the texture which is handy if it is small or narrow.
* Adjust the ortho grid size for speed.
* You can also, at this point, use Alt plus the arrows to fine tune the position.


The left shot shows two brushes and a patch that has been created with the "cap selection" command. The rightmost brush is considered the "source" brush, so we copy its shader by middle-clicking it. The shader is now in the clipboard.
== Scrolling Textures with the Keyboard ==
 
When a texturable object (brush, single face, patch) is selected, use the arrow keys while holding down Shift. This will translate your texture up/down/left/right. The stepsize is determined by the Surface Inspector's settings.
Now hold down the Ctrl modifier and click on the other three objects with the middle mouse button. The texture is pasted onto the target objects so that the transition between the objects is seamless - technically spoken this is a projection. Imagine that you project the texture using a video projector, it's more or less the same mechanism.
 
'''Note''': It's important to note that this only works from brushes to patches, as only brush faces can be used to project textures. Patches have no uniform scale and rotation and can't be used to retrieve a plane to project the objects onto.
 
== Paste Texture (Natural) ==
Sometimes it's not enough to project a texture from a brush face onto other objects, if the targets are bent and their normals are not facing into a similar direction as the source face normal does. The screenshot should illustrate the problem:
 
[http://img96.imageshack.us/img96/6529/complexpatchoy6.jpg http://img96.imageshack.us/img96/6529/complexpatchoy6.th.jpg] [http://img96.imageshack.us/img96/7883/complexpatchbeforeyx0.jpg http://img96.imageshack.us/img96/7883/complexpatchbeforeyx0.th.jpg]
 
This is the starting situation: We have a brush at the right (the "source brush") and the target patch on the left, which is heavily bent and it's definitely not lying in the same plane as the brush face. Let's try and project (Ctrl-MMB) the shader from the brush face to the patch:
 
[http://img96.imageshack.us/img96/8515/complexpatchprojectedjy5.jpg http://img96.imageshack.us/img96/8515/complexpatchprojectedjy5.th.jpg]
 
As easily observable, the patch texture is distorted because of the projection. Some patch areas are nearly perpendicular to the brush face we're copying from and therefore the projection does not work. A small section of the source texture is projected onto a  large section of the patch, hence the ugly stretching.
 
The Paste Natural command (Shift-MMB) was written to address this issue (just Shift-MMB onto the target, assuming that you still have the source shader from the face in the ShaderClipboard):
 
[http://img183.imageshack.us/img183/1673/complexpatchnaturalik5.jpg http://img183.imageshack.us/img183/1673/complexpatchnaturalik5.th.jpg]
 
What happened is the following: the patch is virtually straightened out by the algorithm before the texture is projected. It's ensured that the patch is virtually sharing the same plane as the brush face with the vertex distances being preserved (so that no stretching occurs). This is also working with patches that are perpendicular to the brush face. Just experiment a bit and it will be easy to see how it works. (This is the most sophisticated texturing method, it was quite some headache to set it up, believe me) :)
 
The command is available via '''Shift-MMB''' and Menu > Edit > Paste Shader (Natural)
 
== Paste Texture Coordinates ==
This command works only from Patches to Patches and is available via the '''Alt-MMB'''. The source and target patches must have the same matrix dimensions (e.g. you can only paste the coordinates from 5x3 patches to another 5x3 patch). The shape of the target patch stays untouched, it's just the shader coordinates (U/V) that get cloned. See this example:
 
[http://img133.imageshack.us/img133/9681/texturecoordcopy1zb5.jpg http://img133.imageshack.us/img133/9681/texturecoordcopy1zb5.th.jpg] [http://img244.imageshack.us/img244/3245/texturecoordcopy2zp5.jpg http://img244.imageshack.us/img244/3245/texturecoordcopy2zp5.th.jpg]
 
The left image shows two patches with equal dimensions (3x3). The left patch is considered the source patch - after clicking it with MMB the ShaderClipboard memorises this patch. After clicking the right patch (the target) using '''Alt-MMB''', the U/V coordinates get cloned from the left to the right. I've used an 2x2 texture tiling layout to illustrate the workings. As stated above, the shader itself stays untouched, it's just the "internal" coordinates of the target patch that get altered.
 
Another example:
 
[http://img244.imageshack.us/img244/520/texturecoordcopy3an4.jpg http://img244.imageshack.us/img244/520/texturecoordcopy3an4.th.jpg] [http://img172.imageshack.us/img172/6591/texturecoordcopy4fz8.jpg http://img172.imageshack.us/img172/6591/texturecoordcopy4fz8.th.jpg]


[[Category:DarkRadiant]]
[[Category:DarkRadiant]]
[[Category:Editing]]
{{textures}}

Latest revision as of 20:37, 2 November 2007

In DarkRadiant there are some quite useful texturing tools available. This document describes these tools and how and when to use them.

Brushes vs. Patches

There are some texturing commands that work differently for brushes and patches, because of the way these primitives store their texture information. So beware that using the same command on a brush doesn't always yield the same result when used on patches, although DarkRadiant tries to do its best.

Natural

Natural for one works differently for patches than for brushes. Basically it tries to apply an undistorted texture with the default scale on the target. This is of course more easily accomplished for brushes (because their textures are always undistorted) than for patches.

Texture Copy & Paste

These are the most powerful texturing tools in DarkRadiant. There are several of them available, all can be accessed via the Middle Mouse Button (MMB):

Please follow the links for a short introduction of these copy & paste operations.

Scrolling Textures with the Mouse

This was thought up by SneaksieDave. You can scroll a texture around to align it using the mouse as follows...

  • Select translate mode with the W key
  • Put texture lock ON (yes ON)
  • All in the camera view....
  • Select the WHOLE brush. The red/blue translate arrows should show on it
  • Click the Select Faces button - it should lock down and the selected brush loses its red highlight and the translate arrows and a green dot appears on surfaces.
  • Now select the FACE (Shift+Ctrl+LMB), it turns pink and the translate arrows re-appear.
  • Select either translate arrow to get direction
  • LMB to drag the texture around. You can drag outside the texture which is handy if it is small or narrow.
  • Adjust the ortho grid size for speed.
  • You can also, at this point, use Alt plus the arrows to fine tune the position.

Scrolling Textures with the Keyboard

When a texturable object (brush, single face, patch) is selected, use the arrow keys while holding down Shift. This will translate your texture up/down/left/right. The stepsize is determined by the Surface Inspector's settings.