I'm trying to add a Self-Illumination map to a material already using a Transparency map...
I am an extremely new Unity user, and have no scripting experience whatsoever. I'm very used to setting up materials like this in Max by simply having a 32-bit Targa with an alpha channel for the transparency in the Diffuse slot, and adding a simple black targa with painted glowy bits in the slot for Self-Illumination... In past game engines I've worked with, importing this object with such a material simply works...
I am now trying to replicate this simple effect in Unity, but am having no luck...
I have a window object I am using that's nothing but a square poly, with a texture on it that looks like a round window that is primarily totally opaque (for the window-panes and frame), but is surrounded by a degree of transparency that makes it seem like it's casting a shadow on whatever wall it's placed against... I want the window to look like there is glowing light coming from within, so I'd like to also add a map to the material to make it self-illuminating so that the material uses both the alpha layer transparency of the 32-bit targa used for its diffuse map, as well as the secondary self-illumination map...
Likewise, I'm also wanting to make plants using a transparent texture for the leaves, and a second self-illumination texture for glowing patterns on the leaves...
Unfortunately, there seems to be no base Unity material that allows this functionality, and when I go into part of the material's interface that has the phrase "Edit Shader" (where I was assuming I could add the Self-Illumination element to it), the words "Edit Shader" are grayed out... I at first assumed I could start with a Self-Illumination material in Unity, and then choose a 32-bit Targa with alpha for the Base, but Unity seems to ignore the alpha-layer data in the Base texture under this circumstance...
Am I doing something wrong or missing something? Is there a way to achieve this without writing a special script?
I'd really appreciate some help on this...
Answer by Bluestrike
May 11, 2012 at 12:24 PM
You should go to the material in unity and select a transparent or self ilum shader.
Unity uses the aplha on the difuse texture for translucency.
before Unity 3.0 it also used the alpha for self ilumination (when you selected a self ilum shader for the material.)
Since 3.0 we can add an extra material whats alpha is used for self ilumination.
If you want both at the same time, there is no proper shader for that.
Found this on the forums:
This probably is not the awnser you are looking for ;)
I too would like a shader where the diffuse alpha is used for translucency and another texture its alpha for self ilumination.
If you know something about writing shaders,
the default unity shaders can not be edited but they can be downloaded from the resources page on the website.
Thanks,...I appreciate the info... Yeah,...it looks like I'm simply going to have to wait for our programmers to write a special shader for our needs.... Bummer...
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
How can I add alpha-channel to this shader?
Shader to partially ignore lighting (Specific colors)
Semitransparent shader not visible in front of objects
How to apply different textures to one model?