x


TexGen SphereMap appears to be causing issues

I am using Unity on Wii and having an issue; I am unsure if this is Wii specific, and I know that there probably aren't many people using Unity on Wii.

I'm having problems with the "SphereMap" texgenmode in ShaderLab. It works as expected in the editor (with "Wii Graphics Emulation" enabled); however, on hardware the object displays as solid magenta, and thereafter almost everything else displays with corrupt texture coordinates. Some other 'texgenmodes' also cause this issue. Removing the "TexGen SphereMap" or disabling the pass that uses that texture makes the issue go away. I have attached the shader file. Any assistance would be appreciated. Thank you.

Shader "1P Wii Shader" {
Properties {
    _Color ("Main Color", Color) = (1,1,1,0)
    _SpecColor ("Spec Color", Color) = (1,1,1,1)
    _Emission ("Emmisive Color", Color) = (0,0,0,0)
    _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    _MainTex ("Base (RGB)", 2D) = "white" {}
    _SphereMapTex ("Spheremap (RGB)", 2D) = "black" {TexGen SphereMap} //appears to be causing problems
    _SphereMapColor ("Spheremap Color (RGB)", Color) = (1,1,1,1)
}

SubShader {
    Pass {
        Material {
            Diffuse [_Color]
            Ambient [_Color]
            Shininess [_Shininess]
            Specular [_SpecColor]
            Emission [_Emission]
        }
        Lighting On
        SeparateSpecular On
        SetTexture [_MainTex] {
            Combine texture * primary DOUBLE, texture * primary
        }
    }

    //Sphere Map
    Pass
    {
        Name "SPHERE MAP"
        ZWrite Off
        Blend SrcAlpha OneMinusSrcAlpha

        SetTexture [_SphereMapTex] {
            constantColor[_SphereMapColor]
            combine texture * constant
        }

        SetTexture [_MainTex] {
            combine previous, texture * previous
        }        
    }        
}

}

more ▼

asked Sep 19 '11 at 06:22 PM

chris1stplayable gravatar image

chris1stplayable
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x505
x46

asked: Sep 19 '11 at 06:22 PM

Seen: 558 times

Last Updated: Sep 19 '11 at 06:22 PM