- Home /
Why are the scrolling textures on a linrenderer bright green?
Updated and bounty added. See recent comments and updated answer below.
I am using a line renderer with a transparent texture on it. The texture has a uv scroll to move it constantly left to right thustly:
var offset = Time.time * scrollSpeed;
renderer.material.mainTextureOffset = Vector2 (-offset%1,1);
I'm using the iphone/transparent/vertex color shader which works fine on everything else but on this sucker.
The textures are psd's, created over a transparent background in pshop.
Please help, this is driving me knuts!
I've not used iPhone before, but I think this needs more information anyhow. What is the tint color of the material used, what is your scene lighting color, perhaps some screenshots of your setup.
There is no lighting in the scene. Am now using unity3 iPhone basic. Am using set color through script. Have tried with all shaders I can find and the only ones that work are ones that take light. Have submitted a bug but don't expect much from unity as they haven't ever responded. I don't want to add lights to save the overhead cost. The texture is gray with transparency. Have tried with other textures as well but get same result. In inspector view the icon showing what it should look like is correct.
How are you setting the color in your script? Also, screenshots would help.
Answer by Goody! · Jul 08, 2010 at 09:22 PM
Turns out that switching the shader used from: iphone/transparen/vertex color, to: transparent/vertex lit took care of it. Don't know why though.
*Opened the question back up. If I use a shader that doesn't need lights the texture will always be yellow or green. I don't want to incur the cost of unneeded lights. Anyone got an answer for this long overdue question?
Whoever downvoted me without providing an explanation eats boogers.
If you use the "Emissive Color" ins$$anonymous$$d of the Diffuse and Specular Colors in any of the Vertex Lit shaders, you essentially have a material that does not need a light source and will be uniformly "lit" from all sides. (Note, 128/128/128 is white, so divide your color values by two. Also, the transparency is still set via the Diffuse Color, but set the RGB values of that color to black.
Yeah, that works as a workaround. Thanks! A simple thing I didn't think of. :)
Can you post your comment as an answer so I can award you the bounty please.