Jump to content
  • Advertisement
Sign in to follow this  
giugio

OpenGL Opengl with shaders

This topic is 2650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello.
I trying to convert a opengl 2.0 project without shader in a opengl 2.0 project with shader.
My problem is this:
I have

void RenderFrame()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMultMatrixf(&g_camera.getViewMatrix()[0][0]);//in g_camera.getViewMatrix() i have a correct view matrix with
//rotation's and orientation


RenderModel();// draw mesh
}
void RenderModel()
{
glPushMatrix();

m[3][0] = g_meshPosition.x;
m[3][1] = g_meshPosition.y;
m[3][2] = g_meshPosition.z;

glMultMatrixf(&m[0][0]);
.
.
.
glDrawElements(GL_TRIANGLES, pMesh->triangleCount * 3,
GL_UNSIGNED_INT, g_model.getIndexBuffer() + pMesh->startIndex);

glPopMatrix();
}

In my project i have only shader and for each shader a Model view matrix and projection matrix.
But the demo project first set the correct view matrix(that I have ) then set the position of the mesh(that i have) and then draw.

But how i can do this with shaders?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!