From 4d62e75fb2438fea3e9199db1641a7fe2848222a Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 5 May 2017 15:25:04 +0300 Subject: gl_rasterizer: implement procedural texture --- src/video_core/renderer_opengl/gl_state.cpp | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/video_core/renderer_opengl/gl_state.cpp') diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 3c03b424a..bf837a7fb 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -58,6 +58,12 @@ OpenGLState::OpenGLState() { fog_lut.texture_1d = 0; + proctex_lut.texture_1d = 0; + proctex_diff_lut.texture_1d = 0; + proctex_color_map.texture_1d = 0; + proctex_alpha_map.texture_1d = 0; + proctex_noise_lut.texture_1d = 0; + draw.read_framebuffer = 0; draw.draw_framebuffer = 0; draw.vertex_array = 0; @@ -201,6 +207,36 @@ void OpenGLState::Apply() const { glBindTexture(GL_TEXTURE_1D, fog_lut.texture_1d); } + // ProcTex Noise LUT + if (proctex_noise_lut.texture_1d != cur_state.proctex_noise_lut.texture_1d) { + glActiveTexture(GL_TEXTURE10); + glBindTexture(GL_TEXTURE_1D, proctex_noise_lut.texture_1d); + } + + // ProcTex Color Map + if (proctex_color_map.texture_1d != cur_state.proctex_color_map.texture_1d) { + glActiveTexture(GL_TEXTURE11); + glBindTexture(GL_TEXTURE_1D, proctex_color_map.texture_1d); + } + + // ProcTex Alpha Map + if (proctex_alpha_map.texture_1d != cur_state.proctex_alpha_map.texture_1d) { + glActiveTexture(GL_TEXTURE12); + glBindTexture(GL_TEXTURE_1D, proctex_alpha_map.texture_1d); + } + + // ProcTex LUT + if (proctex_lut.texture_1d != cur_state.proctex_lut.texture_1d) { + glActiveTexture(GL_TEXTURE13); + glBindTexture(GL_TEXTURE_1D, proctex_lut.texture_1d); + } + + // ProcTex Diff LUT + if (proctex_diff_lut.texture_1d != cur_state.proctex_diff_lut.texture_1d) { + glActiveTexture(GL_TEXTURE14); + glBindTexture(GL_TEXTURE_1D, proctex_diff_lut.texture_1d); + } + // Framebuffer if (draw.read_framebuffer != cur_state.draw.read_framebuffer) { glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer); -- cgit v1.2.3