ADDING transparency to this shader

Questions à propos du scripting Shader.
zouaghi
Messages : 1
Inscription : 15 Mars 2014 01:33

ADDING transparency to this shader

Message par zouaghi » 15 Mars 2014 01:36

Hello everybody so here is my problem , i want a shader that make a gameobject ( plane) behave like a GUI.texture so i found this shader and it was perfect but i want to add on it a transparency so could you help me please ?

Code : Tout sélectionner

Shader "Mobile/GUI/Health Rings"
{
    Properties
    {
        _MainTex ("Font Texture", 2D) = "white" {}
        _Cutoff ("Alpha Slider", Range (0.011, 1)) = 0.5
    }
    
    SubShader
    {
        Tags { "Queue"="Overlay+1" "IgnoreProjector"="True" }
        AlphaTest GEqual [_Cutoff]
        Lighting Off
        ZTest Always
        ZWrite Off
        Fog { Mode Off }
        Pass
        {
            SetTexture [_MainTex]
        }
    }

}

Avatar de l’utilisateur
Titan
Messages : 582
Inscription : 12 Sep 2011 13:54
Contact :

Re: ADDING transparency to this shader

Message par Titan » 15 Mars 2014 09:20

This is a french forum as you should have noticed, didn't you read the netiquette ? I'm sure you'll have more answers next time if you post on the official forum.
but for this one, your problem is really simple, just read the shaderlab documentation about blending, you have 10 lines to read and 2 lines to update in your shader.
____________________________________________
Hop Boy

Répondre

Revenir vers « les Shaders »