Still having some issues with Transparency

I have a chest that fades away when it has been looted. This works fine. However to get it to work I am using the “Transparent/Bumped Specular” shader which does not seem to allow me to turn OFF the transparency at all. So the model is “semi-transparent at all times”.

Is there a better way to handle this? To get it to fade I am adjusting the Color.a value on updates. Again it is fading perfectly.

Come on - I know one of you geniuses knows!!

Your post seems contradictory. You say “to get it to work” you use Transparent/Bumped Specular shader, which, you say, does not allow you to turn transparency off. Which means it doesn’t work.

Also at the end of the post you say, “Again it is fading perfectly.”

What are we supposed to make of this?

If you explain your problem a lot more clearly, I think you might get some answers.

Basically, what you need to do is switch shaders when it’s fully opaque again. In this case, probably to Diffuse Bumped.

Switch shaders.

Sorry if I was not clear, and you are right it is nor working as designed.

I have a chest which I want to fade when looted. From what I am hearing the best option is to set an opaque shader, then when the chest is empty, switch the shader for a transparent one and change the Color.a value on Update.

Now I have to figure out how to swap shaders =)

Swapping textures in a shader:

jumbotron_pic2.mainTexture =Texture3;

Swapping material:

var material_ana_white_home : Material;
OBJECT.renderer.material= material_ana_oriental_home;

Swapping materials[ ] in an array:

OBJECT.renderer.materials[1].mainTexture= Texture_ana_home_number;

Swapping a texture withing a materials array:
EricsPelvis.renderer.materials[1].SetTexture("_LightMap", Texture_eric_home_number);

OBJECT.GetComponent(SkinnedMeshRenderer).materials[2].mainTexture= Texture_eric_home_sleeves;
Finally here is an example from MBO Baseball (we normally have our FIND routines in the start function for performance).
GameObject.Find("Ana-RB-Geometry").GetComponent(SkinnedMeshRenderer).materials[2].mainTexture= Texture_ana_home_name;

Actually isn’t swapping a shader done this way?:

done in loop:

Shader shaderT = Shader.Find("Transparent/Bumped Specular");
((MeshRenderer)meshes[i]).material.shader = shaderT;

though I tried it and it doesn’t swap…

This sounds like your texture contains an alpha channel that is not set to completely opaque. Transparent shaders not only allow you to influence transparency through the texture’s main color but also take texture transparency into account. So if you use a half transparent texture you are never able to make the object completely opaque.

That could be it.

However I have the shader swapping working. So now everything works as planned.

Thanks everyone for the input.

You’re welcome! May the random spambot that arrived be banned for all eternity.