Results 1 to 10 of 58

Thread: [Award Winner] Thatching for dummies...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default

    That is beautiful...time consuming, for the likes of me but beautiful (but not as time consuming as really thatching a roof).

    If I make a bunch of houses will you thatch them for me using your magic script?

  2. #2
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    Sure thing if I can use them in my co-op tile !

  3. #3
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    Just need a height map 8 bit greyscale or a model that I can render one out from. I can take almost any kind of model but at the mo I don't have a sketchup format converter. I should be ok with 3dsmax, obj, lightwave, vrml + lots more like that.

    If your building it yourself then its not worth putting huge amounts of detail in as it seems that the thatch covers it up.

    Heres a basic hut. I have loads of huts and this is the best one I have. It took just a few seconds to generate.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Cottage2_C.png 
Views:	123 
Size:	1.27 MB 
ID:	3425  

  4. #4
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    More cottage bits
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Cottage4.png 
Views:	117 
Size:	1.13 MB 
ID:	3426   Click image for larger version. 

Name:	Cottage5.png 
Views:	147 
Size:	1.07 MB 
ID:	3427   Click image for larger version. 

Name:	Cottage6.png 
Views:	129 
Size:	1.38 MB 
ID:	3428   Click image for larger version. 

Name:	Cottage7.png 
Views:	120 
Size:	1.03 MB 
ID:	3429   Click image for larger version. 

Name:	Cottage8.png 
Views:	101 
Size:	820.4 KB 
ID:	3430  


  5. #5

    Post

    I was so impressed I had to try to see if I could do something similar with Gimp:
    Attachment 3442

    I created a set layers of rotated thatch images, then set the layer mask for each as a bump mapped version of the heightfield with the light coming from the same direction as the thatch was rotated. I think I had the lighting elevation too low, and I only went with 45 degree rotations, cause I was just playing.

    I realized afterward that I should have scaled the thatch down a bit, but I think the basics are there.

    How did you blend the rotated layers to get the non-direction version?

    I think this might be worth scripting...

    -Rob A>

  6. #6
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Post

    Well done for having a go. I'll note some more tech details...

    What I ended up doing was to add a whole bunch of light sources in a line going vertical. Like a vertical fluorescent strip light in the direction of thatching and I created a single image render made from the brightest parts of those light renders. I used directional light sources not point or spot. Then I clamped the lighting so that only the very brightest parts of the image stayed white and all else went black. That basically made only the parts of the model which faced in the exact horizontal (X-Z plane) direction of the thatch white but at any vertical angle (Y angle). So for example a ball like an orange would have a segment lit white and all else black.

    So I had 8 image masks and an extra non directional thatch texture. The masking and compositing is done with a compositor that I have as part of GTS but the order I used was as follows.

    Start with an image which is all floor color - say black.
    Mask in the non directional thatch where the object is not floor only. That is to say if the height map is not black then render the non directional thatch.

    Then multiply LightMask7 (157.5deg) with Thatch7 and add in.
    Then multiply LightMask6 (135.0deg) with Thatch6 and add in.
    ...

    Then multiply LightMask0 (0.0deg) with Thatch0 and add in.

    And that should be it. So Thatch at 0.0 deg is the highest priority and the non directional thatch is least. I tried doing odd angled first like 22.5, 67.5 and then the 45's and then the 90's and then 0 but that didn't come out as well as doing them in rotation order. You could end up with small patches of one angle where everything around it was another completely different. By doing them in rotation order it seems to blend the angles better but the down side is that if you get the light clamping wrong then the bits of thatch which would be 90deg and well lit by the 90deg light mask could be wiped out by the overlap from the 22.5 Then when you get the final render all the angles are a bit out.

    I accept that this is not the easiest thing to set up but once you have it it seems to work time and time again.

    To get the non directed thatch I merely took 0 & 90 deg and put it in two layers in the bitmap editor and blended 50:50. I was hoping that I wouldn't have too much of that showing really. You cant have thatch pointing straight up as it would let the water in ! I don't know what real thatching does on the top of houses. I guess they put some flat thatching across. Sometimes you see these great bits like topiary with a thatched peacock or something very clever.
    Last edited by Redrobes; 05-05-2008 at 07:26 AM.

  7. #7
    Community Leader Torq's Avatar
    Join Date
    Jun 2007
    Location
    Cape Town, South Africa
    Posts
    894

    Post

    Great post Redrobes. I'm definately going to try to implement it in my next city map.

    Torq
    The internet! It\'ll never catch on.

    Software Used: Terranoise, Wilbur, Terragen, The Gimp, Inkscape, Mojoworld

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •