Help with shader conversion GLSL --> OpenGL

Hello forum!

So, I found a great billboard GLSL shader at this link, I made some little changes, and it works perfectly on OSX and iOS to suit my needs. In this demo I made, I used this shader to render some fake 3D boxes.
As you can expect, it doesn’t show on Windows machines since it’s GLSL… So I would like to ask if someone can help me converting it in any other type, so everyone can see the above demo without glitches.

Thanks to whose willing to help. :slight_smile:

Here it is my shader:

Shader "Billboard" {
   Properties {
	  _Color ("Main Color", Color) = (1,1,1,1)
          _MainTex ("Texture Image", 2D) = "white" {}
   }
   SubShader {
      Pass {	
		 Cull Off
         GLSLPROGRAM       
         uniform sampler2D _MainTex;
		 uniform vec4 _Color;
		 uniform vec4 _MainTex_ST;
         varying vec4 textureCoords;
		 varying vec4 color;
         #ifdef VERTEX
         void main()
         {
            gl_Position = gl_ProjectionMatrix 
               * (gl_ModelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0) 
               + vec4(gl_Vertex.x, gl_Vertex.y, 0.0, 0.0));
 
            textureCoords = 
               vec4(gl_Vertex.x + 0.5, gl_Vertex.y + 0.5, 0.0, 0.0);
			color = vec4(_Color.r - 0.5, _Color.g - 0.5, _Color.b - 0.5, 1.0);
         }
         #endif
         #ifdef FRAGMENT
         void main()
         {
            gl_FragColor = texture2D(_MainTex , _MainTex_ST.xy * vec2(textureCoords) + (_MainTex_ST.zw));
			if (gl_FragColor.a < 0.5)
            {
               discard;
            }
			gl_FragColor += color;
         }
         #endif
         ENDGLSL
      }
   }
}

As described here: GLSL Programming/Unity - Wikibooks, open books for an open world
here: GLSL Programming/Unity/Minimal Shader - Wikibooks, open books for an open world
and here: Unity - Manual: Command-line arguments
you have to start Unity with the command line argument “-force-opengl” to see the GLSL shader in Windows.
Unfortunately, the GLSL shader won’t run in a web browser on Windows.

However, There is a sister wikibook called “Cg Programming” with all of the Unity shaders in Cg. For example:

http://en.wikibooks.org/wiki/Cg_Programming/Unity/Billboards

Woah, I really missed this… Thank you very much, this is exactly what I needed. :smile:

Yes, I know I can force an exe to run in OpenGL, but I really needed it on a web browser. :slight_smile:

Check out this link. It will give you some helpful info I think.

First result was this page…