About Store Forum Documentation Contact



Post Reply 
how to set material transparency?[SOLVED]
Author Message
Antony Offline
Member

Post: #1
how to set material transparency?[SOLVED]
Hi,

In materials.cpp tutorial, how to change the object's transparency? I assume by changing the material's transparency as shapes are transparent without material.

So I thought the 4th parameter in <some_material>.color.set(r,g,b,a) would affect alpha, but it doesn't appear to, as whether it's set to 0 (default for materials.cpp) or 1 (default in material.h), all objects remain opaque.

In the tutorial's update() function, I also tried changing the alpha like so:
material_rfl .color.w=0.5f;
material_fur .color.w=0.5f;

...but this also did nothing.
(This post was last modified: 03-10-2011 04:57 PM by Antony.)
03-08-2011 10:29 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: how to set material transparency?
Change Tech from Default to Blend or Blend Light.
03-09-2011 03:37 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: how to set material transparency?
If you want full Alpha you can use either Alpha Test or Blend.. the only difference is that the Blend is also effected by light sources. If u want just a part transparent you can make either the texture itself transparent. And export it as e.g .png to save also the alpha channel or you can make a alpha map - single channel "Channel red is preferred".

You can read about it more here: http://www.esenthel.com/wiki/index.php?title=Material

There is always evil somewhere, you just have to look for it properly.
03-09-2011 08:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Antony Offline
Member

Post: #4
RE: how to set material transparency?
Thanks for helping, Driklyn and Dynad.
03-10-2011 04:56 PM
Find all posts by this user Quote this message in a reply
Post Reply