Shaded mountain symbols

Hey everyone :)

I've been thinking of making a set of shaded mountain symbols - simple top view mountains that react to the global sun in the same way that city building symbols do.

I've done my own set of buildings, and I understand how the pinky-bue "MAP" pngs work with the global sun to shade the rooftops correctly according to the angle and slope of the roof.

(MAP files are the pinky-purple files mixed in with the ordinary image files in any of the city symbol sets if you open the folder instead of the catalogue)

The amount of red in any one part of the MAP image corresponds to the direction in which the rooftop is facing, in CC3 compass degrees. The amount of blue in any one part represents the angle of the roof - the steeper, the bluer)

So... I've already done a building set, but mountains would be a lot trickier, since they are not composed of convenient planar surfaces that can be painted a particular shade of pinky blue for that angle and pitch. They would require a more natural painterly pinky-blue map for the shading - a hand painted one.

I'm trying to work out if there is any correlation between CC3 MAP colours, and 'Normal maps'. A normal map uses the green component of an RGB image as well as the red and blue, but if I simply create normal maps for my mountains and remove the green component of the image, am I going to end up with a usable MAP file?

I mean - are the two things even remotely related?

If not, then I will have to hand paint the MAP files using two layers in a GIMP file, and judge by eye and trial and error. That's going to be a whole load more complicated, which is why I thought I should ask if there was any kind of a relationship between CC3 MAP files, and Normal maps.

I could run a test by creating a symbol with a MAP file, and also with a Normal map that's had all the green taken out of it, but even just doing that would be very fiddly and time consuming if anyone just happens to know these things anyway...
«13456

