Search Unity

Combine Sphere Map and Texture

Discussion in 'Shaders' started by noradninja, Apr 11, 2009.

  1. noradninja

    noradninja

    Joined:
    Nov 12, 2007
    Posts:
    420
    Hi, I am trying to create a texture for the iPhone that blends a sphere map and a base texture (to get textured toon effects)...I am sure I am doing something wrong, but have no idea where to look:


    Code (csharp):
    1. Shader "Textured Toon" {
    2. Properties {
    3.    _MainTex ("Base (RGB)", 2D) = "white" {}
    4.    _EnvMap ("EnvMap", 2D) = "black" { TexGen SphereMap }
    5. }
    6. SubShader {
    7.    Pass {
    8.          Name "ENVMAP"
    9.          BindChannels {
    10.             Bind "Vertex", vertex
    11.             Bind "normal", normal
    12.          }
    13.       SetTexture[_EnvMap] {
    14.          combine texture
    15.       }
    16.       SetTexture[_MainTex] {
    17.          combine texture * previous
    18.       }
    19.    }
    20. }
    21. }