Home Technical Talk

Baking Spec Maps Via Max

polycounter lvl 17
Offline / Send Message
seforin polycounter lvl 17
Ok this is something that I read a long time ago but never really had proper luck with and I wanted to see some good approaches / ideas on this.


before I never really realised how powerful max was with baxing out maps pre existing so I never really bothered I just did the maps I HAD to bake and couldnt create (normal maps ambient occlusion etc)


I read a tutorial a while ago about good ideas on baking spec maps and painting on top of this as well.


now heres my question and this goes both into props and character work.


Now since with max you can bake out diffuse maps if you have simple flat colors (IE a high poly mesh that you put individual colors on the individual props to bake from high to low to give you a color chart for your diffuse to work from)

now for your spec I read before its good to put on your mesh a standard color of some sort, a offset blue or whatever as a example, and put a system of lights in there and bake the map.


now here are my 2 questions


1- if I am baking a prop of lets say a gun, is it good to set a default flat color with no spec no anything and add lights to the scene, or should I I apply a color and play with the settings of each material so it has a certain gloss/ color to it Also, when applying lights in the scene before bakes of spec, what sort of settings should be done, just a simple 3 point light system, should the lights themselves have a color hint to it etc?

2- Same question again but this time character wise, since characters are a bit more relient on a spec color and spec level, is it good to break up chunks of a character into different color materials for different complexions or such, or is it again a good idea just to bake out a simple all standard color material for this, and again if adding lights to a scene what is good approaches simple 3 point light system? skylights? Lights with color etc?



Im going to be takling these new theorys/ idea for the dudley character Im working on some time in the next week, so I just want some good approaches/ ideas before I jump into this.



I hope to get a reply soon and Thank you :)

