RenderTexture坐标之UNITY_UV_STARTS_AT_TOP内置变量
来源:互联网 发布:淘宝货到付款不付款 编辑:程序博客网 时间:2024/05/16 04:30
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;#if UNITY_UV_STARTS_AT_TOP if(_MainTex.y < 0.0) o.screenPos.y *= -1;#endifreturn 0;
参考:
https://docs.unity3d.com/Manual/SL-PlatformDifferences.html
https://docs.unity3d.com/Manual/SL-BuiltinMacros.html
阅读全文
0 0
- RenderTexture坐标之UNITY_UV_STARTS_AT_TOP内置变量
- awk内置变量之SUBSEP
- RenderTexture
- RenderTexture
- Nginx系列之常用内置变量
- JMeter之BeanShell常用内置变量
- Python零基础入门之七变量与内置函数
- OSG与GLSL结合之默认内置变量
- awk内置变量之FILENAME、ARGC、ARGV、ENVIRON
- awk内置变量之OFMT、CONVFMT、RLENGTH、RSTART
- Unity教程之-RenderTexture实现实时阴影绘制
- Unity3D研究院之使用RenderTexture制作动态阴影(四十八)
- Unity教程之-RenderTexture实现实时阴影绘制
- Unity3D研究院之使用RenderTexture制作动态阴影(四十八)
- unity开发之四:摄像机渲染纹理RenderTexture的使用
- 用户自定义变量 内置变量
- ahk变量与内置变量
- perl内置变量
- linux批量修改文件时间
- c++ class类总结
- python加载properties配置文件
- EEE802.11协议基础知识
- 自定义ListView实现下拉刷新上拉加载功能
- RenderTexture坐标之UNITY_UV_STARTS_AT_TOP内置变量
- Java 8 Collectors 例子
- Source Insight 回复默认设置以及修改代码和注释字体
- keil环境下stm32 对printf映射
- 重构qDebug()<<,使log输出到文件
- C++实验5-项目1
- Android蓝牙扫描
- SimpleJSON在unity端序列化和反序列化
- oracle时间函数(三)last_day(),add_months(),month between()