SPR_14_MultipleCameras


  • 相机叠加时,第一个主相机混合模式应该是 One Zero,其他的应该是 One OneMinusSrcAlpha
  • 渲染时,会先渲染有 TargetTexture 的相机,在渲染其他相机
  • 如果有 TargetTexture 相机默认输出就会到这个张RT上,不会显示到屏幕上。

image-20221222182548948

image-20221222182614427

在C#中默认情况下,int 转换成 float 位的结构会发生变化,在按位操作中(比如RenderLayerMask)就无法进行。不改变位的转换方式如下。按照这种方式就可以安全的将int位操作传输到GPU端的shader 中

image-20221222182652752

在Shader 中进行位操作使用 uint数据类型。安全的将float转换成 uint 类型,且不进行位结构破坏的方法是用 asuint 方法

image-20221222182731522

Shader 中的按位操作在 OpenGL ES 2.0 版本以上才可以使用

image-20221222182757541

  • Unity 自定义 Attribute 及其 GUI 绘制

    • Step1: 继承 UnityEngine 的 PropertyAttribute

      ![image-20221222183011682](https://raw.githubusercontent.com/klj35/BloodSoulBlockImage/main/img/image-20221222183011682.png) 
      
    • Step2:创建一个绘制类,继承 PropertyDrawer,并使用CustomPropertyDrawer指定我们的Attribute类,并重写 OnGUI 方法

      ![image-20221222183125593](https://raw.githubusercontent.com/klj35/BloodSoulBlockImage/main/img/image-20221222183125593.png)
      
      • Step3:使用这个属性

        image-20221222183156684

        image-20221222183203996


文章作者: 血魂S
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 血魂S !
  目录