Home Dota 2

Is gamma correction up in the two masks of dota2 material?

Ifurzzar
null
Offline / Send Message
Ifurzzar null
I am now trying to apply dota2 model's materials in Blender, and this question comes to m:, when I use the two masks, should I use without gamma or not? that is, when source engine uses the channels of the mask, does it apply gamma correction to them or not?
thanks in advance

Replies

  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    I think the people who will be able to help you with this are :

    The Marmoset guys : http://www.polycount.com/forum/showthread.php?t=131511
    The Substance guys : http://www.polycount.com/forum/showthread.php?t=121906
    The polycounters who successfully ported the Dota2 shader to Max and Maya : http://www.polycount.com/forum/showthread.php?t=110022
    ReMixx, who created the Dotahattery : http://www.polycount.com/forum/showthread.php?t=139080

    as these are the only (reverse-engineered) implementations of the dota2 shader outside of Source at the moment. The most recent version of the Max shader above seems to be very accurate to me, so maybe that will be a good starting point.

    Good luck ! It would be great for Blender to have both a realtime and a Cycles Dota2 shader one day.
  • ReMixx
    Options
    Offline / Send Message
    For the Hattery, I treat the masks the same as the diffuse and normal maps. I assume they have gamma premultiplied into them. Otherwise the colors appear too bright/vibrant/saturated.
  • Ifurzzar
    Options
    Offline / Send Message
    Ifurzzar null
    ReMixx wrote: »
    For the Hattery, I treat the masks the same as the diffuse and normal maps. I assume they have gamma premultiplied into them. Otherwise the colors appear too bright/vibrant/saturated.

    Sorry I don't quite get it, Do you mean you use the masks as what they visually look like? then how about the normal map? in blender cycles if you don't set normal map to 'non-color-data'(kick out gamma, revert the image back, resulting a brighter image) as opposed to 'color', you get very odd and unnatural shading, do you kick out the gamma before using the normal? and the two masks?
  • ReMixx
    Options
    Offline / Send Message
    Honestly I don't know how Blender handles it. You may just have to experiment and see whatever looks closest to in-game. :/
  • Vovosunt
    Options
    Offline / Send Message
    Vovosunt polycounter lvl 4
    It is highly unlikely that they actually use gamma correction as the dota materials do not use physically based shading (for example the diffuse texture has shadows already premultiplied => not albedo) therefore using the linear gamma workflow would just take more processing time for no real reason. BTW using it only for the masks makes no sense at all since if are using a linear gamma workflow you kind of have to use it everywhere.
  • Ifurzzar
    Options
    Offline / Send Message
    Ifurzzar null
    well, I tried either, but anyway many times I have to dramatically change the mask's grey scale to approximate the in-game looking, my personal conclusion is the ray-tracing rendering is too different than the game-area rendering techniques, a huge amount of manual adjusting is needed.
  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    Blender notes, FWIW... In the internal (legacy) renderer, gamma is applied automatically within node groups. You can see what's going on by dropping an RGB input node in and having a look at the values vs. the color scale on the side. i.e. for 50% gray the values will be ~0.5^2.2. This also applies to textures, so if you're using a mask and want 50% grey to equate to 0.5 then you will need to apply an inverse gamma correction.

    As to what's going on in Source... Pass, see answers above. :)
  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    Ok, so been doing some tests on a variety of models with this shader to see how to deal with masks and textures. It's a bit tricky trying to reverse engineer it, so this is only my best guess at this stage.

    Right now it seems that masks do have gamma correction applied (default behavior in Blender). It also appears that textures are corrected (->linear space, makes sense), however I've had to apply an inverse to the fresnel terms otherwise they seem to be too weak.

    I've based these assumption by playing around with Ogre Magi/Nyx (spec blows out with uncorrected mask textures), Naga Siren (colour blows out if textures are uncorrected), and Disruptor (sash detail does not show up with corrected spec warp). I've also tested Puck's fresnel colour warp and think I've got that working properly as well.

    On an unrelated note I wouldn't mind knowing exactly how the specular cube maps are masked out (apart from by metalness if selected, obviously), as putting them through spec and tint masks as well seems to make them end up too weak, particularly on Legion Commander where the effect is pretty much neutralised.
Sign In or Register to comment.