예제 #1
0
        void testDynShaders()
        {
            DynamicShader ds = new DynamicShader()
            {
                floatPrecision = DynamicShader.Precision.highp
            };

            ds.VertexAttributes.Add(new ShaderData(typeof(Vector3), "in_position"));

            ShaderData <Matrix4> sdProjection = new ShaderData <Matrix4> ("projection");
            ShaderData <Matrix4> sdModelView  = new ShaderData <Matrix4> ("modelView");
            ShaderData <Matrix4> sdModel      = new ShaderData <Matrix4> ("model");

            ds.Uniforms.Add(sdProjection);
            ds.Uniforms.Add(sdModelView);
            ds.Uniforms.Add(sdModel);
            ds.Uniforms.Add(new ShaderData <Vector4>("lightPos"));
            ds.Uniforms.Add(new ShaderData <float>("heightScale"));
            ds.Uniforms.Add(new ShaderData <Vector2>("mapSize"));

            ds.Compile();
        }
예제 #2
0
		void testDynShaders()
		{
			DynamicShader ds = new DynamicShader() { 
				floatPrecision = DynamicShader.Precision.highp 
			};
			ds.VertexAttributes.Add(new ShaderData(typeof(Vector3), "in_position"));

			ShaderData<Matrix4> sdProjection = new ShaderData<Matrix4> ("projection");
			ShaderData<Matrix4> sdModelView = new ShaderData<Matrix4> ("modelView");
			ShaderData<Matrix4> sdModel = new ShaderData<Matrix4> ("model");

			ds.Uniforms.Add (sdProjection);
			ds.Uniforms.Add (sdModelView);
			ds.Uniforms.Add (sdModel);
			ds.Uniforms.Add(new ShaderData<Vector4>("lightPos"));
			ds.Uniforms.Add(new ShaderData<float>("heightScale"));
			ds.Uniforms.Add(new ShaderData<Vector2>("mapSize"));

			ds.Compile ();
		}