How to ignore small objects

Hi all,

I am new here, and also a newcomer in OpenGL.
I encount a practical problem in OpenGL, will anyone give me suggestions?

In my project, I try to use a huge number of vertices to rendering a image.
I will load about 100 million vertics to rederning image in large or small FOV(Field of view).
Because of too many vertices, my performance is very poor.
And small objects are not visible in the large field of view.

I wondering if there are any settings in OpenGL that can ignore smll objects when rendering image of big FOV.
Because small objects also need when rendering samll FOV, I can’t just remove small objects from those vertices.

Thanks! there is my rendering code.

void GLImageGenerator::GLScanImage(double* translate)
	glm::mat4 trans = GetTrans(translate);
	// trans = glm::scale(trans, glm::vec3(250, 250, 250));

	glClearColor(0.2f, 0.3f, 0.3f, 1.0f);

	unsigned int transformLoc = glGetUniformLocation(ourShader.ID, "transform");
	glUniformMatrix4fv(transformLoc, 1, GL_FALSE, glm::value_ptr(trans));

	unsigned int myOffset = glGetUniformLocation(ourShader.ID, "dieOffset");
	glUniform3f(myOffset, (GLfloat) 21.0, (GLfloat) 21.0, 9);


	// glMultiDrawArrays(GL_TRIANGLE_FAN, m_fans_starts, m_fans_size, m_boxCount);
	// glMultiDrawArrays(GL_LINE_LOOP, m_fans_starts, m_fans_size, m_boxCount);

	// glMultiDrawArraysIndirect(GL_LINE_LOOP, m_indirectArray, m_boxCount, 0);
	for (int i = 0; i < m_boxCount; ++i)
		glDrawArraysInstanced(GL_LINE_LOOP, i * 4, 4, 81);
	GLenum err;
	while ((err = glGetError()) != GL_NO_ERROR) {
		std::cout << err;

No. It will render whatever you tell it to render. It’s up to the programmer to adjust the level of detail.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.