i was try to begin with GL_FRAGMENT_PROGRAM_ARB but my code show black on screen but slow down the speed of processing
here some part of code i made
i declared a object which is
(i insist myself here something wrong)
GLfloat TriVert[] = {
0.0f,0.5f,0.0f,
-0.5f,0.0f,0.0f,
0.5f,0.0f,0.0f,
1.0f,0.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,0.0f,1.0f
},theta = 0.0f;
const char *thatsit = "\
!!ARBfp1.0\
PARAMS vert = {0.0f,0.5f,0.0f,\
-0.5f,0.0f,0.0f,\
0.5f,0.0f,0.0f,\
};\
MUL vert, TriVert\
END";
and display function
glVertexPointer(3,GL_FLOAT,NULL,0);
glColorPointer(3,GL_FLOAT,NULL,(int*)36);
glBindBufferARB(GL_ARRAY_BUFFER_ARB,Vertex);
/*NOTE program bind at rendring time*/
glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, nitspro);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLES,0,3);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
//Destroy it
glPopMatrix();
and when i know that i have extension
if(GLEW_ARB_fragment_program)
{
fprintf(stdout,"Lets do some Fragment program job
");
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glGenProgramsARB(2,&nitspro);
glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, nitspro);
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(thatsit),
thatsit);
}
else fprintf(stdout,"Hardware not supporting the fragment program job so leave it ");
please help me regarding this
i read the specs of fragment_program.txt
and these of dot product textures attribute
please help me in these things
any link lecture on these DP3,HDP…,etc
(Here i want to say i am 17 years that mean i am really beginner to these type of programming(not C/C++)
so please reply)
thanks for just reading it and think on this Q
thanks in advance