Skip to content
Snippets Groups Projects
Commit b25c9b12 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

RGB tensor mode working again for GL14 and 21. Need to look at fragment

boundary checks for line mode (and RGB mode in GL14)
parent 43e0ff9f
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,8 @@ def preDraw(self):
shape = list(self.image.shape)
invshape = [1.0 / s for s in shape]
shaders.setFragmentProgramVector(0, shape + [0])
shaders.setFragmentProgramVector(1, invshape + [0])
shaders.setFragmentProgramVector(1, invshape + [0])
shaders.setFragmentProgramMatrix(2, self.imageTexture.voxValXform.T)
def draw(self, zpos, xform=None):
......
......@@ -43,11 +43,13 @@ def init(self):
# parameters for gltensor_rgb_vert.glsl/gltensor_rgb_frag.glsl
p['imageTexture'] = gl.glGetUniformLocation(s, 'imageTexture')
p['imageValueXform'] = gl.glGetUniformLocation(s, 'imageValueXform')
p['modTexture'] = gl.glGetUniformLocation(s, 'modTexture')
p['xColourTexture'] = gl.glGetUniformLocation(s, 'xColourTexture')
p['yColourTexture'] = gl.glGetUniformLocation(s, 'yColourTexture')
p['zColourTexture'] = gl.glGetUniformLocation(s, 'zColourTexture')
p['imageShape'] = gl.glGetUniformLocation(s, 'imageShape')
p['imageDims'] = gl.glGetUniformLocation(s, 'imageDims')
p['useSpline'] = gl.glGetUniformLocation(s, 'useSpline')
p['displayToVoxMat'] = gl.glGetUniformLocation(s, 'displayToVoxMat')
......@@ -93,16 +95,25 @@ def preDraw(self):
# bind the shader uniform/attribute parameters
pars = self.shaderParams
useSpline = display.interpolation == 'spline'
imageShape = np.array(self.image.shape, dtype=np.float32)
imageShape = np.array(self.image.shape, dtype=np.float32)
imageDims = np.array(self.image.pixdim, dtype=np.float32)
displayToVoxMat = np.array(display.displayToVoxMat, dtype=np.float32)
imageValueXform = np.array(self.imageTexture.voxValXform.T,
dtype=np.float32)
displayToVoxMat = displayToVoxMat.ravel('C')
imageValueXform = imageValueXform.ravel('C')
gl.glUniform1f( pars['useSpline'], useSpline)
gl.glUniform3fv( pars['imageShape'], 1, imageShape)
gl.glUniform3fv( pars['imageDims'], 1, imageDims)
gl.glUniform1i( pars['xax'], self.xax)
gl.glUniform1i( pars['yax'], self.yax)
gl.glUniform1i( pars['zax'], self.zax)
gl.glUniformMatrix4fv(pars['displayToVoxMat'], 1, False, displayToVoxMat)
gl.glUniformMatrix4fv(pars['imageValueXform'], 1, False, imageValueXform)
gl.glUniform1i( pars['imageTexture'], 0)
gl.glUniform1i( pars['modTexture'], 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment