Did I find the right examples for you? yes no

All Samples(68)  |  Call(52)  |  Derive(0)  |  Import(16)

src/c/h/chemlab-HEAD/chemlab/graphics/renderers/base.py   chemlab(Download)
from ctypes import POINTER
 
from ..shaders import set_uniform, compileShader
import numpy as np
import pkgutil
    def setup_shader(self):
        glUseProgram(self.shader)
        # Setup the uniforms
        set_uniform(self.shader, "mvproj", "mat4fv", self.viewer.mvproj)
        set_uniform(self.shader, "lightDir", "3f", self.viewer.ldir)
        set_uniform(self.shader, "camera", "3f", self.viewer.camera.position)
    def setup_shader(self):
        super(DefaultRenderer, self).setup_shader()
        set_uniform(self.shader, "viewmatrix", "mat4fv",
                    self.viewer.camera._get_rotation_matrix().transpose())        
 

src/c/h/chemlab-0.3/chemlab/graphics/renderers/base.py   chemlab(Download)
from ctypes import POINTER
 
from ..shaders import set_uniform, compileShader
import numpy as np
import pkgutil
    def setup_shader(self):
        glUseProgram(self.shader)
        # Setup the uniforms
        set_uniform(self.shader, "mvproj", "mat4fv", self.viewer.mvproj)
        set_uniform(self.shader, "lightDir", "3f", self.viewer.ldir)
        set_uniform(self.shader, "camera", "3f", self.viewer.camera.position)
    def setup_shader(self):
        super(DefaultRenderer, self).setup_shader()
        set_uniform(self.shader, "viewmatrix", "mat4fv",
                    self.viewer.camera._get_rotation_matrix().transpose())        
 

src/c/h/chemlab-HEAD/chemlab/graphics/postprocessing/fxaa.py   chemlab(Download)
 
from ..textures import Texture
from ..shaders import set_uniform, compileShader
from .base import AbstractEffect
 
        glUseProgram(self.quad_program)
 
        set_uniform(self.quad_program, 'FXAA_SPAN_MAX', '1f', self.span_max)
        set_uniform(self.quad_program, 'FXAA_REDUCE_MUL', '1f', self.reduce_mul)
        set_uniform(self.quad_program, 'FXAA_REDUCE_MIN', '1f', self.reduce_min)

src/c/h/chemlab-0.3/chemlab/graphics/postprocessing/fxaa.py   chemlab(Download)
 
from ..textures import Texture
from ..shaders import set_uniform, compileShader
from .base import AbstractEffect
 
        glUseProgram(self.quad_program)
 
        set_uniform(self.quad_program, 'FXAA_SPAN_MAX', '1f', self.span_max)
        set_uniform(self.quad_program, 'FXAA_REDUCE_MUL', '1f', self.reduce_mul)
        set_uniform(self.quad_program, 'FXAA_REDUCE_MIN', '1f', self.reduce_min)

src/c/h/chemlab-HEAD/chemlab/graphics/renderers/sphere_imp.py   chemlab(Download)
from .base import ShaderBaseRenderer
import pkgutil
 
from ..shaders import set_uniform
from ..buffers import VertexBuffer
    def setup_shader(self):
        glUseProgram(self.shader)
        set_uniform(self.shader, 'camera_mat', 'mat4fv',
                    self.viewer.camera.matrix)
 
 
        set_uniform(self.shader, 'projection_mat', 'mat4fv',
                    self.viewer.camera.projection)
        set_uniform(self.shader, 'mvproj', 'mat4fv',
                    self.viewer.camera.projection)
 
        set_uniform(self.shader, 'light_dir', '3f', self.ldir[:3])
 
        set_uniform(self.shader, 'scalefac', '1f', 1.5)

src/c/h/chemlab-HEAD/chemlab/graphics/renderers/cylinder_imp.py   chemlab(Download)
from .base import ShaderBaseRenderer
import pkgutil
 
from ..shaders import set_uniform
from ..buffers import VertexBuffer
    def setup_shader(self):
        glUseProgram(self.shader)
        set_uniform(self.shader, 'model_view_rotation_mat', 'mat4fv',
                    self.viewer.camera._get_rotation_matrix())
 
        set_uniform(self.shader, 'model_view_mat', 'mat4fv',
                    self.viewer.camera.matrix)
 
        set_uniform(self.shader, 'model_view_projection_mat', 'mat4fv',
                           self.viewer.camera.matrix))
 
        set_uniform(self.shader, 'projection_mat', 'mat4fv',
                    self.viewer.camera.projection)
 

src/c/h/chemlab-0.3/chemlab/graphics/renderers/sphere_imp.py   chemlab(Download)
from .base import ShaderBaseRenderer
import pkgutil
 
from ..shaders import set_uniform
from ..buffers import VertexBuffer
    def setup_shader(self):
        glUseProgram(self.shader)
        set_uniform(self.shader, 'camera_mat', 'mat4fv',
                    self.viewer.camera.matrix)
 
 
        set_uniform(self.shader, 'projection_mat', 'mat4fv',
                    self.viewer.camera.projection)
        set_uniform(self.shader, 'mvproj', 'mat4fv',
                    self.viewer.camera.projection)
 
        set_uniform(self.shader, 'light_dir', '3f', self.ldir[:3])
 
        set_uniform(self.shader, 'scalefac', '1f', 1.5)

src/c/h/chemlab-0.3/chemlab/graphics/renderers/cylinder_imp.py   chemlab(Download)
from .base import ShaderBaseRenderer
import pkgutil
 
from ..shaders import set_uniform
from ..buffers import VertexBuffer
    def setup_shader(self):
        glUseProgram(self.shader)
        set_uniform(self.shader, 'model_view_rotation_mat', 'mat4fv',
                    self.viewer.camera._get_rotation_matrix())
 
        set_uniform(self.shader, 'model_view_mat', 'mat4fv',
                    self.viewer.camera.matrix)
 
        set_uniform(self.shader, 'model_view_projection_mat', 'mat4fv',
                           self.viewer.camera.matrix))
 
        set_uniform(self.shader, 'projection_mat', 'mat4fv',
                    self.viewer.camera.projection)
 

src/c/h/chemlab-HEAD/chemlab/graphics/postprocessing/outline.py   chemlab(Download)
'''Outline effect'''
 
from ..textures import Texture
from ..shaders import set_uniform, compileShader
 
        glUseProgram(self.quad_program)
 
        set_uniform(self.quad_program, 'whichoutline', '1i',
                    {'depthnormal' : 0, 'depthonly': 1, 'normalonly': 2}[self.kind])
 
        inv_projection = np.linalg.inv(self.widget.camera.projection)
 
        set_uniform(self.quad_program, 'inv_projection', 'mat4fv',

src/c/h/chemlab-0.3/chemlab/graphics/postprocessing/outline.py   chemlab(Download)
'''Outline effect'''
 
from ..textures import Texture
from ..shaders import set_uniform, compileShader
 
        glUseProgram(self.quad_program)
 
        set_uniform(self.quad_program, 'whichoutline', '1i',
                    {'depthnormal' : 0, 'depthonly': 1, 'normalonly': 2}[self.kind])
 
        inv_projection = np.linalg.inv(self.widget.camera.projection)
 
        set_uniform(self.quad_program, 'inv_projection', 'mat4fv',

  1 | 2  Next