浏览代码

read texture scale and offset from main text in main tex mask mode

/semantic_shader_tests
Mohsen Kamalzadeh 3 年前
当前提交
6de91597
共有 5 个文件被更改,包括 32 次插入10 次删除
  1. 8
      TestProjects/PerceptionURP/Assets/Lit.mat
  2. 4
      TestProjects/PerceptionURP/Assets/Scenes/ShaderTests.unity
  3. 4
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat
  4. 13
      com.unity.perception/Runtime/GroundTruth/RenderPasses/CrossPipelinePasses/InstanceSegmentationCrossPipelinePass.cs
  5. 13
      com.unity.perception/Runtime/GroundTruth/RenderPasses/CrossPipelinePasses/SemanticSegmentationCrossPipelinePass.cs

8
TestProjects/PerceptionURP/Assets/Lit.mat


m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 6c6d5e5cce7b447ca891dde4bcf949a2, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Scale: {x: 1, y: 3.84}
m_Offset: {x: 0.36, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}

m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 6c6d5e5cce7b447ca891dde4bcf949a2, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Scale: {x: 1, y: 3.84}
m_Offset: {x: 0.36, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}

4
TestProjects/PerceptionURP/Assets/Scenes/ShaderTests.unity


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0.18995228, y: 0, z: 0, w: 0.98179334}
m_LocalPosition: {x: 76.2, y: 135.9, z: -262.6}
m_LocalPosition: {x: 76.2, y: 127.5, z: -241.6}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Children: []
m_Father: {fileID: 0}

m_EditorClassIdentifier:
useSegmentationMask: 1
segmentationMask: {fileID: 2800000, guid: 474275722ca6a4570bf9773fed7b079d, type: 3}
useMainTextureAsSegmask: 0
useMainTextureAsSegmask: 1
--- !u!65 &1762131275
BoxCollider:
m_ObjectHideFlags: 0

4
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat


m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 1
- _BackTransparency: 0.08
- _BackTransparency: 0
- _Blend: 2
- _BlendOp: 0
- _BumpScale: 1

- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _SegmentTransparency: 1
- _SegmentTransparency: 0.8
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0

13
com.unity.perception/Runtime/GroundTruth/RenderPasses/CrossPipelinePasses/InstanceSegmentationCrossPipelinePass.cs


mpb.SetVector(k_SegmentationIdProperty, (Color)color);
Texture mainTex = null;
var mainTexSt = new Vector4(1, 1, 0, 0);
mainTex = renderer.material.GetTexture("_MainTex");
var mat = renderer.material;
mainTex = mat.GetTexture("_MainTex");
mainTexSt.x = mat.mainTextureScale.x;
mainTexSt.y = mat.mainTextureScale.y;
mainTexSt.z = mat.mainTextureOffset.x;
mainTexSt.w = mat.mainTextureOffset.y;
// if (maintex)
// mpb.SetTexture("_MainTex", renderer.material.GetTexture("_MainTex"));
}

if (mainTex == null)
Debug.LogError("No texture found on object");
else
{
}
mpb.SetVector("_MainTex_ST", mainTexSt);
}
//mpb.SetFloat("_TransparencyThreshold", segBeh.opacityThreshold);
}

13
com.unity.perception/Runtime/GroundTruth/RenderPasses/CrossPipelinePasses/SemanticSegmentationCrossPipelinePass.cs


mpb.SetVector(k_LabelingId, found ? entry.color : Color.black);
Texture mainTex = null;
var mainTexSt = new Vector4(1, 1, 0, 0);
mainTex = renderer.material.GetTexture("_MainTex");
var mat = renderer.material;
mainTex = mat.GetTexture("_MainTex");
mainTexSt.x = mat.mainTextureScale.x;
mainTexSt.y = mat.mainTextureScale.y;
mainTexSt.z = mat.mainTextureOffset.x;
mainTexSt.w = mat.mainTextureOffset.y;
// if (maintex)
// mpb.SetTexture("_MainTex", renderer.material.GetTexture("_MainTex"));
}

if (mainTex == null)
Debug.LogError("No texture found on object");
else
{
}
mpb.SetVector("_MainTex_ST", mainTexSt);
}
//mpb.SetFloat("_TransparencyThreshold", segBeh.opacityThreshold);
}

正在加载...
取消
保存