init pyhton:
class FrostedGlass(renpy.Displayable):
def __init__(self, child, intensity=0.05, scale=10.0, noise_intensity=0.01):
super(FrostedGlass, self).__init__()
self.child = renpy.displayable(child)
self.intensity = intensity
self.scale = scale
self.noise_intensity = noise_intensity
def render(self, width, height, st, at):
rv = renpy.Render(config.screen_width, config.screen_height)
child = renpy.display.render.render(self.child, width, height, st, at)
child_width, child_height = child.get_size()
rv.add_shader("FrostedGlass")
rv.add_uniform("u_intensity", self.intensity)
rv.add_uniform("u_scale", self.scale)
rv.add_uniform("u_noise_intensity", self.noise_intensity)
rv.blit(child, (0, 0))
return rv
#rv.mesh = True
def get_size(self):
return self.child.get_size()
def event(self, ev, x, y, st):
return self.child.event(ev, x, y, st)
renpy.register_sl_displayable("FrostedGlass", FrostedGlass, "", 1).add_property("intensity").add_property("scale").add_property("noise_intensity")