(self, name, data=None)
Load data for a texture variable.
Load data for a texture variable.
Load data for a texture variable .
def load_texture(self, name, data=None):
        """Load data for a texture variable."""
        variable = self.get_variable(name)
        
        if variable['buffer'] < 0:
            log_debug(("Variable '%s' could not be loaded, probably because "
                      "it is not used in the shaders") % name)
            return
        
        if data is None:
            data = variable.get('data', None)
            
        # NEW: update sampler location
        self.update_samplers = True
        
        if isinstance(data, RefVar):
            log_debug("Skipping loading data for texture '%s' since it "
                "references a target variable." % name)
            return
            
        if data is not None:
            Texture.bind(variable['buffer'], variable['ndim'])
            Texture.load(data)
def load_texture ( self , name , data = None ) : variable = self . get_variable ( name ) if variable [ 'buffer' ] < 0 : log_debug ( ( "Variable '%s' could not be loaded, probably because " "it is not used in the shaders" ) % name ) return if data is None : data = variable . get ( 'data' , None ) # NEW: update sampler location self . update_samplers = True if isinstance ( data , RefVar ) : log_debug ( "Skipping loading data for texture '%s' since it " "references a target variable." % name ) return if data is not None : Texture . bind ( variable [ 'buffer' ] , variable [ 'ndim' ] ) Texture . load ( data )