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

Restructured GL14 vertex/fragment programs to be more like the GL21

vertex/fragment shaders.
parent a52f200a
No related branches found
No related tags found
No related merge requests found
!!ARBvp1.0
# #
# Vertex program used for rendering GLObject instances. # Vertex program routine used for rendering GLObject instances.
# #
# This vertex program does three things: # This routine does three things:
# #
# - Transforms vertex coordinates from display coordinates into screen # - Transforms vertex coordinates from display coordinates into screen
# coordinates. # coordinates.
...@@ -76,7 +75,7 @@ DP4 vertexVoxelPos.w, dispToVoxMat[3], vertex.position; ...@@ -76,7 +75,7 @@ DP4 vertexVoxelPos.w, dispToVoxMat[3], vertex.position;
# Offset voxel coordinates by 0.5 # Offset voxel coordinates by 0.5
# so they are centred within a voxel. # so they are centred within a voxel.
# See comments in gl21/generic_vert.glsl # See comments in gl21/common_vert.glsl
# for an explanation. # for an explanation.
ADD vertexVoxelPos, vertexVoxelPos, { 0.5, 0.5, 0.5, 0.0 }; ADD vertexVoxelPos, vertexVoxelPos, { 0.5, 0.5, 0.5, 0.0 };
...@@ -84,5 +83,3 @@ ADD vertexVoxelPos, vertexVoxelPos, { 0.5, 0.5, 0.5, 0.0 }; ...@@ -84,5 +83,3 @@ ADD vertexVoxelPos, vertexVoxelPos, { 0.5, 0.5, 0.5, 0.0 };
MOV result.position, vertexScreenPos; MOV result.position, vertexScreenPos;
MOV result.texcoord[0], vertex.position; MOV result.texcoord[0], vertex.position;
MOV result.texcoord[1], vertexVoxelPos; MOV result.texcoord[1], vertexVoxelPos;
END
...@@ -31,7 +31,7 @@ def init(self): ...@@ -31,7 +31,7 @@ def init(self):
same programs are used for both ``line`` and ``rgb`` mode. same programs are used for both ``line`` and ``rgb`` mode.
""" """
vertShaderSrc = shaders.getVertexShader('generic') vertShaderSrc = shaders.getVertexShader( self)
fragShaderSrc = shaders.getFragmentShader(self) fragShaderSrc = shaders.getFragmentShader(self)
vertexProgram, fragmentProgram = shaders.compilePrograms( vertexProgram, fragmentProgram = shaders.compilePrograms(
......
!!ARBvp1.0
#
# Vertex program for rendering GLVector instances.
#
#pragma include common_vert.prog
END
...@@ -51,7 +51,7 @@ log = logging.getLogger(__name__) ...@@ -51,7 +51,7 @@ log = logging.getLogger(__name__)
def init(self): def init(self):
"""Compiles the vertex and fragment programs used for rendering.""" """Compiles the vertex and fragment programs used for rendering."""
vertShaderSrc = shaders.getVertexShader('generic') vertShaderSrc = shaders.getVertexShader( self)
fragShaderSrc = shaders.getFragmentShader(self) fragShaderSrc = shaders.getFragmentShader(self)
vertexProgram, fragmentProgram = shaders.compilePrograms( vertexProgram, fragmentProgram = shaders.compilePrograms(
......
!!ARBvp1.0
#
# Vertex program for rendering GLVolume instances.
#
#pragma include common_vert.prog
END
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