More cottage bits
More cottage bits
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>
Last edited by RobA; 04-27-2010 at 03:47 PM.
My tutorials: Using GIMP to Create an Artistic Regional Map ~ All My Tutorials
My GIMP Scripts: Rotating Brush ~ Gradient from Image ~ Mosaic Tile Helper ~ Random Density Map ~ Subterranean Map Prettier ~ Tapered Stroke Path ~ Random Rotate Floating Layer ~ Batch Image to Pattern ~ Better Seamless Tiles ~ Tile Shuffle ~ Scale Pattern ~ Grid of Guides ~ Fractalize path ~ Label Points
My Maps: Finished Maps ~ Challenge Entries ~ My Portfolio: www.cartocopia.com
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.
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
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).
Astrographer - My blog.
Klarr
-How to Fit a Map to a Globe
-Regina, Jewel of the Spinward Main(uvmapping to apply icosahedral projection worldmaps to 3d globes)
-Building a Ridge Heightmap in PS
-Faking Morphological Dilate and Contract with PS
-Editing Noise Into Terrain the Burpwallow Way
-Wilbur is Waldronate's. I'm just a fan.
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.
Artists...
Bryan Ray, visual effects artist
http://www.bryanray.name