Jump to content
The Dark Mod Forums

Pasting shaders on patches (grrr)


SteveL

Recommended Posts

I'm using patch splitting to build a much more complicated set of cylindrical towers than the one in that demo vid, and I'm running into problems because refitting textures after stretching messes up the texture orientation of patches. It doesn't even need a texture reset -- a simple square patch when cloned can end up inverted in texture space. After that, paste shader will no longer align them. The patch splitter leaves you with a perfectly aligned set of patches, but that doesn't help you if you want to stretch them afterwards. Realigning them in the texture tool is possible but a royal pain. I'm piling up a lot of work by stretching windows to make tapering loopholes etc.

 

Are there any tricks people have to sort it out? Like the paste-from-brush trick for texturing slightly curved patches? Unfortunately the brush trick doesn't work for cylinders as it leaves parts of the texture very stretched.

 

In the meantime I'm going to have a play in the python console to see whether I can come up with a paste shader for patches that aligns properly on stretched surfaces.

Link to comment
Share on other sites

Not really viable in my towers I'm afraid. The rooms typically have 4 windows and a door, which makes for about 30 curved patches all fitting together perfectly, but with textures misaligned after the stretching.

 

Most of my issues turned out to be caused by paste shader on a patch assuming you want row 0 of one patch aligning with row 0 of the other, and everything proceeds from there. That works in some spots, not in others, but the script has to make some assumptions. I now see the general problem of pasting correctly is impossible to solve, which will be why the built-in functions give unexpected results sometimes. There isn't enough information in a 3D patch for any method to tell what the mapper wants it to look like, if the patch has been bent and stretched. The same problem you find when pasting to the inner faces of a window hole cut in a brush wall. The texture on the side of the hole can't align with both the wall and the window sill, assuming the sill is aligned with the wall too. A script can't guess which the mapper wanted. And the possibilities are even more numerous when curves and stretches are involved.

 

I'm still working on something to solve the easy part though: something to let me seamlessly paste between two patches that line up along only 1 edge, and that need to show a constant texture size irrespective of how the patch verts are spread out. That's what you want for brickwork and most natural textures, and it'll let me get on with my towers, making as many loopholes as I like.

Link to comment
Share on other sites

Are you sure you can't use the Texture Tool to do this? I connected all these patches together using the texture tool. It was a bit of a learning curve but its basically like an unwrap of the patches.

 

I think with a circular tower there would only be one seam down the side from top to bottom that you'd have to cover and you could use pipes or something to do that.

 

MVy3cYE.jpg

Edited by Lux
Link to comment
Share on other sites

I like an organic layout :) Yes I could do it with the texture tool, but I'm experimenting with different workflows for building with patches. I'd not have attempted to make these towers this way if I knew I'd got to line up all the textures manually. I've taken a single big cylinder for a tower, cut it up into a couple of hundred pieces so I can delete bits where I want for windows and doors, then thickened the remaining pieces to make a very thick walled tower. The problem came when I started stretching the resulting patches. I'm left with a big texture alignment job.

 

Not to say that a script will be the right answer either. It's fiddly too, even if it can mostly automate what you'd do in the texture tool. I might have to re-think it. Perhaps I should have done the stretching before the cutting, but that'll involve more planning than I was hoping would be needed. Or maybe not bothered with proper windows at all and used separate cylinders for inside and outside. Loopholes only need skybox, so there's no need for the inner windows to be made from exterior ones = no stretching needed for tapering window holes. But a "paste texture" for patches of different sizes would still be useful.

  • Like 1
Link to comment
Share on other sites

Sometimes, with patches, playing with surface inspector and the FIT button and the x multiplet go a long way. You could fit a 3x2 multiplet of a texture on a patch to get it look decent without ridiculous amount of fine tuning.Replace the 3x2 fitting numbers with trial and error until the patch looks decent.

  • Like 1

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

@Lux: On a layout like in the screenie posted by you I would paste project the texture from above using a brush.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

@Sotha: In my current set-up I have dozens of patches seamlessly aligned but needing texture matching, and they're all different sizes, so I don't think I can solve it by any kind of manual fix. To make matters worse, some of the patches have somehow ended up upside down which borks all pastes and fits. I need to rethink the workflow so that the cutting happens last. When you've freshly cut a patch, it's completely seamless. So that needs to happen last, right after fitting the texture which needs to happen second-to-last.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...