def __init__(self, svbrdf: BeckmannSVBRDF): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('beckmann.frag.glsl'), use_uvs=True, use_cam_pos=True, use_lights=True, use_normals=True, use_tangents=True, use_bitangents=True, use_radiance_map=True) self.diffuse_map = svbrdf.diffuse_map.astype(np.float32) self.specular_map = svbrdf.specular_map.astype(np.float32) self.normal_map = svbrdf.normal_map.astype(np.float32) self.roughness_map = svbrdf.roughness_map.astype(np.float32) self.anisotropy_map = svbrdf.anisotropy_map.astype(np.float32) self.frag_tpl_vars['change_color'] = glsl_bool(False) self.diff_map_lab = None self.diff_old_mean = None self.diff_old_std = None self.diff_new_mean = None self.diff_new_std = None self.uniforms = {} self.init_uniforms()
def __init__(self): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('uv.frag.glsl'), use_uvs=True, use_cam_pos=False, use_lights=False, use_normals=False)
def __init__(self): super().__init__(GLSLTemplate.fromfile('world_coord.vert.glsl'), GLSLTemplate.fromfile('world_coord.frag.glsl'), use_uvs=False, use_cam_pos=False, use_lights=False, use_normals=False)
def __init__(self, svbrdf: AittalaSVBRDF): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('aittala.frag.glsl'), use_uvs=True, use_cam_pos=True, use_lights=True, use_normals=True, use_tangents=True, use_bitangents=True, use_radiance_map=True) self.alpha = svbrdf.alpha self.diff_map = svbrdf.diffuse_map.astype(np.float32) self.spec_map = svbrdf.specular_map.astype(np.float32) self.spec_shape_map = svbrdf.spec_shape_map.astype(np.float32) self.normal_map = svbrdf.normal_map.astype(np.float32) self.sigma_min = svbrdf.sigma_min self.sigma_max = svbrdf.sigma_max self.cdf_sampler = svbrdf.cdf_sampler self.pdf_sampler = svbrdf.pdf_sampler self.frag_tpl_vars['change_color'] = glsl_bool(False) self.diff_map_lab = None self.diff_old_mean = None self.diff_old_std = None self.diff_new_mean = None self.diff_new_std = None self.uniforms = {} self.init_uniforms()
def __init__(self): super().__init__(GLSLTemplate.fromfile('depth.vert.glsl'), GLSLTemplate.fromfile('depth.frag.glsl'), use_uvs=False, use_cam_pos=False, use_lights=False, use_normals=False, use_near_far=True)
def __init__(self): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('bitangent.frag.glsl'), use_uvs=False, use_cam_pos=False, use_lights=False, use_tangents=False, use_bitangents=True)
def __init__(self, color: np.ndarray): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('basic.frag.glsl'), use_uvs=False, use_lights=False, use_cam_pos=False, use_normals=False, use_tangents=False) self.color = color self.uniforms = {'u_color': self.color}
def __init__(self, texture: np.ndarray): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('basic_texture.frag.glsl'), use_uvs=True, use_lights=False, use_cam_pos=False, use_normals=False, use_tangents=False) self.texture = texture self.uniforms = {} self.init_uniforms()
def __init__(self, diff_color, spec_color, roughness): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('blinn_phong.frag.glsl'), use_uvs=False, use_lights=True, use_cam_pos=True, use_normals=True, use_radiance_map=True) self.diff_color = diff_color self.spec_color = spec_color self.roughness = roughness self.uniforms = { 'u_diff': self.diff_color, 'u_spec': self.spec_color, 'u_roughness': self.roughness, }
def __init__(self, image, depth_im): super().__init__(GLSLTemplate.fromfile('unwrap_to_uv.vert.glsl'), GLSLTemplate.fromfile('unwrap_to_uv.frag.glsl'), use_uvs=True) if image.dtype != np.float32: image = image.astype(np.float32) if depth_im.dtype != np.float32: depth_im = depth_im.astype(np.float32) self.input_tex = Texture2D(image, interpolation='linear', wrapping='clamp_to_edge', internalformat='rgb32f') self.input_depth = Texture2D(depth_im, interpolation='linear', wrapping='clamp_to_edge', internalformat='r32f') self.uniforms = { 'input_tex': self.input_tex, 'input_depth': self.input_depth, }
def __init__(self): super().__init__(GLSLTemplate.fromfile('default.vert.glsl'), GLSLTemplate.fromfile('dummy.frag.glsl'), use_lights=False, use_radiance_map=False)
def __init__(self, clear_color=(0, 0, 0, 0)): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/clear.frag.glsl')) self.clear_color = clear_color
def __init__(self, exposure): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/exposure_tonemap.frag.glsl')) self.exposure = exposure
def __init__(self, thres): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/reinhard_tonemap.frag.glsl')) self.thres = thres
def __init__(self, gamma=2.2): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/gamma_correction.frag.glsl')) self.gamma = gamma
def __init__(self, scale: int): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/ssaa.frag.glsl')) assert scale == 2 or scale == 3 self.scale = scale
def __init__(self): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('envmap/cubemap_to_panorama.frag.glsl'))
def __init__(self): super().__init__( GLSLTemplate.fromfile('postprocessing/quad.vert.glsl'), GLSLTemplate.fromfile('postprocessing/identity.frag.glsl'))