浏览代码

Shader updates to support VR in BasicRenderPipelineShader.shader

The important changes here are actually to support stereo instancing and multiview.
I'm not sure if I need the multi_compile bit, but it's nice as an example.
/RenderPassXR_Sandbox
robbiesri 8 年前
当前提交
d46b51d7
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
      Assets/ScriptableRenderPipeline/BasicRenderPipeline/BasicRenderPipelineShader.shader

4
Assets/ScriptableRenderPipeline/BasicRenderPipeline/BasicRenderPipelineShader.shader


#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
#pragma shader_feature _METALLICGLOSSMAP
#include "UnityCG.cginc"
#include "UnityStandardBRDF.cginc"

float3 positionWS : TEXCOORD1;
float3 normalWS : TEXCOORD2;
float4 hpos : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
float4 _MainTex_ST;

v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.uv = TRANSFORM_TEX(v.texcoord,_MainTex);
o.hpos = UnityObjectToClipPos(v.vertex);
o.positionWS = mul(unity_ObjectToWorld, v.vertex).xyz;

正在加载...
取消
保存