Comments

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited December 2017
    Interesting question. But the answer is unfortunately no. A normal map uses all three colors to define the normal vector at any given point. Red = X, Green = Y and Blue = Z, but CC3 MAP files uses red to indicate compass direction (thus covering both X and Y using one color). Blue still has the same purpose, but I need to do some vector calculus to check if the values would be the same. It's been too long since last time I did that to quickly do it here and now, and since you already have the red+green issue, I don't think it is worth the effort brushing up on that.


    The next question is also how you intended to generate the normal map in the first place. If you planned on using a flat image in GIMP as a starting point, and just have GIMP generate the normal map, that doesn't give proper results, because GIMP only knows the colors in your image, and not how it slopes, so this method doesn't give good results. If you start out with a 3D-model of the mountain on the other hand, you should get a proper normal map from that(but again, it is not the same as a CC3+ roof map)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Thanks for applying your thoughts to this so quickly, Remy :)

    Now that I know there's no relation between the two things I won't waste any time attempting to generate normal maps (which I was going to do by creating the mountains initially in Blender and applying a normal map material to them).

    This is how I *think* I will do it in GIMP:

    First, draw the mountain, being careful not to add any shadows or highlights.

    Add a transparent layer and paint in blue in various levels of transparency to create the slopes (I think its: transparent = horizontal, 100% opacity = vertical, but I will check)

    Add a second transparent layer and create a conical fill that shades smoothly around the cone from transparent to 100% opaque red, and which leaves a sharp line between the two extremes at 90 degrees (?). This layer I will trim using the alpha mask of the mountain.

    This is the stage at which I may become thoroughly unstuck, since I then have to combine the red and the blue layers in such a way that the values are not compromised - so that no green, black or white is produced, and neither red nor blue dominates the other colour. Not entirely sure I know which blend mode to use!

    Once I've got that far I would export that as a transparent png, and make it my MAP.

    The mountain image would be an export of the rock texture blob I drew first.


    Do you think it might work?
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Actually...

    That's not going to work, is it - not unless my mountains are all perfectly conical!

    LOL!

    Back to the drawing board...
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited December 2017
    Posted By: LoopysueAdd a transparent layer and paint in blue in various levels of transparency to create the slopes (I think its: transparent = horizontal, 100% opacity = vertical, but I will check)
    No. It is various shades of blue, not varying degrees of transparency (transparency is anyway in the alpha channel, not in the color channel)

    Posted By: LoopysueAdd a second transparent layer and create a conical fill that shades smoothly around the cone from transparent to 100% opaque red, and which leaves a sharp line between the two extremes at 90 degrees (?).
    This works for rounded towers, but mountains most certainly would not have a smooth circle describing their cirumference.
    Edit: You managed to realize this before I posted :)
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited December 2017
    Posted By: LoopysueThis is the stage at which I may become thoroughly unstuck, since I then have to combine the red and the blue layers in such a way that the values are not compromised - so that no green, black or white is produced, and neither red nor blue dominates the other colour. Not entirely sure I know which blend mode to use!
    I think the screen blend mode should work fine (Assuming each layer only contains a single color component, with the other two set to zero). Difference should also work given the same assumption.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Posted By: Monsen
    Posted By: LoopysueAdd a transparent layer and paint in blue in various levels of transparency to create the slopes (I think its: transparent = horizontal, 100% opacity = vertical, but I will check)
    No. It is various shades of blue, not varying degrees of transparency (transparency is anyway in the alpha channel, not in the color channel)

    Posted By: LoopysueAdd a second transparent layer and create a conical fill that shades smoothly around the cone from transparent to 100% opaque red, and which leaves a sharp line between the two extremes at 90 degrees (?).
    This works for rounded towers, but mountains most certainly would not have a smooth circle describing their cirumference.
    Edit: You managed to realize this before I posted :)
    I need to merge the combined colour layers with a black background to create the shades? A white background?

    (My brain has reached maximum thinking capacity!)
    Posted By: Monsen
    Posted By: LoopysueThis is the stage at which I may become thoroughly unstuck, since I then have to combine the red and the blue layers in such a way that the values are not compromised - so that no green, black or white is produced, and neither red nor blue dominates the other colour. Not entirely sure I know which blend mode to use!
    I think the screen blend mode should work fine (Assuming each layer only contains a single color component, with the other two set to zero)
    I think you might be right ;)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I will then need to accurately mask the completed MAP image to the exact extent of the mountain, including the transparent fringe?
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited December 2017
    Posted By: Loopysue
    I need to merge the combined colour layers with a black background to create the shades? A white background?
    You shouldn't need to merge them with anything at all, all the color information is already in the color layers. For example, a 45-degree slope is represented by the color blue with the RGB components (0,0,191). Assuming the direction is facing north, that gives the RGB value of (64,0,0). Blend mode difference on those two yields (64,0,191) which is the final color you need [or (64,1,191) for varicolor], no need to mix it with anything else. Pixles not taking part in the map will be fully transparent of course, with a RGBA value of (0,0,0,0).
    Posted By: LoopysueI will then need to accurately mask the completed MAP image to the exact extent of the mountain, including the transparent fringe?
    This shouldn't be a problem as long as your map image start out the exact same size as the original image. You'll probalby keep the original layer on a temporary layer while working anyway.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Ok :)

    I wonder if the shading in CC3 works with variably transparent MAP pngs?

    I'm asking because of the way that the buildings MAPS work with a black background masked out, and no transparency in the colours at all...
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I'll try a rough MAP image and upload it here for comment, so you can see what I'm thinking in pictures
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    Posted By: LoopysueOk :)

    I wonder if the shading in CC3 works with variably transparent MAP pngs?

    I'm asking because of the way that the buildings MAPS work with a black background masked out, and no transparency in the colours at all...
    I am unsure what that would accomplish? The map file defines directions and slope by encoding it in RGB values in the file (very similar to what a normal map does), transparency doesn't really have any meaning in a map file (other than defining areas that are not part of the map)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    edited December 2017
    I think I might be a bit confused about all of this, but this is the two component parts of a straightforward conical spire with concave sides.

    [Image_10045]

    [Image_10046]
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I used the white blob to mask and trim the MAP colours.

    I will now try to remember how to create symbols and try it out - see how CC3 reacts. I have a feeling that where the Red is concerned I might get a sort of spiral effect :P
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Ok. I was right about the thing being wrong...
    Nope.jpg 109.4K
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I'm going to try merging the colour layer with white...
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    Your map contains illegal values for the slope angle. The blue component should never be below 128, as there is no way to represent an inward slope seen from above.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I've got it all very wrong :)

    The illegal values are down to me rushing into it without revising all the relevant information properly.

    Thanks for your help tonight, Remy. It must be most horribly late for you - its gone 3 am over here.

    Its time for me to leave it be and pick it up again in the morning now.

    Thanks again - and rest assured, I won't give up :)
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    See if this description helps any.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    aaaargh!

    Sorry!

    I mean... thank you, Joe! :D

    That is exactly what I want to do.

    Its just that I can't work out how to do that in GIMP, or Krita. There's no equivalent filter (unless I can mess with the normal map filter), and I really don't have the money for PS!

    ...

    As a side note - a suggestion

    Maybe those fully shaded mountain symbols you make that are in essence black and white symbols like the Schley ink symbols, would work even more beautifully if you put them underneath the LAND Sheet, and added a suitable blend mode to the LAND sheet to let them show through - something like Multiply? They would then be painted the same colour as the surrounding land, and merge seamlessly with the 'background' (which would really be the foreground then), raising themselves up underneath the colouring like folds in a tablecloth?

    You could put patches of mountain fill on a secondary LAND sheet wherever you placed the mountains in your map, to make them more... 'mountainy' (though you might have to copy those patches to the main LAND sheet and turn them solid magenta and use a Colour Key to cut them out of the general land colouring on the primary LAND sheet)

    It looks fabulous in my imagination, but sounds horrendously complicated in words. If I get as far as making my own shaded mountains without PS, I'll show you what I mean. Its the same technique that Storm is using for her watercolour maps, but using shaded top down mountains, instead of ordinary black and white ISO symbols :)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    edited December 2017
    I'm going to try something...

    I'm going to go back to the Blender idea, and try to develop a shader that will cause the right colours to appear on the mountain model, so that I can render the MAP files directly from Blender...

    Another question:

    If I create a symbol that is totally transparent, but with a MAP file accurately and correctly rendered from Blender, will the 'invisible' symbol react to CC3+ global sun?

    EDIT: the way I envisage that scenario is that it could be possible to create a set of 'shadow symbols' that are totally transparent, but which create the shadows that describe a mountain. You wouldn't have to faff around with moving the LAND sheet or adding any effects to that sheet if these shadow symbols were possible... You could just do the map the usual way, and add the mountain shading to the areas already denoted as mountainous by the filled polys on the MOUNTAIN sheet.

    (I'm so sorry - my brain seems to be doing overtime!)
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    It's possible to convert a regular normal map into a ProFantasy-style normal map in GIMP. You'll need to find someone whose script-fu is better than mine, though. The following code snippet should be helpful:

    float nx = GetRValue(GetPixel(x, y));
    float ny = GetGValue(GetPixel(x, y));
    float nz = GetBValue(GetPixel(x, y)) * scale;
    float t = sqrt(nx*nx + ny*ny + nz*nz);
    nx = nx / t;
    ny = ny / t;
    nz = nz / t;

    float az = atan2(ny, nx);
    float r = sqrt(nx*nx + ny*ny + nz*nz);
    float el = acos(nz / r);

    az = fmod(-az + 6.2831853, 6.2831853);
    el = 2 * (3.14159265 / 2 - el) + 3.14159265;

    PutPixel(x, y, RGB((az / 6.2831853) * 255, 0, (el / 6.2831853) * 255));
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    I don't know for sure what would happen with a totally transparent image. It might all get discarded before the shading can happen or the alpha might modulate the shading (make it less intense). You might be able to get a very small alpha value (say, 1) that would still let the shading work.
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    That particular tutorial is geared toward enabling the type of problem that LadieStorm mentioned with regards to getting textured mountains.
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    Note that the only thing that I used Photoshop for here was to chop off the sea parts of the background map. I probably should have used paint or some such.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I think I must be misunderstanding.

    I've definitely just thrown a mental cog somewhere, since I can't get Blender to do more than half the job for me, so its back to hand-drawn/Wilbur now.

    The bit I'm not getting is this instruction:

    "Use Texture>>Other Maps>>PF Angle Map with a Vertical Scale value of 120 to generate a ProFantasy-
    style angle map that will work with the CC3+ lighting computations:"

    Is that in Wilbur, or PS?

    (I'm on Linux right now so I can't open Wilbur to see. My Win 10 partition has become a total nightmare. Every time I open it it starts automatically downloading 'critical' updates, and I just don't have the Broadband to cope with it right now, so I'm kind of stuck on my new Linux partition for the next couple of weeks... thank goodness I have an alternative, even if its not ideal for this particular job. If this is Wilbur, I can't do it for a couple of weeks, but it would be nice to know what I need to do to fix what I'm doing wrong :) )

    Also, please can I have a link to "Fun with Wilbur Vol 6"? I've got it somewhere on my Window partition, but I can't seem to find it!
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    I used Photoshop exactly once in the process: removing the background from the land/sea mask to make it transparent.

    The "Texture>>Other Maps>>PF Angle Map" is a Wilbur process.

    You should be able to run Wilbur under WINE. I suppose I should try it some day...

    All of the earlier "Fun With Wilbur" tutorials can be found at the Wilbur site ( http://www.fracterra.com/wilbur.html ) at the bottom of the page. There are PDF versions at https://www.cartographersguild.com/showthread.php?t=29412 if you prefer those. I still need to get vol 7 posted elsewhere.
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    I will try Wilbur again with Playonlinux tonight. It may be that others can get it to run on earlier linux distros. The one I have is Mint 18.3, which is one of the newest distros - ironically a heck of a lot like a Windows interface - Windows as it was before MS started to treat us all like everything was too dangerous and grown up for us to be allowed to get our little mits on the controls! Something like Windows 3.1, or XP

    Thanks for the reference. I'll revise Vol 6 as well :)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    edited December 2017
    Sorry - it crashed again :(

    Also having trouble running CC3+ on Linuxmint through Wine/Playonlinux as well. It opens, but all the toolbars and symbol trays and everything - no sight of them.

    I've tried to upload the log file, but it might not work....

    (it didn't work)
  • LoopysueLoopysue ProFantasy 🖼️ 40 images Cartographer
    Ok. I'm back on Windows (for the time being) so I can do something about these mountains.

    I've got a few more questions before I really get going with this.

    Well, its more of a thought process I need to share with you for your feedback.

    Top down shaded mountains aren't going to be as easy to use as ISO mountains. That's because overlapping them will create peculiar 'mountain on top of a mountain' visual effects, where the symbol in front will look like its sitting right on top of the symbol its overlapping.

    So. It would be better to make them with some kind of regular footprint so that they can be butted up to one another but not overlap all that much except here and there just a little bit.

    That's screaming 'Hexagons' at me, and I really don't like hexagons. Too regular for my tastes.

    Thinking of all kinds of solutions...

    How about a range of different shaped footprints - triangular, pentagonal, hexagonal, septagonal - all with a standard side length (note how I've deliberately omitted square and gone no more towards circular than septagonal. Square and octagonal mountains would just look too geometric... I think)

    I can make them lumpy and bumpy within those footprints, and the edges don't have to be perfectly straight (they might even be slightly convex or concave), nor the corners sharp (some can be rounded right off). I'm just talking about the vague basic footprint shapes here.

    Any thoughts on the matter?
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    There are only three regular shapes that can regularly tile the plane (equilateral triangle, square, and hexagon). Conveniently, CC3+ supports snapping to those grid shapes with its snap feature. There are, however, infinitely many non-regular shapes and sets of shapes that can regularly (e.g. octagon + square) or irregularly (e.g. Penrose tilings or Wang dominoes) tile the plane. Inconveniently, CC3 doesn't support snapping to those sort of grids. http://mskmoon.weebly.com/uploads/1/7/1/8/17186300/ma8_ch_12.pdf is part of a nice workbook on tessellations that might be useful for understanding the topic.

    If you're willing to allow for some overlap, then you should be able to get solid approximations on any of the standard grids. For example, the multi-sided shapes with irregular edges that you describe above could use a hex grid for the snap placement to keep things from getting too close together, but allow for some overlap in the edges. If you're careful about how you construct the coloration, you should be able to achieve a good effect with minimal visual artifacts. The solid-white or solid-texture underlayment that you described in your first post will minimize visible artifacts due to overlap. Setting a random rotation attribute for the symbol would also serve to reduce the visible artifacts.

    The ideal solution for this kind of operation is to use a symbol with a "height" texture that would create an offscreen height map that's then illuminated as a single operation at the end of rendering the sheet. Each symbol would add to or subtract from that height field, allowing creation of roughness without overlap. Adding on a coloring-by-height operation would allow most of the visible effects of Wilbur or FT3 without too much effort and all from the comfort of CC3+. However, what I'm describing would take a fair bit of code to make work.
Sign In or Register to comment.