DarkRadiant - Paste Texture Natural: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
mNo edit summary
mNo edit summary
Line 9: Line 9:
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.
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):
The Paste Natural command (Shift-MMB) has been 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]
[http://img183.imageshack.us/img183/1673/complexpatchnaturalik5.jpg http://img183.imageshack.us/img183/1673/complexpatchnaturalik5.th.jpg]

Revision as of 16:29, 27 May 2007

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:

complexpatchoy6.th.jpg 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:

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) has been 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):

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). There is no pendant to this command in DoomEdit.