浏览代码

PR feedback

/1.5-preview
Jimmy Alamparambil 6 年前
当前提交
f6c74116
共有 6 个文件被更改,包括 53 次插入48 次删除
  1. 61
      Assets/LWRPSupport/ARCoreBackgroundLWRP.shader
  2. 12
      Assets/LWRPSupport/ARKitLWRPShader.shader
  3. 4
      Assets/LWRPSupport/LWRPBackgroundRenderer.cs
  4. 5
      Assets/LWRPSupport/LWRPBackroundRendererAsset.cs
  5. 10
      Assets/LWRPSupport/LWRPBeforeCameraRender.cs
  6. 9
      Packages/manifest.json

61
Assets/LWRPSupport/ARCoreBackgroundLWRP.shader


Shader "Unlit/ARCoreBackgroundLWRP"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
// For GLES3
SubShader
{
Pass
{
ZWrite Off
// For GLES3
SubShader
{
Pass
{
ZWrite Off
Cull Off
GLSLPROGRAM
GLSLPROGRAM
#pragma only_renderers gles3

uniform mat4 _UnityDisplayTransform;
uniform mat4 _UnityDisplayTransform;
varying vec2 textureCoord;
varying vec2 textureCoord;
void main()
{
void main()
{
float flippedV = 1.0 - gl_MultiTexCoord0.y;
textureCoord.x = _UnityDisplayTransform[0].x * gl_MultiTexCoord0.x + _UnityDisplayTransform[1].x * flippedV + _UnityDisplayTransform[2].x;
textureCoord.y = _UnityDisplayTransform[0].y * gl_MultiTexCoord0.x + _UnityDisplayTransform[1].y * flippedV + _UnityDisplayTransform[2].y;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
float flippedV = 1.0 - gl_MultiTexCoord0.y;
textureCoord.x = _UnityDisplayTransform[0].x * gl_MultiTexCoord0.x + _UnityDisplayTransform[1].x * flippedV + _UnityDisplayTransform[2].x;
textureCoord.y = _UnityDisplayTransform[0].y * gl_MultiTexCoord0.x + _UnityDisplayTransform[1].y * flippedV + _UnityDisplayTransform[2].y;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
}
varying vec2 textureCoord;
uniform samplerExternalOES _MainTex;
varying vec2 textureCoord;
uniform samplerExternalOES _MainTex;
void main()
{
void main()
{
gl_FragColor = texture(_MainTex, textureCoord);
gl_FragColor = texture(_MainTex, textureCoord);
}
}
ENDGLSL
}
}
ENDGLSL
}
}
FallBack Off
FallBack Off
}

12
Assets/LWRPSupport/ARKitLWRPShader.shader


Shader "Unlit/ARKitLWRP"
{
Properties
{
_textureY ("TextureY", 2D) = "white" {}
Properties
{
_textureY ("TextureY", 2D) = "white" {}
}
SubShader
}
SubShader
{
Tags { "RenderType" = "Opaque" "RenderPipeline" = "LightweightPipeline"}
LOD 100

4
Assets/LWRPSupport/LWRPBackgroundRenderer.cs


m_LWRPBeforeCameraRender = camera.gameObject.GetComponent<LWRPBeforeCameraRender>();
}
m_LWRPBeforeCameraRender.SetupBlitMaterial(m_BackgroundMaterial);
m_LWRPBeforeCameraRender.blitMaterial = m_BackgroundMaterial;
return true;

if (m_LWRPBeforeCameraRender != null)
{
m_LWRPBeforeCameraRender.SetupBlitMaterial(null);
m_LWRPBeforeCameraRender.blitMaterial = null;
m_LWRPBeforeCameraRender = null;
}

5
Assets/LWRPSupport/LWRPBackroundRendererAsset.cs


/// </summary>
[SerializeField]
Material[] m_MaterialsUsed;
static bool useRenderPipeline { get { return GraphicsSettings.renderPipelineAsset != null; } }
var useRenderPipeline = GraphicsSettings.renderPipelineAsset != null;
var useRenderPipeline = GraphicsSettings.renderPipelineAsset != null;
if (useRenderPipeline)
{
var lwrpBeforeCameraRender = cameraGameObject.GetComponent<LWRPBeforeCameraRender>();

10
Assets/LWRPSupport/LWRPBeforeCameraRender.cs


{
const string k_ARBlitTag = "ARBackground Blit Pass";
Material blitMaterial { get; set; }
public void SetupBlitMaterial(Material material)
{
this.blitMaterial = material;
}
public Material blitMaterial { get; set; }
if (blitMaterial == null) return;
if (blitMaterial == null)
return;
var cmd = CommandBufferPool.Get(k_ARBlitTag);

9
Packages/manifest.json


{
"dependencies": {
"com.unity.collab-proxy": "1.2.9",
"com.unity.package-manager-ui": "2.0.0-preview.7",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}
正在加载...
取消
保存