나는 광구를 생성하고 구면 내에 등변이있는 쉐이더를 추가 한 다음 이미지를 추가했습니다.이 문제는 이미지에 점선이 어떻게 나타나는지 보여줍니다. ?) you can see the dotted lines점선은 광구의 이미지에서 나타나고 있습니다
there is distortion of the image
제가 사용 셰이더의 소스 코드는
Shader "Unlit/rect"{
Properties {
_MainTex (" Base (RGB)", 2D) = "gray" {}
}
SubShader{
Pass {
Tags {"RenderType"="Opaque" }
cull front
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma glsl
#pragma target 3.0
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f
{
float4 pos : SV_POSITION;
float3 normal : TEXCOORD0;
};
v2f vert (appdata v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.normal = v.normal;
return o;
}
sampler2D _MainTex;
#define PI 3.141592653589793
inline float2 RadialCoords(float3 a_coords)
{
float3 a_coords_n = normalize(a_coords);
float lon = atan2(a_coords_n.z, a_coords_n.x);
float lat = acos(a_coords_n.y);
float2 sphereCoords = float2(lon, lat) * (1.0/PI);
return float2(sphereCoords.x * 0.5 + 0.5, 1 - sphereCoords.y);
}
float4 frag(v2f IN) : COLOR
{
float2 equiUV = RadialCoords(IN.normal);
return tex2D(_MainTex, equiUV);
}
ENDCG
}
}
FallBack "VertexLit"
}
yea! 고맙습니다!! –