0

I'm developing a WebGL program with Unity 5.3.1

    WWW www = new WWW(System.Uri.EscapeUriString(nrmUrl));
    while (!www.isDone)
    {
        yield return null;
    }
    materailBall.GetComponent<Renderer>().material.SetTexture("_BumpMap", www.texture);

And the result is

enter image description here

It seems that the property texture type is Texture

Please help me to change texture type of this nrm image to Normal map

Is there some good ideal to download normal map texture?

Or someone can tell me how to use TextureImporter with www?

Thanks!!

Supplement:

If I create material with local file, here is the different

Texture type : Texture

enter image description here

Texture type : Normal map

enter image description here

gman
  • 100,619
  • 31
  • 269
  • 393
siusiulala
  • 1,040
  • 1
  • 12
  • 24
  • Few questions or you. What problems are you having now? It looks like you are using customized shader...Why can't you use standard shader? – Programmer Sep 06 '16 at 08:40
  • Same problem with standard shader. I want to download a image and set it as bump map. But the texture type I down is default texture. – siusiulala Sep 06 '16 at 08:48
  • 1
    @siusiulala can you check this answer: http://answers.unity3d.com/questions/47121/runtime-normal-map-import.html ? – Jerry Switalski Sep 06 '16 at 09:23
  • @JerrySwitalski That's what i need. It solves my problem. Thanks a lot !!! – siusiulala Sep 06 '16 at 09:32

1 Answers1

0

To use named shaders variants how "_BumpMap" you need this material must be in used in the scene or in the Resource Folder.

joreldraw
  • 1,736
  • 1
  • 14
  • 28