Hi,
I’m a absolute newbie here. I’m trying to use Material.SetFloat to create a blinking texture. The game viewer doesn’t show blinking, but the shader preview in the inspector does show the shader blinking. How do I get the blinking to show up in the game viewer?
This is what I am using:
function Start () {
// Use the Glossy shader on the material
renderer.material.shader = Shader.Find(" Glossy");
}
function Update () {
// Animate the Shininess value
var shininess : float = Mathf.PingPong (Time.time, 1.0);
renderer.material.SetFloat( “_Shininess”, shininess );
}
I don’t know what incandescent is. I mean, I know what the word means, but not what you’re referring to in the context of Unity. If you look at the shader in Unity, you can see what parameters exist for that shader.
To be clear - shininess isn’t how bright something is, it’s how reflective the specular component is - the shiny white reflective dot when you shine a light on it. For a self-illuminating shader, the brightness is in the alpha channel of a separate texture (the “Illumination” section of the material). You’d probably want to use that if it has to actually show up in a dark environment, or if it’s not that dark, you could just use a regular diffuse texture and switch between dark red and bright red as the color, for example.
I’m also a complete noob to pretty much everything in Unity. I’m currently taking a break from a major error I have in my game and am doing a bit of art… only to get stuck on the art as well
Basically I want to get a crawling effect occurring with a bump mat texture (to get the object in question to appear to have weird critters crawling under it’s skin). I can get this effect easily enough in 3ds Max simply by using a noise texture in the bump map slot of a material, then using Autokey and phasing a fractal noise type. Sadly I can’t figure out how to import animated textures so I had a search around and found your post.
I’m now using the “Mathf.PingPong” method with “renderer.material.SetTextureOffset (”_BumpMap", Vector2(offset1,offset2));"
But this still isn’t as random as I would like. Is there any way to animate noise within Unity? Or, failing that, some math function involving a fractal pattern that could be inserted somewhere into a script?
I really am just going by trial and error at the moment as I’m still new to unity, so any suggestions would be appreciated.
You could try playing with this turbulence package. Otherwise there are a lot of noise functions that people have scripted. Do a google search for ‘Unity Perlin’ for example.
Edit: Also you should try to start new threads whenever possible as this particular post is not on topic of the OP and likely will not get read by people who could help you.
Thanks for the quick response and your suggestions I will look into them when I’m back on the project next week. If I’m still stuck after, I’ll make sure to start a new thread