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(); }
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); }
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); }
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(); }
public void SetTexture(string texturePath) { actor.SetTexture(ProxyTextureLoader.LoadSingleTexture(texturePath)); }