Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualRevenantBob

Posted 10 October 2012 - 02:09 PM

I used a marker and do a quick string function after I load the file to replace the markers with 0's and save offsets, Then I pass those pointers to the compiler. [vertex shader] [fragment shader] [geometry shader] is what I use. I also have shader definition which allows me to create indexes to attributes and other data opengl needs to index data.


So it ends up looking like this.
[source lang="plain"][Shader Definition][0] = attribute vPosition[1] = uniform mModelView[2] = uniform mProjectionfrag fragColor0[Vertex shader]#version 150in vec3 vPosition;uniform mat4 mModelView;uniform mat4 mProjection;void main(void){ vec4 posTemp = mModelView * vec4(vPosition, 1.0); gl_Position = mProjection * posTemp;}[Fragment shader]#version 150out vec4 fragColor0;void main (void){ // Save it squared fragColor0 = vec4(0, 0, 0, 0); }[/source]

#1RevenantBob

Posted 10 October 2012 - 02:09 PM

I used a marker and do a quick string function after I load the file to replace the markers with 0's and save offsets, Then I pass those pointers to the compiler. [vertex shader] [fragment shader] [geometry shader] is what I use. I also have shader definition which allows me to create indexes to attributes and other data opengl needs to index data.


So it ends up looking like this.
[source lang="plain"][Shader Definition][0] = attribute vPosition[1] = uniform mModelView[2] = uniform mProjectionfrag fragColor0[Vertex shader]#version 150in vec3 vPosition;uniform mat4 mModelView;uniform mat4 mProjection;void main(void){ vec4 posTemp = mModelView * vec4(vPosition, 1.0); gl_Position = mProjection * posTemp;}[Fragment shader]#version 150out vec4 fragColor0;void main (void){ // Save it squared fragColor0 = vec4(0, 0, 0, 0); }[/source]

PARTNERS