Transparency

Introduction

TransparencyIn the last tutorial, we spoke about how to work with color blending.

We found out that this can be extremely useful for transparency. This tutorial will show you how to create a transparent 3D object.

The tutorial is modified from tutorial 17.

Contents of main.cpp :


Our first step is to enable blending in our init function.

	glEnable(GL_BLEND);

The blending function we are using is the (GL_SRC_ALPHAGL_ONE) function.

	glBlendFunc(GL_SRC_ALPHA, GL_ONE);

We want all polygons to be drawn and so we therefore disable depth testing. Having depth testing enabled will cause the polygons at the back to not display.

	glDisable(GL_DEPTH_TEST);

Our menu function is modified to process a Toggle Blending menu option. Notice that we also enable and disabledepth testing appropriately. This ensures that all sides are rendered.

	case 3 :
		if (glIsEnabled(GL_BLEND))
		{
			glDisable(GL_BLEND);
			glEnable(GL_DEPTH_TEST);
		}
		else
		{
			glEnable(GL_BLEND);
			glDisable(GL_DEPTH_TEST);
		}
		break;

This can create some good effects. I have left the code to enable and disable lighting as was done in tutorial 17. The difference when lighting is disabled is shown below. Here the colors are multiplied by the texture map.

Lighting EnabledLighting Disabled
Lighting EnabledLighting Disabled

Please let me know of any comments you may have : Contact Me

GLUT|ES Source Files :Embedded Visual C++ 4.0 
UG Source Files :Embedded Visual C++ 4.0 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Google行为透明度是指Google公司在其服务和运营过程中公开透明其行为和决策的程度。作为全球最大的搜索引擎和互联网技术公司之一,Google的行为透明度具有重要意义。 首先,Google积极向用户展示了广告的来源和针对性。它通过显示广告的前几个字母,让用户了解广告的来源,以便用户可以对广告的可信度进行判断。同时,Google还提供用户偏好设置,让用户决定他们是否愿意接收针对性广告。 其次,Google会定期公布透明度报告,详细列出政府和其他机构要求查询用户数据的全球数据。这些报告揭示了Google政府数据请求的数量和类型,以确保用户知道他们的隐私权。 此外,Google还通过透明度中心向用户提供关于其产品和服务的信息。用户可以了解到Google的数据收集方式和使用目的,以及Google如何保护用户的隐私和安全。 最后,Google积极回应用户的隐私和安全问题。如果用户对广告或搜索结果的相关性有疑问,Google提供了举报机制,允许用户向其报告问题。Google会对收到的投诉进行调查,并采取必要的措施来解决问题。 总的来说,Google在行为透明度方面取得了一定的成绩。通过向用户展示广告来源和提供透明度报告,用户可以更好地了解Google在数据收集和使用方面的做法。然而,Google仍然需要不断努力,进一步提高其行为透明度,以满足用户对隐私和安全的不断增长的担忧。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值