Reply
Reply
 
Thread Tools Display Modes
FAT_CAP's Avatar
Old (#1)
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. [img]/images/graemlins/smile.gif[/img]

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! [img]/images/graemlins/laugh.gif[/img]
Offline , polygon, 714 Posts, Join Date Oct 2004,  
   Reply With Quote

pior's Avatar
Old (#2)
Hi FC

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?
Offline , veteran polycounter, 4,988 Posts, Join Date Oct 2004, Location Irvine CA  
   Reply With Quote

Eric Chadwick's Avatar
Old (#3)
Pior's right, the bump map idea is exactly what's going on with specular width. Fine bumpiness = wide highlight. It may help to think about specular as being just a reflection of the light source. So when a surface is bumpy you're breaking up the reflection into lots of little reflections. Good example is the reflections of headlights in a rainy street at night.
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

perna's Avatar
Old (#4)
guys, the problem is there's no way you can add such fine detail to a bumpmap in a realtime environment. It works in theory, but not in practice.
FAT_CAP: An engine should give you per-material control of specular shape. Might even implement a control map, but that's generally not worth it performance wise
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

pior's Avatar
Old (#5)
Hmmm yeah Per I thought about that but I had no chance to check this in practice hence I thought it could be useful to share the idea anyway [img]/images/graemlins/smile.gif[/img]

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 [img]/images/graemlins/smile.gif[/img] Can't wait to see it solved!

pior
www.pioroberson.com
Offline , veteran polycounter, 4,988 Posts, Join Date Oct 2004, Location Irvine CA  
   Reply With Quote

kleinluka's Avatar
Old (#6)
like, shaders?
Offline , triangle, 320 Posts, Join Date Oct 2004, Location Montreal, Canada  
   Reply With Quote

FatAssasin's Avatar
Old (#7)
Bump maps will break up the specular highlight, but not really change how sharp it is. In a 3D app like Max, the spread of the specular highlight is controlled by the Gloss map. Pure white gives you sharp highlights, like in the eye, and closer to black gives you a nice spread out shine, like on cloth. Most, if any, game engines aren't going to give you two maps for specular control, but I'm sure that will change in the future.

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.
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

perna's Avatar
Old (#8)
FatAssasin: I find it funny that in your example of the highlight not changing size, it actually does change size [img]/images/graemlins/wink.gif[/img]

The idea of using bumpmaps for this kind of control is to emulate the process of real-life reflection. In your example you have big grains of bump; the actual idea is to have such fine bumps that the surface still looks smooth, and super-sample the final output.

Theoretically, it's all very simple: because the bumps contain so many different angles, light is sampled from a wide range of directions... which also explains why rounded edges of metallic objects are given that extra bit of highlight. No, it's not just because it looks cool in Quake3 [img]/images/graemlins/smile.gif[/img]
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

FatAssasin's Avatar
Old (#9)
[ QUOTE ]
FatAssasin: I find it funny that in your example of the highlight not changing size, it actually does change size [img]/images/graemlins/wink.gif[/img]

[/ 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.
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

perna's Avatar
Old (#10)
FatAssasin: You talk of what happens in the real world. Exactly. Has it never occurred to you that different materials in real life have different "specular" sizes?
When light values are clamped, as in your example, of course they won't contribute to the increased average light value of a super-sampled pixel.

It's as simple as this:

your example (8 samples):
((0.5 * 7) + (1.0)) / 8 = 0.7
High Dynamic Range:
((0.5 * 7) + (6.0)) / 8 = 1.2

in a proper example, the effect would be even greater as for the sake of simplicity I'm only calculating one highlighted sample in the above examples

Simply shine a real-world light on different surfaces and see how they react. Some low-quality scanline renderer isn't going to give you any kind of indication of the theory of light.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

FAT_CAP's Avatar
Old (#11)
Cool guys. Lots of discussion on the subject here - it seems like a problem alot of us have come up with before.

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.
Offline , polygon, 714 Posts, Join Date Oct 2004,  
   Reply With Quote

perna's Avatar
Old (#12)
If anybody is still not getting it, simply go around your house and look at (particularly) metallic objects. Notice how they catch more light at edges and corners. Now think about why this happens.

FAT_CAP: You'd need a second map to specify the shape of the highlight. At the moment, it's not worth it for performance reasons. Remember, though, that the effect can be emulated, often quite successfully, by breaking up the existing specular map. For lips, you can draw dark lines to represent the texture of the surface to constrain the size of the highlights there. Also, you can exaggerate angles and shapes in the normal map. 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.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

Eric Chadwick's Avatar
Old (#13)
One thing to consider is that spheres don't scatter a bumpy specular as well as flat surfaces, so it should be wider when seen on a flatter surface.

Per128, please do.
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

FatAssasin's Avatar
Old (#14)
[ QUOTE ]
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.
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

Eric Chadwick's Avatar
Old (#15)
Maybe not the best example, but maybe it gives you some idea.



3ds max 5.1
Scanline renderer
Max 2.5 Star supersampler
Specular Level = 100
Glossiness = 75
Left = no bump, right = bitmap Bump @ 100
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

perna's Avatar
Old (#16)
FatAssasin, for someone with complete disregard for light theory, you are surprisingly absolute in your opinions. You fail to address the examples I give, which means I don't exactly feel compelled to continue this discussion. I have told you the theory of why a bumpy surface alters the shape of a "specular" highlight, which is all you need to understand how this works. It's not like you have to trust my word for it, the theory is independently sound.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

FatAssasin's Avatar
Old (#17)
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.

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.
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

Eric Chadwick's Avatar
Old (#18)
[ QUOTE ]
[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_educat.../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.
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

CrazyButcher's Avatar
Old (#19)
the exponent of the specular term in the phong lighing equation is responsible for its shape afaik

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.
3dsmax scripts and .fx - pixeljetstream - expressing my own opinions
Offline , dedicated polycounter, 1,348 Posts, Join Date Nov 2004, Location Germany Send a message via ICQ to CrazyButcher  
   Reply With Quote

Eric Chadwick's Avatar
Old (#20)
[ QUOTE ]
[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.
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

FatAssasin's Avatar
Old (#21)
[ QUOTE ]
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. [img]/images/graemlins/smile.gif[/img]
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

perna's Avatar
Old (#22)
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. Your stance is that a finely grained bump map controlling the size of highlights is a "popular misconception", while it's a perfectly valid, practically and theoretically proven approach, and a simulation of real-life dynamics.

Below, you find two spheres. One with, and one without a bumpmap. You can easily see that the rightmost one alters the size of the highlight. All that's required for the correct result is for the supersampler to respect high dynamic range light, which the 3ds max scanline renderer does not do. I would assume Brazil or Mental Ray respect HDR, and if so they would render out a blurred version of the highlight of a much higher intensity(for proof of this theory, simply see the formula I provided above)



What gets to me about you, FatAssasin, is you have such a definitive stance, yet it's theoretically unqualified. If you are going to build your knowledge base of what is possible and what is not based on whether some people on a forum can provide you with images of proof rather than studying the theory of the matter, that's up to you, but it's not an approach I would recommend.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,102 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

Eric Chadwick's Avatar
Old (#23)
I'd like to hear more about "...if your normal map surface goes through a higher range, the specular highlight will appear smaller..."
Offline , Polycount.com Editor, 6,763 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

poopinmymouth's Avatar
Old (#24)
I have not yet used an engine where I could break up the specular to the degree I want using only a bump map. I crave a 2nd map that controls the spread of the specular, as well as the main map to control intensity and color. I think this is one of the main problems I have with most normal mapped games. Despite the bump/normal texture, the specular behaves the same over the whole object, making it look like a painted figurine or action figure. If there was a map to control the specular behavior in all its variations, I think we could get some much more believable materials in games.
Offline , veteran polycounter, 3,617 Posts, Join Date Oct 2004, Location Reykjavik, Iceland Send a message via ICQ to poopinmymouth Send a message via AIM to poopinmymouth Send a message via MSN to poopinmymouth Send a message via Yahoo to poopinmymouth Send a message via Skype™ to poopinmymouth  
   Reply With Quote

FatAssasin's Avatar
Old (#25)
[ QUOTE ]
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. [img]/images/graemlins/smile.gif[/img]

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?
Offline , polycounter, 813 Posts, Join Date Oct 2004, Location Kirkland, WA  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch