代码中看到后收集的一些shader学习笔记

本文介绍了Unity Shader中的ARB_precision_hint_nicest和ARB_precision_hint_fastest精度提示,探讨了它们对性能的影响,并提及了不同精度数据类型如fixed、half和float的适用场景。还讨论了Unity中特定平台的差异,如UV坐标和抗锯齿处理,以及SV_POSITION和SV_Target的作用。最后提到了_Shader编译目标#pragma target 3.0的相关信息。
摘要由CSDN通过智能技术生成


ARB_precision_hint_nicest 的意义,作用:

首先,这2命令最权威解释的地方,肯定就是openGl官网了,以下是链接:
https://www.opengl.org/registry/specs/NV/fragment_program4.txt

这里有这么一段:

+ Precision Hints(ARB_precision_hint_fastest, ARB_precision_hint_nicest)

Fragment program computations are carriedout at an implementation- dependent precision. However, some implementationsmay be able to perform fragment program computations at more than oneprecision, 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 programexecution time, with possibly reduced precision. If a fragment programspecifies the "ARB_precision_hint_nicest" program option,implementations should maximize the precision, with possibly increasedexecution time. Only one precision control option may be specified by any givenfragment program. A fragment program that specifies both the"ARB_precision_hint_fastest" and "ARB_precision_hint_nicest"program options will fail to load.

看标题也知道了,也就是精度提示。

ARB_precision_hint_fastest最快的,意思就是会用低精度(一般是指fp16),以提升片段着色器的运行速度,减少时间。

ARB_precision_hint_nicest最佳的,意思就是会用高精度(一般是指fp32),可能会降低运行速度,增加时间。

注意:这

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值