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

1. Originally Posted by Arandil
Nice! And no need for particle effects, kinda nifty.
Hey Arandil, didn't see your post there ! Welcome to the guild. I'm looking forward to seeing Seers GMaps

2. While I am posting, heres a bit of the town using them...

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

Torq

4. The lighting on your buildings seems a little disarrayed. It looks like you need to create your thatch texture unshaded, and then apply your shading in situ.

So if I get what you are doing here, you are using your differently lit versions of the object to index the various thatch images by orientation.

Using a Sobel algorithm(I think) to calculate the partial derivatives of the HF in the vertical direction and then calculating atan(∂y/∂x). You can use the result, truncated to [0, 7] to select thatch images by index. This could be quicker than running a full 3d render eight times. I will leave the implementation as an exercise for smarter people than myself(you).

5. Originally Posted by su_liam

So if I get what you are doing here, you are using your differently lit versions of the object to index the various thatch images by orientation.

Using a Sobel algorithm(I think) to calculate the partial derivatives of the HF in the vertical direction and then calculating atan(∂y/∂x). You can use the result, truncated to [0, 7] to select thatch images by index. This could be quicker than running a full 3d render eight times. I will leave the implementation as an exercise for smarter people than myself(you).
Your right in that the shadows are in all directions. I try and avoid shadows and if I have them then I light stuff straight down. It looks a little fake but you can reuse bitmaps that have captured the lighting in them over and over.

Buildings tho don't ever look like buildings without some shadow. Its the same with terrain hills, humps, ditches and so on. You cant adequately show them without some shading or else they look flat.

So I could render them without the shading and use the height maps in place of the houses in VDale and render out a full height map of the whole town, then shade that and apply that to the flat color icons and it would look great but it would use one image for lighting for the whole town but each house would have its own color image. So the resolution of the shading would be much much less than the color. Probably not a big issue and it would also allow shadows from the houses too but its not ideal.

When rendering out the lightmaps in GTS I already have the normal vector for the height map so I don't need to do any more partial diff calcs. I could do a max of dot products for the 8 X-Z planar directions and get the index and your right I could add code to output an index image or even write some bigger code to take in 8 images and pick one. But this way is very similar and it has a little advantage of allowing some blending across two indexes - but I guess you could interpolate between two indexes too.

It takes about 30 secs from start to finish to generate the final shaded thatched model from the 8 bit gray-scale height map. Its not a huge wait thats worth coding up something special for.

Your points are all very valid tho.

6. Originally Posted by su_liam
Using a Sobel algorithm(I think) to calculate the partial derivatives of the HF in the vertical direction and then calculating atan(∂y/∂x). You can use the result, truncated to [0, 7] to select thatch images by index.
I hate to disagree with you, Su Liam, but for my part, I prefer the third integral Myneesie flux density theorem as I find it gives a better finish, particularly when used in conjuction with a Loople Cadmaflow projection with a little bit of cheese cake at the end.

7. Artists...

8. I like artists. I'd like to be one someday when I grow up.

I have to say Ravells, most of what you said went straight over my head, but I completely agree with you about the cheesecake. Mmmm, cheesecake!

9. I'm looking forward to seeing Seers GMaps
Well, pop on over and have a look, bigTF went up last night!

Any way, I gave your lighting method a modified run through in Global mapper using its sunlight shader(modifying sun azimuth and declination) to make masks for terrain cover based on direction/ sun exposure, works real good to position hi res Terragen generated textures (applied via photoshop in to an image)...then I realized I can get a mask out of Saga gis which can be set to an ungodly number of distinct colors for different facings/directionality of the terrain.....then I realized you probably already do it in GTS easier , so once again I am behind the curve...

SeerBlue

10. Using a Sobel algorithm(I think) to calculate the partial derivatives of the HF in the vertical direction and then calculating atan(∂y/∂x). You can use the result, truncated to [0, 7] to select thatch images by index. This could be quicker than running a full 3d render eight times. I will leave the implementation as an exercise for smarter people than myself(you).

Rockwell

I think you guys may enjoy this as much as your thesis on light effects.

Page 2 of 6 First 1234 ... Last

#### Posting Permissions

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