Hey - I've posted question this in my competition thread aswell - but I think that this is a better place to post it really... I know how easily posts can be missed in the competition forum if your not taking part yourself.
If this is against any board rules - MODS - please feel free to delete this thread.
I was wondering if anyone can help me out with some specular map questions I have (thats the next on my list to move onto).
How do I control the strength of the shine on different parts of the model? not just the brightness of the spec but the actual "glossiness".
i.e - the eyes should have small, "tight" highlights on them as they are very shiny and wet. However the skin should by less shiny and therefore the highlights would be larger and more diffuse. The teeth would have a specular somewhere inbetween the two.
How would I go about doing this in the constraints of this competition? I know that you paint a spec map much like a bump mamp - with white areas being more shiny and black areas being less-so... but this will only let me control the sttregth of the spec wont it? Not the actual "diffuse-ness" or "tightness" of the shine itself?
Reading this back - Im not sure if Im getting my point across very well!!! I dont really know the technical terms for what Im trying to achieve - or even if it is possible at all.
Anyway - I hope someone can help me out on this one - not long till deadline time now!
Replies
We had a neat discussion about this issue (and also many others) on the old board. I think I have it archieved somewhere, I'll see what i can do.
Besides that(and i don't know if it works or not) maybe you could try to use the bump map to get the control you want.
If you place many many little dots on the bump instead of a plain grey color, chances are that your spec highlight will be 'spread' accross these little dots, resulting in a less glossy, more rubber-like surface.
I still have to test this out myself, but I *guess* it may work okay?
Any other ideas polycounters?
And, well, even if fine details like that 'could' be added on a highresolution bump, the problem is not solved when the texture size decreases as LOD is getting down. Damn.
Is there a game engine that actually gives control to the specshape, as you suggest it? I always thought this factor as something hardcoded and hard to tweak. But yeah maybe it's doable, say, in doom3?
Now that I think of it, I believe that Vahl managed to pull off something of this kind. He managed to create nice 'wet paper' effect on the flamethrower texture some weeks ago, dunno how he did that tho. He might have an answer for you F_C.
This spec control is certainly a very important issue Can't wait to see it solved!
pior
www.pioroberson.com
Example:
Two spheres with the same gloss amount, but one has bump. Notice that the highlight doesn't change size.
To change the overall size of the highlight, use a gloss map. Sphere on the right has a lower gloss value and so the highlight spreads over more of the object.
FatAssasin: I find it funny that in your example of the highlight not changing size, it actually does change size
[/ QUOTE ]
I knew someone was going to say this. It really doesn't change size. I'm talking about the spread of the highlight over the entire surface of the sphere, not the illusion that it's gotten bigger because it's broken up a bit.
Here's another example:
Each sphere has a progressively smaller bump value applied to it. According to your theory, the last sphere should have a highlight that covers a lot more of the sphere than the first one, which has no bump. But instead the specular highlights are equal. And in fact, they are more or less the same size on all spheres. And, yes, I am using super sampling for the render.
Specularity in 3D is a complete hack, it's a way to fake what happens in the real world. This is why there is more than one control for the specular highligh in 3d apps. In Max, it's the Gloss value, in Maya, it's Roughness, Highlight Size, or Eccintricity.
If you really want to prove your point, create two spheres with radically differenct specular highlight sizes, like I have in my second example from my first post, using only a bump map. It just won't happen.
I'd actually thought of the bump map/ spec map with small, fine bumpiness - should give a "wider" specular highlight, driving home after I posted the question.
However, when I got around to trying it that night. I couldnt get the results I was wanting by simply using a spec map. However, I thought this might be down to my own unlearnedness in spec map/ material situations omre than anything!!!
The post by Ether (Caroline) in the pimping and previews is the sort of thing I was aiming for - where the lip has a tight specular over it - and the skin has a more diffuse shine...she used more complex material settings than a simple spec map though.
So it seems that this sort of thing cant be done with the simple spec maaps we have available to use in realtime situations at the minute - at least not with only 1 alpha map - for speclarity?
My original querey was directly linked to my competition entry for the Polycount Elementals challenge - so things like the glossiness material attribute aren't feasible solutions for me - only 1 alpha per map.
Per128, please do.
FatAssasin: You talk of what happens in the real world.
[/ QUOTE ]
No, I'm talking about what happens in a 3d rendering engine. You keep bringing up real world examples, and that just isn't going to help with the problem of controlling the size of spec highlights on the computer. I'll repeat, that's why there is more than one control for specularity in 3d apps. The sharp highlight on Ether's model comes from using a wetness map in Brazil's Skin shader. This is very similar to the Gloss map in Max's basic shader that I keep refering to.
And Fat_Cap, when you couldn't get the results you wanted it isn't because you don't know what you're doing, it's becuase it's doesn't work that way in 3D.
I would really love to see some actual examples of the specular hightlight on an object increase dramatically in size (like the difference between wet lips and dry skin) using only a bump map. It's a very popular misconception, and I'm trying to make sure it doesn't get passed on to someone just starting to research the matter.
Per128, you don't need to get your website up, just render out an example and post it up. If I'm wrong I'd really like to be educated as well.
3ds max 5.1
Scanline renderer
Max 2.5 Star supersampler
Specular Level = 100
Glossiness = 75
Left = no bump, right = bitmap Bump @ 100
Fat_Cap: To answer your initial question, "How would I go about doing this in the constraints of this competition?", what are the exact constraints?
Generally, in a game engine you're just not going to get the same amount of control over specular highlights that you're going to get within Max or Maya. You might just have to live with the limitations imposed by the contest rules. But I'm not familiar with what those are.
You can use normal maps right? Well, try using that to control specular size like Per and Eric say you can do with bump maps, but ultimately I think you're going to be dissappointed with the results.
I think you're best bet is to find a good medium sized highlight you can live with and then change the intensity using a spec map. I know that's not the answer you're looking for, but usually that's what you have to live with when making game ready art.
I don't know if you can use a reflection map, but that might be worth experimenting with. Use one map that contains sharp detail for the eyes and other very shiny parts, and then the specular map for softer, less shiny parts and keep the intensity low.
[FatAssasin] Okay, now make the specular highlight bigger to cover a greater area of the face using a smaller bump map. That's the theory right? I guarantee it's not going to happen.
[/ QUOTE ]
Right, but it's not gonna happen because software lighting doesn't emulate real-world lighting properly. There's a lot of scattering and light bouncing going on with real bumpy surfaces. A really wide highlight like you showed earlier is not a realistic one, unless the surface has a lot of scattering going on.
Neil has some nice examples here.
http://www.neilblevins.com/cg_education/aniso_ref/aniso_ref.htm
I agree that since we have very limited specular controls in current game hardware, it's probably better to come at it from another angle, like multiple reflection maps, or even by calling different mips from the same refmap (if you have that kind of control available). Although I do know for a fact you're not likely to get per-pixel mip-lookup control, since that approach is hardware-unfriendly (too bad though!).
[ QUOTE ]
[Per128] Remember that there's no world-size to specular highlights, only an angle-width size, so if your normal map surface goes through a higher range, the specular highlight will appear smaller. Maybe it's time I uploaded my website, I have a tutorial on this subject.
[/ QUOTE ]
I for one would like to hear more about this. I'm not quite understanding what you're saying Per128.
color = attenuation*(max(0,dot(N,L)*diffuse + pow(max(0,dot(N,H)),shi)*gloss)*lightColor
so the *gloss = specular map is just a multiply layer how much of your specularity is visible, the "shi" shininess factor would change the shape of the highlight.
since exponential functions are expensive and mostly approximated, there aint much variety in games yet. However with modern gpus it shouldnt be much of a problem anymore to get very decent shader support and change the exponent and with it the size.
[CrazyButcher] so the *gloss = specular map is just a multiply layer how much of your specularity is visible
[/ QUOTE ]
3ds max has it labelled backwards, not sure why. The spinner for Specular Level controls brightness, and the spinner Glossiness controls width/falloff.
We're using an exponential curve, not too expensive as far as what I hear. Here's an example of it running in our engine, ignore the temporary goofy distortion which will be going away soon. Anyhow, Specular Level was left constant, while Glossiness has been altered...
Hardware is apparently pretty limited with what it can do for your specular. This was from an ATI Radeon 9800 XT. On a NVIDIA GeForce FX 5200 there was some ugly dithering and banding. Oh well, not that visible in a typical gameplay scenario really.
FatAssasin, for someone with complete disregard for light theory, you are surprisingly absolute in your opinions.
[/ QUOTE ]
Easy there, big fella. I think we can continue to have an intelligent discussion about this. My whole point is that real world light physics don't apply when talking about how to get a certain effect in a game engine, which is explained perfectly by Eric when he says, "Right, but it's not gonna happen because software lighting doesn't emulate real-world lighting properly." That's been my exact point all along. I'm trying to give Fat_Cap an answer to his question that will work in a game engine and look good, not try to explain light theory and how light bounces around on objects in the real world. While it is definitely good to know the physics behind what happens in reality, I believe it's even better to know how to get what you want using the tools at hand.
Eric: Cool examples. I didn't know this functionality was being developed in a game engine. Glad to hear it is. I would also like to point out that it demonstrates the other point I was making, that is you need two controls for the specular size. One spec and one gloss (or whatever you want to call it).
So to sum up, what I'm trying to say (not very successfully it seems) is that in the particular case of wanting to control the size of a specular highlight in a 3d game engine, a bump map isn't going to do get the job done, regardless of how bumpiness works in the real world. What you really need are two seperate controls, as Eric has shown in his last example.
I'm not trying to start a war here, just tying to help out a fellow artist get the effect he's after, which everyone here is also trying to do. I just don't agree that a bump map is the right road to go down.
FatAssasin: We'd already established that the bump map route was not a viable one for real-time purposes before you even joined the discussion.
[/ QUOTE ]
Sorry, I didn't see that post then. That's all I've been saying this whole time. So we're actually in total agreement. I love it when we find out that we actually can all get along.
About my "stance that a finely grained bump map controlling the size of highlights is a 'popular misconception'", I'm talking about the very specific instance of using bump maps for controlling the size of specular highlight in a game engine. I'm not talking about theories and what happens in the real world, which I've tried to explain more than once. So I stand by my stance and sincerely doubt that we'll ever see bump maps used to control specular highlights in a game engine. The fact that it's a popular misconception in this particular case is bourn out by the first two posts in the thread.
So I'm not doubting your general theories of light or any of your equations. I'm sure you know way more about the subject than I do. So please keep in mind that I'm talking about the practicle usage of bump maps for controlling specular highlights in a game engine, and since we've already agree that it's not a good way to go, maybe we can think of other ways of helping this young man out.
Any ideas?
It's entirely possible to do this with the newer shaders (we are, on our new Xenon/PS3 game). Since they support loops & branching, you just have a loop that does the pow as many times as defined by the material attribute passed in. We do it on a polygon level (each poly has a material which specifies the spec power as well as the coloured gloss map to multiply it). It could be done with a separate map too, just use a texSampler to get the pixel colour, set it in range and use that as the number of pow loops to perform. I decided not to, as it's another map, and it just didn't need that much control. This can also be emulated on the older shader models, by having hard-coded shaders for each specular power (you only need a few in reality to get most of the looks you want). For exampole, Doom3 always used the same shader, so it always has the same degree of specular spread. If they'd added a couple others, they could have had nicer materials.
The soft, spread out highlights are a low power (cheaper in the shader - less ops) and the tight, hot ones are a very high power. Good for metals and the like.