Replies

  • Rob Galanakis
    Why are you baking specular?
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    professor: I heard with lighting it gives you a better result depending on the object, its just a experiment for the most part
  • Rob Galanakis
    Smart people can say dumb things that are heard by the ignorant.
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    wow thats pretty harsh man? Was a simple question.

    also Pior was the one who posted that tutorial...take it up with him


    edit: I found the tutorial I was speaking about but I wanted a more indepth answer about good ideas and theory behind this creation.

    http://www.pioroberson.com/tuts/tut_texturing_tricks.htm
  • EarthQuake
    Smart people can say dumb things that are heard by the ignorant.

    Can we try and keep these sort of useless posts to GD, and out of tech?
  • TheSplash
    Baking specular is to get a base, further editing will be needed to add the higher and lower values within the different material areas like scratches, wet areas, dirty areas ect, do this in photoshop ect.
    You can bake one without without using lights.

    If you want to use lights like pior did, it's just to give a bit more variation in the spec, but he still painted in his more reflective areas by hand.

    On the colour thing, I believe he made his spec colour blue to somewhat counter-act the way game engines render specularity, which make highlights saturated. You can do this in photoshop also. It's fine to leave all the spec colours on your materials just white when you bake (so all grey spec materials) Unless you have something metallic or iridescent you know has a coloured reflection.

    So seforin, you are on the right track

    also, Professor420 your comments aren't very constructive...
  • stimpack
    Offline / Send Message
    stimpack polycounter lvl 10
    hrmm good question! ya know, i bake maps all the damn time, but i never really venture to try spec or any other ones. Ive done height a few times trying to use it like a cavity map but thats about it. Im not really sure how to go about setting up my scene to generate the most ideal specular output, but ill fool around and try soon! thx for bringing this up, now im curious enough to try it.
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    EarthQuake wrote: »
    Can we try and keep these sort of useless posts to GD, and out of tech?



    original un edited version was better :p


    - well yes I understand that you have to paint in the effects for additional highlights and scratches, but this still really dosent go much about the issue with adding lights and how they effect the overall mesh , and if this even is a good approach for spec color maps as well?
  • TheSplash
    A lot of people just multiply their AO on their spec maps rather than bake the spec with a lighting set-up.

    Ideally a spec map is a representation of the reflectivity values of a surface. And thats pretty much how it is in high end graphics engines and offline rendering.

    People put their AO in there to help bring out areas of their spec map and fake lighting in less complex lighting setups. Adding lights when baking your spec map is the same thing really.
    Just remember when baking lighting in to a spec map it's baking how much light the surface was reflecting under that lighting condition, not how reflective the surface is.

    Edit: Also spec colour would just be defined in your materials you are applying when baking. not in the lighting setup.
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    hmm I see so editting the materials themselves is pointless, and adding more light into a scene in theory works for a spec map, but the turn around time might just be easier to just bake a simple spec map and then toss on a AO on that and multiply it and then add all aditional spec map effects from there im assuming.


    hmm I guess the only thing left to wonder is how well it can handle a multi surface colored object (for a more humanoid model using different material colors for the specular color)


    Im guessing that in theory its the same as spec level but just tossing flat colors into it in theory..

    hmm I'll do a test this weekend on my sculpt character when I build the low poly, when im at the phaze past ambient and normal maps I'll save a copy of the scene one with a lighting system (basic 3 point) and one without and see which of the 2 can give a better result.

    I'll have something posted with more info on this weekend.


    if anyone else gets a result before me by all means please share :)


    PS: Thanks 'Splash
  • TheSplash
    umm well, editing the materials isn't pointless, thats where it gets the reflectivity values from when it bakes the map, also thats where it gets the colour from when baking the colour map.
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    ah but if you have the materials with certain settings in the scene and lighting then its all effected. Duh answer kinda straight foward I assume, so all these things do determine the end result.


    So I guess the best way I can approach this would be first set all the parts with the color materials/ single color material I will use, tweak the intensity / reflectivity of each material and then from there either do a bake or add lights to see how the bake is effected.


    oke' dokey I think I got this kinda planned out, I'll give you guys a result hopefully saturday or sunday :)
  • TheSplash
    The lighting in the scene will not affect the spec map bake as it bakes the specularity of the surface, I think what pior did was render a complete map or lighting map and used that as his spec map.
  • Mark Dygert
    Adding light color to your spec can be really helpful if you know exactly what kind of lights are all around your object keeping in mind that light, bounces off objects and that spec is reflection, it can help you color a jumble of UV pieces quickly.

    It's not so helpful for characters because they encounter a bunch of lighting scenarios as they move around. But its really helpful for environment pieces where the lighting is pretty much locked down. I've recently used it to help imply sunset values.

    Baking it out also comes in REALLY handy when you are using procedural maps (as a starting point) and you need your procedural mask, baked to your UV layout. I've recently used this for skunge on a window. Yes I could have drawn the skunge by hand but I already had the material, and adding the procedural mask took less time, so did baking it. Great base to start painting on.

    I remember a thread on this earlier but can't find it....

    Having pure white spec when your lights are colored just looks bad. Anything you can do to help yourself get to something that looks awesome in an efficient way should be on the table.

    There's a lot that goes into spec and what color it should be, its kind of hard to speak in general terms when there are so many different kinds of material that require different types of spec. With so many different kinds of materials on one object it gets really hard to create one lighting set up to work with them all for all things you're doing.
  • Mark Dygert
    Smart people can say dumb things that are heard by the ignorant.
    Indeed.

    Oh the irony...
  • Rob Galanakis
    Vig wrote: »
    Indeed.

    Oh the irony...

    I figured this would be taken the wrong way, my apologies... given that guess I probably shouldn't have left the comment as-was. I didn't mean ignorant as an insult to you seforin, if that makes sense. More ignorant as, people who aren't familiar with what someone (often a smart person) is talking about will take what that person says (sometimes a very stupid thing) to be correct, or wise.

    I should have read the original post more thoroughly, and taken another look at Pior's article before responding. I had forgotten exactly how he was using a specular bake.

    I have seen countless professionals give really bad advice (such as things like baking specular or multiplying the normal map), even from really high regarded people and studios. It is a real sore spot for me, because it obscures both the correct way to do things, and why assets are made in a certain way in the first place- it handicaps the potential quality of the piece and obscures the learning process. But the post hit a nerve it shouldn't have and a person usually smart jumped to a conclusion and said a stupid thing too many entirely non-ignorant people unfortunately saw.

    Sorry.
  • Mark Dygert
    There are a lot of ways to get something wrong and a lot of ways to get something right, often using the same technique. I've seen some brilliant and unconventional work, and I've also seen people try to take that process and apply it to things they probably shouldn't. That's the problem with advice, if the person receiving it doesn't apply it properly then the giver often looks like a douche.

    I think to learn properly you need to not worry about the amount of mistakes you'll make and try many things to find what works. Obviously being able to strain out what is most likely to work and trying that first is a good way to work. I wouldn't say there is one gold star standard "correct way" that applies to everything in every situation.

    Part of being a good artist in this industry is having quite a few tools in the shed and knowing which to pull out for what.
  • Eric Chadwick
    I still don't get why you want to bake specular lighting for a normal-mapped asset, makes no sense. I'm sure Pior does it differently now, that spec map he ended up with looks all sorts of wrong... little bright dots all over?

    Just look at your own face in a mirror. Move a light around. The shiny areas aren't isolated like this at all, they're relative to how taut or oily the skin is. Nose, eyelids, lips, above the eyebrows, ears.

    Painting it is so fast compared to baking. Baking it may seem like a shortcut, makes sense for other things, but for spec it really isn't faster/better.

    specular maps and normal maps
  • Mark Dygert
    I'd have to agree that baking spec is pretty useless, unless you're baking a procedural mask, or varied color to a UV jumble. Its easier to just paint spec from scratch or by manipulating the diffuse.
  • TheSplash
    Just look at your own face in a mirror. Move a light around. The shiny areas aren't isolated like this at all, they're relative to how taut or oily the skin is.

    Precisely
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Just to make sure everybody is a little more confused: you can bake reflection occlusion. it's pretty similar to ambient occlusion, but instead of weighting the occlusion samples based on the normal (and a cosine distribution) it uses the reflection vector. In clear, this maps represents the probability of having the reflection of an object occluded, rather than the diffuse lighting as in the case of ao.

    http://www.illuminatelabs.com/support/tutorial-folder/ambient-and-reflection-occlusion/

    cheeers :P
  • AnimeAngel
    That's interesting. What exactly would you use that for?
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    to modulate your specular map, pretty much as you would modulate your diffuse with ao.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Seems like that would be more appropriate for masking actual environment reflection maps, which tend to be sharper and more noticeable than specular highlights - I think if you just used a solid occlusion technique like that for specular maps you might get some strange looking results.

    An ambient occlusion map used as a modulator for a specular map would be more appropriate for a rough surface (wider highlight, not so shiny) whereas a sharp reflection occlusion map like the one shown in that PDF file would be better for smooth, shiny surfaces (like reflective metal).

    Good tip though.
  • AnimeAngel
    hmmm that's kinda kewl. So regular ambient occlusion for rough and sharp reflection occlusion for shiny Will have to try that.
  • Eric Chadwick
    I think if you attempt to bake reflection occlusion into a single map you won't get good results, because like specular it is view-angle dependent. Looks like Turtle is recalculating the reflection occlusion constantly.

    On the other hand ambient occlusion is not view-dependent, so it can be baked out once, as long as your mesh stays pretty much the same shape (doesn't change how it occludes itself).

    Brice, have you used a reflection occlusion map? Did it actually work well?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm good point Eric, I forgot to consider that.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    What do you mean Eric? You can't 'recalculate constantly' otherwise it won't be baking, I guess it's not what you're trying to say. Do you mean something like storing local occlusion in spherical harmonics? That's basically how you would do dynamic ambient occlusion (you could also do directional occlusion, which is pretty similar to RNM). Baking reflection occlusion, as well as ao is just a cheap approximation of that. And it works pretty well for glossy reflections :)
  • Eric Chadwick
    Yeah, I was wrong. Re-reading their PDF, I see they're advocating baking a sequence of reflection occlusion maps, which would be used as a pass for compositing a pre-rendered animation sequence. Not re-baking constantly on-the-fly, that makes no sense.
    ... in Reflection Occlusion, samples are distributed in a cone around
    the reflected camera ray from the sampled surface. ... Turtle did not ray-trace any
    reflections at all, so if we were to render out the Reflection Occlusion pass as a
    sequence, we could reuse it later without ever ray tracing the reflections in the
    ship.
    So, I don't think it's meant to be used for a real-time reflection occlusion. RO is view-dependent. But I'd love to be proven wrong, it'd be a nice effect to have.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    if you render a couple RO maps for camera positions distributed on a sphere (view directions) and then compress that data similar to SH Lighting, I think one could at least get something for realtime use that is at least direction dependent (relative position)

    when its unlikely that the camera is "inside" the objects bounding sphere, or rarely, the direction approximation might be sufficient... not sure if I don't oversee something showstopping, but I doubt they would have it in their product if it couldn't be used real-time somehow.

    And as the environment reflection via cubemap itself is approximated, I guess for the visual improvement of having those "darker" spots at all and "somewhat" right, for games in motion.. why not... its all about cheating anyway hehe
  • Jonathan
    I've seen it used by some character artists, but personally I have never used it.
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    are there any examples on how to do this technique you speak of crazybutcher? Im rather lost at the moment on how to set this up?
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    I just did a few tests, and the implementation of 'ro' in Turtle doesn't seem to be view dependent. Moving the camera around doesn't produce any difference in texture bake mode. My guess was that the weighting of the samples around the hemisphere is different, since they're using reflection vector instead of normal. A reflection vector being based on the normal and the light direction (I assume here that this light direction is distributed using a cosine on the hemisphere), I expect the distribution to be different. Wherever this is true or influence in any way the results is far beyond my math knowledge :)
    In practice, switching from ao to ro with the same presets (while you usually use a tighter cone angle for ro) produces different results. The falloff seems different, but so is the noise so I guess they use different implementations.
    I haven't used it that much yet, but it produce believable results for very glossy reflections, while I would never have thought to use a tighter cone angle than 180° to modulate specular maps.
    Anyway it would make sense to use this for directional occlusion, but maybe the number of samples (the ones I have seen for ao use four) should be higher considering view dependent effects varies more quickly.

    btw, in the case of offline rendering I don't really get the point, wouldn't it be as quick if not quicker to do a 'local raycasting' to catch the object inter-reflection, considering that we know where the camera is?
  • Eric Chadwick
    re: offline rendering, my guess is the RO map would be an aid in isolating the interreflections, so you could tone them up/down as needed, during compositing.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Whatever works, works!
    For sure that page I wrote is way old but even back then I stated that there is no 'true' way of doing things. Sometimes you want to lock shininess in place using white blotches in the spec. Sometimes not, ha!
  • EarthQuake
    pior wrote: »
    Whatever works, works!
    For sure that page I wrote is way old but even back then I stated that there is no 'true' way of doing things. Sometimes you want to lock shininess in place using white blotches in the spec. Sometimes not, ha!

    This is very true, and the best thing to do often comes down to exactly what sort of engine/lighting setup you're using. Sure you can break some stuff down mathematically and have all the theory you like, but when it comes to practical application you just need to do what looks best. =)
  • Eric Chadwick
    I agree, whatever floats your boat. The bright dots don't make sense to me, but Pior you do make great art, and that's all that counts.
Sign In or Register to comment.