def load_lut(self): """ Loads the color correction lookup table (LUT) """ lut_path = self.get_resource(self.get_setting("color_lut")) lut = RPLoader.load_sliced_3d_texture(lut_path, 64) lut.set_wrap_u(SamplerState.WM_clamp) lut.set_wrap_v(SamplerState.WM_clamp) lut.set_wrap_w(SamplerState.WM_clamp) lut.set_minfilter(SamplerState.FT_linear) lut.set_magfilter(SamplerState.FT_linear) lut.set_anisotropic_degree(0) self.tonemapping_stage.set_shader_input("ColorLUT", lut)
def _load_lut(self): """ Loads the color correction lookup table (LUT) """ lut_path = self.get_resource(self.get_setting("color_lut")) lut = RPLoader.load_sliced_3d_texture(lut_path, 64) lut.set_wrap_u(SamplerState.WM_clamp) lut.set_wrap_v(SamplerState.WM_clamp) lut.set_wrap_w(SamplerState.WM_clamp) lut.set_minfilter(SamplerState.FT_linear) lut.set_magfilter(SamplerState.FT_linear) lut.set_anisotropic_degree(0) self._tonemapping_stage.set_shader_input("ColorLUT", lut)
def load(self): """ Loads the scattering method """ lut_src = self.handle.get_resource( "HosekWilkieScattering/scattering_luit.png") if not isfile(lut_src): self.error("Could not find precompiled LUT for the Hosek Wilkie " "Scattering! Make sure you compiled the algorithm code!") return lut_tex = RPLoader.load_sliced_3d_texture(lut_src, 512, 128, 100) lut_tex.set_wrap_u(SamplerState.WM_repeat) lut_tex.set_wrap_v(SamplerState.WM_clamp) lut_tex.set_wrap_w(SamplerState.WM_clamp) lut_tex.set_minfilter(SamplerState.FT_linear) lut_tex.set_magfilter(SamplerState.FT_linear) # Setting the format explicitely shouldn't be necessary # lut_tex.set_format(Image.F_rgb16) self.handle.display_stage.set_shader_input("ScatteringLUT", lut_tex) self.handle.envmap_stage.set_shader_input("ScatteringLUT", lut_tex)
def load(self): """ Loads the scattering method """ lut_src = self.handle.get_resource( "hosek_wilkie_scattering/scattering_lut.txo") if not isfile(lut_src): self.error("Could not find precompiled LUT for the Hosek Wilkie " "Scattering! Make sure you compiled the algorithm code!") return lut_tex = RPLoader.load_sliced_3d_texture(lut_src, 512, 128, 100) lut_tex.set_wrap_u(SamplerState.WM_repeat) lut_tex.set_wrap_v(SamplerState.WM_clamp) lut_tex.set_wrap_w(SamplerState.WM_clamp) lut_tex.set_minfilter(SamplerState.FT_linear) lut_tex.set_magfilter(SamplerState.FT_linear) # Setting the format explicitely shouldn't be necessary # lut_tex.set_format(Image.F_rgb16) self.handle.display_stage.set_shader_input("ScatteringLUT", lut_tex) self.handle.envmap_stage.set_shader_input("ScatteringLUT", lut_tex)