Jump to content

Transparency, alpha and opacity


AggrorJorn
 Share

Recommended Posts

I am updating the user guide with several material file examples. When it comes to transparency, alpha and opacity there are several question that I don't know the answer to myself.

For instance:

  • What is the proper way for using alpha blending? (texture has black areas that need to be removed.)
  • What is the proper way for using transparency blending? (texture has transparent areas.)
  • When do you make use of the alpha_blend or alphatest shaders?
  • And what is the difference between them?

 

I have the following material file:

texture0="abstract::alphatest.dds"
blend=alpha
zsort=1

post-45-091852800 1281964532_thumb.jpg

 

As you can see this has several issues:

  • The door doesn't have a shadow.
  • The oildrum doesn't have a shadow when looking through the door.
  • The color of the sky is different.

 

Could someone shed some light on this topic? I would be a great addition for the user guide.

Link to comment
Share on other sites

The alphatest and alphablend shaders from my understanding are used as follows:

 

alphatest: To provide simple transparency where the texture is concidered to consist of opaque and transparent areas but the transparent area is concidered to be fully transparent. The shader will treat any Alpha values above a certain threshold value to be full on transparent and this is generally faster. This appears to work in the foreground world without problems. A typical example would be a leaf texture for a tree where the leaves are opaque and the surrounding texture fully transparent so it is not visible when rendered.

 

alphablend: To provide full graduated transparency in textures where the full 8 bit alpha channel is converted into differing degrees of transparency dependent on the alpha value. This requires rendering in the transparent world to be rendered correctly. An example might be a block of ice with differing transparency dependant on the thickness or impurity distribution.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...