Unity creates a sphere the default is not to see the inside of the sphere, so you need to use cull Front to modify the direction of culling, which will bring a new problem, The video being played is flipped like a mirror, so change its UV coordinates so that it flips over to float u_x=1-i.uv.x; float u_y=i.uv.y; i.uv=float2(u_x,u_y);
1Shader"Unlit/unlitshader"2 {3 Properties4 {5_maintex ("Texture", 2D) =" White" {}6 }7 Subshader8 {9Tags {"Rendertype"="Opaque" }TenLod - OneCull Front//remove the front to see the inside of the sphere A - Pass - { the Cgprogram - #pragmaVertex vert - #pragmaFragment Frag - #pragmaMulti_compile_fog + -#include"Unitycg.cginc" + A structAppData at { - float4 vertex:position; - float2 uv:texcoord0; - }; - - structv2f in { - float2 uv:texcoord0; toUnity_fog_coords (1) + float4 vertex:sv_position; - }; the * sampler2d _maintex; $ float4 _maintex_st;Panax Notoginseng - v2f Vert (AppData v) the { + v2f o; AO.vertex =Unityobjecttoclippos (V.vertex); theO.UV =Transform_tex (V.UV, _maintex); + Unity_transfer_fog (O,o.vertex); - returno; $ } $ - fixed4 Frag (v2f i): Sv_target - { the - floatu_x=1-i.uv.x;//because the inside of the ball is like a mirror.Wuyi floatU_Y=I.UV.Y;//so to change its UV coordinates theI.UV=FLOAT2 (u_x,u_y);//just change x, that's it, okay? - Wu -Fixed4 col =tex2d (_maintex, I.UV); About Unity_apply_fog (I.fogcoord, col); $ returnCol; - } - ENDCG - } A } +}
Unity sees problems with sphere inside, through sphere playing panoramic video