RenderSetup

cull

back/front/off


zwrite

on/off


ztest

less/greater/equal/gequal/notequal/always


blend

blendop    混合方式    可选参数:

add(默认混合操作)/sub/resub/min/max

(min/max的混合因子只会是one,也就是说,无论blend后面写的是因子是什么,都是以one来计算)

blend    混合因子    可选参数:

one/zero/srcColor/srcAlpha/oneMinusSrcColor/oneMinusdstAlpha...


blendop为add/sub/revsub时,混合方式为:

O = SrcFactor * S + DstFactor * D,中间的加号根据blendop的不同而不同

blendop为min/max时,混合方式为:

O = min或max(S,D),也就是说这里的混合方式并没有用到混合因子,但是blend依旧需要写

因为 blend srcFacotr dstFactor这一句,不仅给出了混合因子,也意味着开启了混合


blendop和blend都可以写:

blend xxx xxx,xxx xxx,这样的写法是针对rgb和alpha运用不同的混合方式或者混合因子,不像如此写的话,rgb和alpha的所使用的混合方式和混合因子即为同一个。

 

在不开启blend的时候,RGB Alpha是直接覆盖buffer的

buffer中的alpha与rgb的计算过程一样,不用觉得alpha特别


Offset

推测这个offset的偏移值是针对zTest阶段,在进行深度测试的时候,将当前pass的深度用offset进行调整再与深度缓冲区中的值进行比对。

offset是结局stiching和z-fighting的最佳途径之一。

offset语法: offset factor,units

factor和units都是用来影响z-test的参数,影响方式为:

offset = (m * factor) + (r * units)

m为三角面的斜率,即三角面片与近剪裁面越接近平行,则m值越接近于0。

r是能产生在窗口坐标系的深度值中可分辨的差异的最小值,r是由具体实现OpenGL的平台指定的一个常量。

offset为正的时候物体更远离摄像机,为负的时候物体跟接近摄像机。


PassName

语法 Name "MYPASSNAME"

这用于其他shader可以直接使用该pass,名字必须使用大写

UsePass "myshader/MYPASSNAME"   


LOD(Subshader RenderSetup)

相关的c# Shader属性:

material.shader.maximumLOD实例属性,针对个体。material修改会使得其实例化。sharedMaterial修改才是修改的项目资源。
Shader.globalMaximumLOD静态属性,针对全局
  • 实例的LOD默认数值为-1,即表示实例没有生效LOD

  • 实例的LOD优先级高于全局的LOD(在都设置了的情况下)

  • 全局的LOD默认数值为2147483647(2^31 - 1也就是int.MaxValue,有符号整型数能表示的最大值),即表示任何数量的LOD都可以渲染

  • 要使得LOD不生效,就把实例/全局LOD设置回他们的默认值

  • 所设置的LOD大于等于SubShader中的LOD值,则视为此SubShader通过,否则查找下一个SubShader是否通过



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Error: line 1: RuntimeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\sceneObservable.py line 365: (kInvalidParameter): Argument is a NULL pointer 2023-07-23 19:44:36: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:36: 0: STDOUT: Warning: line 1: Python callback failed 2023-07-23 19:44:48: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:48: 0: STDOUT: Error: line 17: Division by zero. 2023-07-23 19:44:48: 0: WARNING: Strict error checking on, ignoring the following unrecognized error or warning. If it is fatal, please email [email protected] with the error message. 2023-07-23 19:44:48: 0: STDOUT: Error: line 17: Division by zero.
07-24

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值