RenderTexture坐标之UNITY_UV_STARTS_AT_TOP内置变量

UNITY_UV_STARTS_AT_TOP 是一个内置变量,其值为 1 或 0,表示纹理V坐标在顶部是否为0。Direct3D平台使用1,OpenGL平台使用0。Render Texture坐标在Direct3D中从顶部开始为0,向下增加;在OpenGL中从底部开始为0,向上增加。Shader中处理Image效果和UV绘制时需注意这些坐标差异。
摘要由CSDN通过智能技术生成

UNITY_UV_STARTS_AT_TOP

Always defined with value of 1 or 0. A value of 1 is on platforms where Texture V coordinate is 0 at the “top” of the Texture. Direct3D-like platforms use value of 1; OpenGL-like platforms use value of 0.

Render Texture coordinates

Vertical Texture coordinate conventions differ between two types of platforms: Direct3D-like and OpenGL-like.

1. Direct3D-like: The coordinate is 0 at the top and increases
downward. This applies to Direct3D, Metal and consoles.
2. OpenGL-like:
The coordinate is 0 at the bottom and increases upward. This applies
to OpenGL and OpenGL ES.

Image效果和在uv中绘制是shader中需要注意坐标问题的两个地方。

o.screenPos = o.pos;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值