small tweaks

pull/13/head
Andrew Cassidy 4 years ago
parent 0ded82f409
commit ffff9d629c
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b71c371f4db1ec56730e30d79c3dcfaeca02167a15e25d595e066907f4e5a3a
oid sha256:928c876dbb2ffadb39a567a5d74bef52f3fc466030b75e15ca67bd895ba2684e
size 29184

@ -427,6 +427,5 @@ namespace ConformalDecals {
target.Render(decalMaterial, part.mpb, camera);
}
}
}
}

@ -17,6 +17,9 @@ namespace ConformalDecals {
// property block
private readonly MaterialPropertyBlock _decalMPB;
private static readonly int normalID = Shader.PropertyToID("_BumpMap");
private static readonly int normalIDST = Shader.PropertyToID("_BumpMap_ST");
public ProjectionTarget(MeshRenderer targetRenderer, Mesh targetMesh, bool useBaseNormal) {
target = targetRenderer.transform;
@ -26,10 +29,7 @@ namespace ConformalDecals {
_decalMPB = new MaterialPropertyBlock();
if (useBaseNormal) {
var normalID = Shader.PropertyToID("_BumpMap");
var normalIDST = Shader.PropertyToID("_BumpMap_ST");
if (useBaseNormal && targetMaterial.HasProperty(normalID)) {
var normal = targetMaterial.GetTexture(normalID);
if (normal != null) {

Loading…
Cancel
Save