Specular Maps and Map Geometry

ZurikiZuriki Join Date: 2010-11-20 Member: 75105Members
<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?

Comments

  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    For world textures, the specular map is stored in the diffuse map's alpha channel. Assuming you have the Nvidia DDS plugin, load one of the world textures up in Photoshop to see what I mean.
  • ZurikiZuriki Join Date: 2010-11-20 Member: 75105Members
    That seems very unintuitive to have different rules for the same ends. Thanks for the assistance, I'll go an merge my specular map into the alpha channel then.
  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members
    So it's possible to fix the reflective look?

    What about the way model edges are smooth, i want sharp edges but the lighting doesn't seem to allow it?
  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1884067:date=Nov 7 2011, 08:13 AM:name=Zuriki)--><div class='quotetop'>QUOTE (Zuriki @ Nov 7 2011, 08:13 AM) <a href="index.php?act=findpost&pid=1884067"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That seems very unintuitive to have different rules for the same ends. Thanks for the assistance, I'll go an merge my specular map into the alpha channel then.<!--QuoteEnd--></div><!--QuoteEEnd-->
    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.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    Lumping greyscale maps into alpha channels of diffuse maps, or even building entire RGB images out of a series of greyscale maps is not entirely uncommon in games. Source uses all sorts of weird and wonderful mapping rules and normal maps are essentially three greyscale maps combined into one image.
  • ZurikiZuriki Join Date: 2010-11-20 Member: 75105Members
    <!--quoteo(post=1884132:date=Nov 7 2011, 07:43 PM:name=Chris0132)--><div class='quotetop'>QUOTE (Chris0132 @ Nov 7 2011, 07:43 PM) <a href="index.php?act=findpost&pid=1884132"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Lumping greyscale maps into alpha channels of diffuse maps, or even building entire RGB images out of a series of greyscale maps is not entirely uncommon in games. Source uses all sorts of weird and wonderful mapping rules and normal maps are essentially three greyscale maps combined into one image.<!--QuoteEnd--></div><!--QuoteEEnd-->
    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".
  • marksmarks Join Date: 2008-07-28 Member: 64720Members
    Doesnt seem out of place at all to me ..
  • ZurikiZuriki Join Date: 2010-11-20 Member: 75105Members
    I have the feeling people are misunderstanding me. The system of alpha specularlity does not concern me. This is normal. It's the TWO SYSTEMS part that is unintuitive.

    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.
  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1884399:date=Nov 9 2011, 05:26 AM:name=Zuriki)--><div class='quotetop'>QUOTE (Zuriki @ Nov 9 2011, 05:26 AM) <a href="index.php?act=findpost&pid=1884399"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->
    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.
  • ZurikiZuriki Join Date: 2010-11-20 Member: 75105Members
    I guess I didn't consider that, that combined with the fact that it was a part of early optimization makes sense why it is how it is. But it's still a quirk of the engine, it's still two specularity systems working side-by side with different methods of use for each. It'll be a lot nicer when both options are available to both geometry and props/entities. Also, on the subject, what is the deal with alpha maps and geometry. Will the new system allow for varying opacity rather than completely opaque or completely transparent like it is now?
  • marksmarks Join Date: 2008-07-28 Member: 64720Members
    <!--quoteo(post=1884457:date=Nov 9 2011, 07:13 PM:name=Max)--><div class='quotetop'>QUOTE (Max @ Nov 9 2011, 07:13 PM) <a href="index.php?act=findpost&pid=1884457"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
Sign In or Register to comment.