Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

sobeit

Member Since 16 Jul 2009
Offline Last Active Yesterday, 07:43 PM
-----

Topics I've Started

how to compile ASSIMP using vs 11

18 May 2013 - 04:18 PM

Hi all, Recently I'm learning opengl with GLSL, and come to the phase where 3d model is needed. my problem is I can't build assimp appropriately under VS 2012. Should I just create a new project and add all source code and build them? Can someone provide a tutorial on this?(I got my boost installed.) Thanks.


crashes at glGenBuffers, run time error says "Unhandled exception at 0x53930647 (nv...

29 April 2013 - 01:54 AM

Hi, 

 

I'm learning OpenGL, and using glfw and glew. but after searching all over the internet I still don't know why my program crashes every time at the call of glGenBuffers. it pops up the run time error "Unhandled exception at 0x54C00647 (nvoglv32.dll) in OpenglGLFW.exe: 0xC0000005: Access violation writing location 0x003D5000."

 

I cannot move on without fixing this bug. So can someone help detect the problem of my program? Thanks very much!

 

following is my code snippet:

if( !glfwInit() )
	{
		exit( EXIT_FAILURE );
	}
	// Open an OpenGL window
	if( !glfwOpenWindow( 640, 480, 0,0,0,0,0,0, GLFW_WINDOW ) )
	{
		glfwTerminate();
		exit( EXIT_FAILURE );
	}
	
	glewExperimental = GL_TRUE;
	GLenum glewErr = glewInit();
	if (GLEW_OK != glewErr)
	{
		std::cerr << "Failed to initialize GLEW." << std::endl;
		std::cerr << glewGetErrorString(glewErr) << std::endl;
	}

	if(!glewIsSupported("GL_ARB_vertex_buffer_object GL_ARB_vertex_array_object"))
	{
		std::cerr << "some extensions are not supported!" << std::endl;
	}

	//initializing shaders
	shaderProg = initShaderProgram(2, "shaders/shader0.vert", "shaders/shader0.frag");

	glGenVertexArrays(1, &avao);
	glGenBuffers(GL_ARRAY_BUFFER, &vertBO);
	
	glBindVertexArray(avao);
	glBindBuffer(GL_ARRAY_BUFFER, vertBO);
	glBufferData(GL_ARRAY_BUFFER, sizeof(vertexPositions), vertexPositions, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

 

 


How does shadow mapping work?

21 April 2013 - 02:25 AM

hi all,

 

I'm trying to implement the shadow mapping, but I can't understanding the exact theory behind it. My problem lies in the second pass where I need to compare the depth stored in the shadow map with the current pixel depth. 

 

Assume now in the second render pass I have the depth of one pixel, which value in shadow map should I compare to? how can I get that value?

I read some tutorial online, which says I need to calculate the distance between light source and the pixel in the second pass, but I don't know how.

 

Can someone elaborate the above part of the algorithm to me? Thanks in advance.


can't get glGenVertexArrays to work.

15 April 2013 - 03:20 AM

hi all,

 

I'm learning GLSL recently, and trying to use vertex array object. but I just can't get things right.

I use glew for OpenGL setup, and use vertex array to bind vertex attributes. while the compiler doesn't show any complaint, the output doesn't show anything neither. I try to use glsldevil to debug my shader program. it turns out that every time when the program comes to execute glGenVertexArrays(1, m_vao), the error message window pops up saying the program xxxx.exe has stopped working. Show I assume that I did something wrong with glGenvertexArrays.

below is the snippet of my code, how am i gonna fix this? Thanks in advance.

 

        glGenBuffers(1, &m_vertBO);
	glGenBuffers(1, &m_indexBO);

	glGenVertexArrays(1, &m_vao);

	//vertex array=============================
	glBindVertexArray(m_vao);
	
	//pass in vertex data
	glBindBuffer(GL_ARRAY_BUFFER, m_vertBO);
	glBufferData(GL_ARRAY_BUFFER, sizeofvertdata, tempVertData, GL_STATIC_DRAW);
	
	//pass in index data
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBO);
	glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeofindexdata, tempIndexData, GL_STATIC_DRAW);

	//vertex data
	glEnableVertexAttribArray(vertLoc);
	glVertexAttribPointer(vertLoc, 3, GL_FLOAT, GL_FALSE, 0, 0);
	//texture data
	if (objmodel.hasTexCoord())
	{
		glEnableVertexAttribArray(texCoordLoc);
		glVertexAttribPointer(texCoordLoc, 2, GL_FLOAT, GL_FALSE, 0, (void *)(objmodel.texCoordOffset()));
	}
	//normal data
	if (objmodel.hasNormal())
	{
		glEnableVertexAttribArray(normLoc);
		glVertexAttribPointer(normLoc, 3, GL_FLOAT, GL_FALSE, 0, (void *)(objmodel.normalOffset()));
	}

	//unbind vertex array object
	glBindVertexArray(0);

	//unbind vertex and index buffer object
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

the default coordinate system of model, right-handed or left-handed?

22 February 2013 - 04:26 PM

hi there,

 

I have a question, as mentioned in the title, in which coordinate system(left-handed or right-handed) are those common 3d-model formats(3dmax, obj) built? 

I have this question because I need to do some back face culling work, which involves vertices triangle winding direction which would be reversed if the coordinate system of an original model is different from the one the model is being transformed.

 

Thanks,

 


PARTNERS