游戏开发论坛

 找回密码
 立即注册
搜索
12
返回列表 发新帖
楼主: vigour_lu

粒子系统的纹理混合问题(纹理见附件)

[复制链接]

36

主题

107

帖子

107

积分

注册会员

Rank: 2

积分
107
 楼主| 发表于 2007-11-27 08:26:00 | 显示全部楼层

Re:粒子系统的纹理混合问题(纹理见附件)

Many texture formats include an alpha channel, which provides opacity information at each pixel. DXTex fully supports alpha in textures. When you import a BMP file, if there is a file of the same size with a name that ends in "_a"—for example, Sample.bmp and Sample_a.bmp—the second file is loaded as an alpha channel. The blue channel of the second BMP is stored in the alpha channel. When a document is open, you can explicitly load a BMP file as the alpha channel by clicking Open As Alpha Channel on the File menu.

To view the alpha channel directly, without the RGB channels, on the View menu, click Alpha Channel Only. The alpha channel appears as a grayscale image. If no alpha channel has been loaded, every pixel has a full alpha channel and the image appears solid white when viewing "Alpha Channel Only." To turn off alpha channel viewing, click the Alpha Channel Only command a second time.

In the usual view, the effect of the alpha channel is visible because the window has a solid background color that shows through the texture where the alpha channel is less than 100 percent. You can change this background color by clicking Change Background Color on the View menu. This choice does not affect the texture itself or the data that is written when the file is saved.

The DXT2 and DXT4 formats use premultiplied alpha. This means that the red, green, and blue values stored in the surface are already multiplied by the corresponding alpha value. Direct3D cannot copy from a surface that contains premultiplied alpha to one that contains non-premultiplied alpha, so some DXTex operations (Open as Alpha Channel, conversion to DXT3, and conversion to DXT5) are not possible on DXT2 and DXT4 formats. Supporting textures using these formats is difficult on Direct3D devices that do not support DXTn textures. This is because Direct3D cannot copy them to a traditional ARGB surface either, unless that ARGB surface uses premultiplied alpha as well, which is rare. For this reason, you might find it easier to use DXT3 rather than DXT2, and DXT5 rather than DXT4 when possible.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-17 18:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表