一些有关Shader的记录

#pragma fragmentoption ARB_precision_hint_fastest    "+ Precision Hints (ARB_precision_hint_fastest, ARB_precision_hint_nicest)

Fragment program computations are carried out at an implementation-
dependent precision. However, some implementations may be able to perform
fragment program computations at more than one precision, and may be able
to trade off computation precision for performance.

If a fragment program specifies the "ARB_precision_hint_fastest" program
option, implementations should select precision to minimize program
execution time, with possibly reduced precision. If a fragment program
specifies the "ARB_precision_hint_nicest" program option, implementations
should maximize the precision, with possibly increased execution time.

Only one precision control option may be specified by any given fragment
program. A fragment program that specifies both the
"ARB_precision_hint_fastest" and "ARB_precision_hint_nicest" program
options will fail to load."

GLSL中纹理坐标Y方向的原点在顶部,而HLSL中纹理坐标Y方向的原点在底部,所以你需要使用这个公式uv.y = 1 – uv.y 对每个点重新定义纹理坐标。uv中的每一项和vertices中的每一项都是一一对应的​

在unity中,UV坐标划分,分下面两大步骤
1.  参考的标准是,unity刚导入时的那张图​,即原图
2.  原图的左下角uv坐标定为(0,0),原图的右上角的uv坐标定位(1,1)​,原图的其它任何一个位置按照比例都会有一个uv坐标,比如原图的左上角的uv坐标定位(0,1),原图的右下角的UV坐标定位(1,0),原图的中心(对角线的交点)位置为(0.5,0.5),等等​

发布了16 篇原创文章 · 获赞 44 · 访问量 38万+

猜你喜欢

转载自blog.csdn.net/Game_jqd/article/details/101109229
今日推荐