This is for our application, "Knowledge base for World of Tanks"(a bit of ads:
https://play.google.com/store/apps/details?id=com.enigmapro.wot.knowlege&hl=en), we have activity "Armor piercer" which shows probability to penetrate armor of tank with selected shell.
Tank has different armor values in different places (these values are stored in the texture of object). Armor of tank can be of two types
main and
spaced.
For for user it is ok when he looks on main armor (if main penetrated - damage is dealt).
Several words on shader - its work is pretty simple - it apply lightning based on angle and armor values.
Next goes the pain - spaced armor. Spaced armor covers main armor with thin armor (here i will not dive deep into game penetration mechanics).
In example: we have penetration value of 200mm. And we are looking on tank, it has main armor 250mm covered with 100mm spaced armor.
---> |
100mm |
250mmSo totally we need to penetrate 100 + 250 = 350mm; our current penetration is 200mm
We are looking on tank and first we see spaced armor which is 100mm and shader shows that we can damage tank here. because shader doesnt know anything about armor layers which are deeper.
You can watch video
https://youtu.be/ATzzXN0hTaU?t=461 (video in on russian lang, but dont worry it wont matter)
Maybe there is some way add renderhook, hide spaced armors, render probability values into texture. unhide spaced armor, render in second pass...