Blending

Blending

  Blending is used to make transparent objects.

  

  When graphics are rendered, after all shaders have executed and all textures have been applied, the pixels are written to the screen. How they are combined with what is already there is controlled by the Blend command.

[Syntax]

  

[Blend Operations]

  

[Blend factors]

  

[常用混合类型]

  

[Examples]

1、Here is a small example shader that adds a texture to whatever is on the screen already:

Shader "Simple Additive" {
    Properties {
        _MainTex ("Texture to blend", 2D) = "black" {}
    }
    SubShader {
        Tags { "Queue" = "Transparent" }
        Pass {
            Blend One One
            SetTexture [_MainTex] { combine texture }
        }
    }
}

参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/SL-Blend.html

Blending

时间: 2024-08-10 00:06:02

Blending的相关文章

【Unity Shaders】Alpha Test和Alpha Blending

写在前面 关于alpha的问题一直是个比较容易摸不清头脑的事情,尤其是涉及到半透明问题的时候,总是不知道为什么A就遮挡了B,而B明明在A前面.这篇文章就总结一下我现在的认识~ Alpha Test和Alpha Blending是两种处理透明的方法. Alpha Test采用一种很霸道极端的机制,只要一个像素的alpha不满足条件,那么它就会被fragment shader舍弃,"我才不要你类!":否则,就会按正常方式写入到缓存中,并进行正常的深度检验等等,也就是说,Alpha Test

spine 2.1.27 Pro 叠加方式(Blending)

将spine更新到2.1.27 Pro,发现有更多的叠加方式可用了,如图: 以前则只有Normal和Additive可选. 更多的叠加方式对于用spine做特效动画还是比较有用的.不过我还没试这些叠加方式能否像photoshop中的叠加方式那样形成更丰富的组合. 不过今天把新版spine 2.1.27 Pro中制作的使用了Additive叠加方式的动画导到cocos2dx 3.3中播放,发现additive没生效. 通过对cocos2dx 3.3中集成的spineRunTime源代码进行调试,发

Problem with blending edges of connected shapes

提供展示代码: agg::rendering_buffer &rbuf = rbuf_window();      agg::pixfmt_bgr24 pixf(rbuf); typedef agg::renderer_base<agg::pixfmt_bgr24> renderer_base_type;      renderer_base_type renb(pixf); typedef agg::renderer_scanline_aa_solid<renderer_bas

YUY2(YUV) 与 RGB 格式图片的相互转换 以及 基于YUY2(YUV)的blending

这是一个项目里使用的,API里从pool里取出的格式都是YUY2,但是图像处理的API库中要求都是jepg格式. YUY2经常用于电视制式以及许多摄像头的输出格式.而我们在处理时经常需要将其转化为RGB进行处理,这里简单介绍下YUY2(YUV)与RGB之间相互转化的关系: http://msdn2.microsoft.com/en-us/library/ms893078.aspx YUY2(YUV) To RGB: C = Y - 16 D = U - 128 E = V - 128 R = c

【Unity Shader】---Alpha Blending的意义

Alpha Blending 即Alpha混合 Blending 就是处理透明度的,处理光栅化最后阶段,显示在屏幕上的颜色 1 Blend Off 关闭alpha混合 2 混合公式:Blend SrcFactor DstFactor SrcFactor 混合源系数 Shader当前计算点的颜色的混合系数 DstFactor 混合目标系数 当前点之前累积的颜色的混合系数 最终颜色 = (Shader计算出的点颜色值 * 源系数)+(点累积颜色 * 目标系数) 3 常用的混合系数 one 1(仅显示

Directx11学习笔记【十八】 Blending混合

本文由zhangbaochong原创,转载请注明出处http://www.cnblogs.com/zhangbaochong/p/5634580.html 在d3d11中是按frame来渲染物体的,在同一frame中又可能不止一种primitive,例如下图: gpu实际渲染时,会按帧渲染,像上图中的一帧中含有两个三角形 ,经过vs以后,PA(primitive assemble) block会进行体元装配,然后进行光栅化操作,光栅化操作时候,会比较depth buffer的值,红色三角形的z值

outdated: 32.Picking, Alpha Blending, Alpha Testing, Sorting

一个射击类的小demo.分为三个文件,Previous.h.Previous.cpp和Main.cpp. 在Previous.cpp的CreateWindowGL中新增了AdjustWindowRectEx()函数,可以根据客户端的期望大小计算窗口大小,矩形通过函数创建一个理想大小的窗口. ChoosePixelFormat()函数试图匹配一个最接近的像素格式通过上下文给的像素格式规格. 在Mian.cpp文件的Selection()函数中,glGetIntegerv()函数返回一个选定后的参数

(转)【Unity Shaders】Alpha Test和Alpha Blending

转自:http://blog.csdn.net/candycat1992/article/details/41599167 写在前面 关于alpha的问题一直是个比较容易摸不清头脑的事情,尤其是涉及到半透明问题的时候,总是不知道为什么A就遮挡了B,而B明明在A前面.这篇文章就总结一下我现在的认识~ Alpha Test和Alpha Blending是两种处理透明的方法. Alpha Test采用一种很霸道极端的机制,只要一个像素的alpha不满足条件,那么它就会被fragment shader舍

irectX 9.0c游戏开发手记之“龙书”第二版学习笔记之10: Chap12: Blending

这一章讲的是Blending,包括alpha 混合和alpha 测试两个方面.这一章的内容总体来说比较简单.然而,后面的习题却并不是很简单-- 下面是习题解答部分: 习题1部分: =============================================================================== 这道题让我们研究使用不同的blend factor和blendop所产生的效果.这个实现起来不难,我就不打算详细解释了,大家都能够看懂的.另外,为了简单,我就不

adjacent shapes抗锯齿情况下的alpha blending问题

问题描述: Unfortunately I stumbled across the issue with adjacent shapes. On a transparent background (in the plain color space) I draw mutiple  polygons, some are connected others are not and each polygon has a  different color. The polygons do never ov