Esempio n. 1
0
        private void addDefaultPrimitives()
        {
            //Default quad
            MVCore.Primitives.Quad q = new MVCore.Primitives.Quad(1.0f, 1.0f);
            MVCore.Common.RenderState.activeResMgr.GLPrimitiveVaos["default_quad"] = q.getVAO();

            //Default render quad
            q = new MVCore.Primitives.Quad();
            MVCore.Common.RenderState.activeResMgr.GLPrimitiveVaos["default_renderquad"] = q.getVAO();

            //Default cross
            MVCore.Primitives.Cross c = new MVCore.Primitives.Cross(0.1f);
            MVCore.Common.RenderState.activeResMgr.GLPrimitiveVaos["default_cross"] = c.getVAO();

            //Default cube
            MVCore.Primitives.Box bx = new MVCore.Primitives.Box(1.0f, 1.0f, 1.0f);
            MVCore.Common.RenderState.activeResMgr.GLPrimitiveVaos["default_box"] = bx.getVAO();

            //Default sphere
            MVCore.Primitives.Sphere sph = new MVCore.Primitives.Sphere(new Vector3(0.0f, 0.0f, 0.0f), 100.0f);
            MVCore.Common.RenderState.activeResMgr.GLPrimitiveVaos["default_sphere"] = sph.getVAO();
        }
Esempio n. 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            GL.ClearColor(0.1f, 0.2f, 0.5f, 0.0f);
            GL.Enable(EnableCap.DepthTest);

            //Setup Texture
            string texturepath = "E:\\SteamLibrary1\\steamapps\\common\\No Man's Sky\\GAMEDATA\\TEXTURES\\PLANETS\\BIOMES\\WEIRD\\BEAMSTONE\\BEAMGRADIENT.DDS";
            //string texturepath = "E:\\SteamLibrary1\\steamapps\\common\\No Man's Sky\\GAMEDATA\\TEXTURES\\PLANETS\\BIOMES\\WEIRD\\BEAMSTONE\\SCROLLINGCLOUD.DDS";
            Texture tex = new Texture(texturepath);

            texture_id = tex.bufferID;


            string log = "";
            //Compile Necessary Shaders
            //Pass Shader
            GLSLShaderText gbuffer_shader_vs = new GLSLShaderText(ShaderType.VertexShader);

            gbuffer_shader_vs.addStringFromFile("Shaders/Gbuffer_VS.glsl");
            GLSLShaderText passthrough_shader_fs = new GLSLShaderText(ShaderType.FragmentShader);

            passthrough_shader_fs.addStringFromFile("Shaders/PassThrough_FS.glsl");


            shader_conf = new GLSLShaderConfig(gbuffer_shader_vs, passthrough_shader_fs,
                                               null, null, null, SHADER_TYPE.PASSTHROUGH_SHADER);
            compileShader(shader_conf);

            //Generate Geometry

            //Default render quad
            MVCore.Primitives.Quad q = new MVCore.Primitives.Quad();
            quad_vao_id = q.getVAO().vao_id;

            GL.Viewport(0, 0, 800, 600);
        }