|

楼主 |
发表于 2019-5-10 21:51:46
|
显示全部楼层
这个魔方帖图用的cubemap- Shader "Debug/cube"
- {
- Properties
- {
- _CubeMap("CubeMap", CUBE) = ""{}
- }
- SubShader
- {
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- struct appdata
- {
- float4 vertex : POSITION;
- float4 normal : NORMAL;
- };
- struct v2f
- {
- float4 vertex : SV_POSITION;
- float4 texCoords : TEXCOORD1;
- };
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.texCoords = v.vertex;
- return o;
- }
- samplerCUBE _CubeMap;
- fixed4 frag (v2f i) : COLOR0
- {
- fixed4 col = texCUBE(_CubeMap, i.texCoords.xyz);
- return col;
- }
- ENDCG
- }
- }
- }
复制代码
|
|