Specular Maps and Map Geometry
<div class="IPBDescription">Specular maps only work on props?</div>I've tried applying a specular map to a material to be used in geometry and it didn't appear to work, instead I just got the same old default super-reflective surface. I've noticed only entities and props have specular maps in their materials and none of the usual map geometry materials have them at all. So I was wondering if map geometry can't have specular maps, which seems rather strange to me.
If it's true that map geometry can't have specular maps, how do I simulate that effect so I don't get the epic reflection from light sources?
If it's true that map geometry can't have specular maps, how do I simulate that effect so I don't get the epic reflection from light sources?
Comments
What about the way model edges are smooth, i want sharp edges but the lighting doesn't seem to allow it?
This was an optimization. We packed the specular map into the environmental textures because we originally assumed that we were going to have a lot more environmental textures than model textures, and packing them saves memory and a texture read. It turns out our levels are made out of a lot of props rather than brush geometry, so this decision doesn't make as much sense anymore.
We have a more complex material system that hasn't been fully integrated into the engine yet, but when it is it will allow more flexibility than what we have now. With that new system, some environmental textures could use a separate specular map, some model textures could use a packed specular map, etc.
I absolutely understand the reasons behind packing a specular map in a diffuse map, and I don't contest that it makes sense. It does not however, make sense to have geometry follow the packed-in rule, and props/models to follow the separate images rule. That was what was unintuitive. But Max explained the reasons why, and I guess it's now just "one of those quirks".
If you have alpha specularity for geometry and then for props/entities you have a separate specular map, that doesn't make sense. It's two systems to meet the same ends.
They're not exactly the same, since the specular map can be full color. Metal typically has a specular color which is the same as the color of the material, so for the environment textures I just derived the specular color from the diffuse color. For something like skin, you want the specular to be a bit bluish, so that's why we went with a full color map for models.
Yeah, basically conductor materials like metals DONT have white specular highlights - its almost always a tinted hue. On the other hand, dielectrics (like skin) almost always DO have perfectly white specular highlights. And due to the additive blending model, that means that dialectric materials need to have a specular colour that is the inverse of the diffuse colour (why you put blue spec on skin).
In my experience, metals work best with a greyscale specular, color is kind of a waste performance-wise. You dont get much more out of color specs. Conductor materials like metal usually have tinted specular reflections of the same colour ... which you can achieve nicely with a greyscale specular (due to the additive blending model) as long as there is colour in your diffuse.
The way its being handled seems pretty smart to me - I like how you've separated the specular intensity and specular color components.
In fact, I'd be interested to hear how you're handling the colour component of the specular code-side :) if its relatively cheap I may need to send you an email about it.