Sorry for the late reply,
Actually, my problem is VR camera renders a white background with non-environment objects. This make transparent objects got problem when dragged to webcam area . I did a small change in VirtualCameraAR and CompositorRGBA shader so that camera don't render the background
*** VirtualCameraAR.cs: set only _compositorCamera.cullingMask when render non-environment objs
private void RenderRGBA(ZView zView)
{
=======================================
// Render all non-environment objects including the box mask.
_secondaryCamera.clearFlags = CameraClearFlags.Skybox;
_secondaryCamera.backgroundColor = MASK_COLOR;
_secondaryCamera.cullingMask = _compositorCamera.cullingMask ;
_secondaryCamera.targetTexture = _nonEnvironmentRenderTexture;
_secondaryCamera.Render();
=======================================
}
*** CompositorRGBA.shader : set mainColor alpha is 1 when maskDepth = 1
float4 depthMask(v2f pixelData) : COLOR0
{
float maskDepth = DecodeFloatRGBA(tex2D(_MaskDepthTexture, pixelData.uv));
float4 mainColor = tex2D(_MainTex, pixelData.uv);
float4 nonEnvironmentColor = tex2D(_NonEnvironmentTexture, pixelData.uv);
if (maskDepth < 0.999)
{
return nonEnvironmentColor;
}
else
{
mainColor.a = 1;
return mainColor;
}
}