Esempio n. 1
0
        public WorldRenderer(MainClass In, World For, float Aspect)
        {
            _for = For;
            _hmap = new HeightmapRenderer(this, _for.Terrain);
            FragmentShader fsimple = new FragmentShader("res/shader/simple.frag");
            FragmentShader fwater = new FragmentShader("res/shader/water.frag");
            FragmentShader fuwater = new FragmentShader("res/shader/underwater.frag");

            _simple = new ShaderProgram();
            _simple.AddFragShader(fsimple);
            GLUtil.PrintGLError("Simple");

            _underwater = new ShaderProgram();
            _underwater.AddFragShader(fuwater);
            GLUtil.PrintGLError("Underwater");

            _water = new ShaderProgram();
            _water.AddFragShader(fwater);
            GLUtil.PrintGLError("Water");

            _curr = _simple;

            _aspect = Aspect;
            _projectionMatrix = Matrix4.CreatePerspectiveFieldOfView((float)(FOV), _aspect, 0.01f, MAX_DEPTH);
            _modelview = Matrix4.CreateTranslation(-10f, -5f, -10f);
            _pos = new Vector3(10, 2, 10);
            _mviewstack = new Stack<Matrix4>();
            _in = In;
            _oldwidth = 0;
            _oldheight = 0;
        }
Esempio n. 2
0
 public void AddFragShader(FragmentShader FS)
 {
     GL.AttachShader (_programID, FS.ID);
     _linked = false;
 }