This really bugs me.
I draw shapes using the GL class with no problem, but when I export to webplayer the shapes are gone(!).
This might be an issue with the shader I use. By experimenting I found that changing the Pixel Light Count in the Quality Setting has an influence. Also whether I use my own shader using GL.SetPass() or use the default (no SetPass) makes a difference.
Any quick fixes to this issue?
Any help is greatly appreciated!
~ce
(the circle is made of GL lines)
private Vector2[] lines;
private Material material = null;
void Start(){
InitLines();
material = new Material( Shader.Find( "ce/Draw" ) );
}
void OnRenderObject(){
material.SetPass( 0 );
GL.LoadPixelMatrix();
GL.Begin( GL.LINES );
GL.Color( Color.white );
for( int i=0; i<lines.Length; i++ ) GL.Vertex3( lines[i].x, lines[i].y, 0 );
GL.End();
}
void InitLines(){
// instantiating an array of Vector2D's in the shape of a circle
}
The shader I use:
Shader "ce/Draw" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
Tags {"Queue" = "Overlay"}
Lighting Off ZTest Always ZWrite Off Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Color [_Color]
SetTexture [_MainTex] {
combine primary, texture * primary
}
}
}
}
The project can be downloaded here:
http://sixthsensor.dk/temp/unityforum/GLPixellights.zip