IBM TJ Watson Research

IBMPixelTextureGrayAlpha

IBMPixelTextureGrayAlpha.mp4

Description

A PixelTexture with two components as follows:
image 2 3 2 0x0080 0x00ff
0x8080 0x80ff
0xff80 0xffff

This gray scale texture is used as an intensity map and modulates the emissiveColor of the Material2D; the alpha value of the texture overrides the alpha (i.e. 1.0 - transparency) of the Material2D. The left hand pixels of the texture are all set to an alpha of 0x80 and the right hand to an alpha of 0xff. Note that the pixels are coded from bottom left to top right.

In this example there are eight rectangles onto which the PixelTexture is mapped. The four rectangles on the top row have their transparency set to 0.0 and those on the bottom row to 0.5. The four rectangles on the left have the same emissiveColor of red but the value of red in the left pair is 1.0 and in the right pair is 0.5. On the right the emissive colors are green and blue on top and yellow and cyan below.

Note: the image alpha overrides the transparency in the Material2D and this can easily be seen in the red rectangles on the left in that the upper and lower versions look identical.

Screenshot

Snapshot of rendered output.



Snapshot of rendered output if pixels are replicated instead of being interpolated.



Back to main index