예제 #1
0
        public void Render(Matrix4 viewMatrix, Matrix4 projectionMatrix)
        {
            if (bPostConstructor)
            {
                shader  = PoolProxy.GetResource <ObtainShaderPool, ShaderAllocationPolicy <SkyboxShader>, string, SkyboxShader>(String.Format("{0}{1},{0}{2}", ProjectFolders.ShadersPath, "skyboxVS.glsl", "skyboxFS.glsl"));
                model   = new RawModel(attribs);
                cubemap = ProxyTextureLoader.LoadCubemap(new string[] {
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "right.bmp",
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "left.bmp",
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "top.bmp",
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "bottom.bmp",
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "back.bmp",
                    ProjectFolders.SkyboxTexturesPath + "/Day/" + "front.bmp"
                });


                bPostConstructor = false;
            }

            shader.startProgram();
            cubemap.BindTexture(OpenTK.Graphics.OpenGL.TextureUnit.Texture0);
            shader.SetTransformationMatrices(Matrix4.Identity, viewMatrix, projectionMatrix);
            shader.SetCubemap(0);
            VAOManager.renderBuffers(model.Buffer, OpenTK.Graphics.OpenGL.PrimitiveType.Triangles);
            shader.stopProgram();
        }
예제 #2
0
        private void RenderBasePass()
        {
            if (PostConstructor)
            {
                DefaultTexture  = ProxyTextureLoader.LoadSingleTexture(System.Environment.CurrentDirectory + "\\..\\..\\Textures\\default.jpg");
                DefaultShader   = new BasicShader(System.Environment.CurrentDirectory + "/../../Shaders/basicVS.glsl", "../../Shaders/basicFS.glsl");
                PostConstructor = false;
            }

            if (actor != null)
            {
                actor.Render(EditorCamera.ViewMatrix, projectionMatrix);
            }

            skybox.Render(EditorCamera.ViewMatrix, projectionMatrix);
        }
예제 #3
0
        private void RenderBasePass()
        {
            if (PostConstructor)
            {
                CollisionBoxModel = new RawModel(ProxyModelLoader.LoadModel(CollisionBoxPath));
                DefaultTexture    = ProxyTextureLoader.LoadSingleTexture(ProjectFolders.TextureAtlasPath + "\\default.jpg");
                DefaultShader     = new BasicShader(ProjectFolders.ShadersPath + "\\basicVS.glsl", ProjectFolders.ShadersPath + "\\basicFS.glsl");
                PostConstructor   = false;
            }

            if (actor != null && !bComponentHierarchyIsDirty)
            {
                actor.Render(EditorCamera.ViewMatrix, projectionMatrix);
            }

            skybox.Render(EditorCamera.ViewMatrix, projectionMatrix);
        }
예제 #4
0
        public void Render(Matrix4 viewMatrix, Matrix4 projectionMatrix)
        {
            if (bPostConstructor)
            {
                model   = new RawModel(attribs);
                shader  = new SkyboxShader(Environment.CurrentDirectory + "/../../Shaders/skyboxVS.glsl", Environment.CurrentDirectory + "/../../Shaders/skyboxFS.glsl");
                cubemap = ProxyTextureLoader.LoadCubemap(new string[] {
                    Environment.CurrentDirectory + "/../../Textures/Right.bmp",
                    Environment.CurrentDirectory + "/../../Textures/Left.bmp",
                    Environment.CurrentDirectory + "/../../Textures/top.bmp",
                    Environment.CurrentDirectory + "/../../Textures/bottom.bmp",
                    Environment.CurrentDirectory + "/../../Textures/Back.bmp",
                    Environment.CurrentDirectory + "/../../Textures/Front.bmp"
                });
                bPostConstructor = false;
            }

            shader.startProgram();
            cubemap.BindTexture(OpenTK.Graphics.OpenGL.TextureUnit.Texture0);
            shader.SetTransformationMatrices(viewMatrix, projectionMatrix);
            shader.SetCubemap(0);
            VAOManager.renderBuffers(model.Buffer, OpenTK.Graphics.OpenGL.PrimitiveType.Triangles);
            shader.stopProgram();
        }
예제 #5
0
 public void SetTexture(string texturePath)
 {
     actor.SetTexture(ProxyTextureLoader.LoadSingleTexture(texturePath));
 }