The sprites always orient towards the camera. It would be better if the decal reflected the orientation of the mesh normal hit by the ray cast.
Monday, December 28, 2020
Harry is going to expand the ShotCollisionResponse so it supports randomly choosing from a list of pools. I'm going to write a uscript to handle any number of things that might be beneficial when spawning the decals. A few considerations off the top of my head:
- randomization of rot.z
- bounded (min/max) randomization of decal size
- color float adjustment
- Material/Shader adjustments (the BulletHoleDecal script already handles materials in some capacity, but I know nothing about this, so some digging is warranted).
- material/shader adjustments despawn time (this already exists in the DespawnPoolObject script, but perhaps consolidation is in order)
Sunday, December 27, 2020
While not ideal, I gave the decal prefab a parent object, which is offset by -.015 units, and this does produce the desired result. I suppose this will suffice...for now. Still, why should this be required in the first place? It was only required because the Saloon mesh was set 180° on the y axis due to its export orientation. The decals hover slightly above the mesh surface, so when the mesh is improperly oriented, the decals will exhibit less than ideal behavior.
Also, I created a customized duplicate of the decal--one that contains some value adjustments--and assigned it Multiplicative shader.
I offset the pos.z by -.015 thinking maybe I could force the issue, but this doesn't work; although I didn't think it would. There's also a flag for ApplyOrientToSurface, but IIRC that applies to the particle fx. Regardless, I tried it, and it also didn't fix the issue. I suppose I could force it by having the decals draw on top of everything else, but that's more of a hack than a solution... :/
Reduced the scale by nearly a 1000% percent (maybe not the best way?) and while the decal looks to be about the correct size, it is slightly embedded (~.02 units) in the saloon mesh, which means it is not visible to the player
I'm using a version of the BulletHole prefab in my attempt to troubleshoot exactly why this isn't working as expected.