Bonjour à tous,

Je me suis mis à tester un truc bête comme chou dans mon programme opengl : afficher 10000 quad coloré par frame . Je les affichent simplement au même endroit, pour vérifier si ca passait et la je passe de 5000 fps à 5.
Je sais que 5000 n'est aps représentatif de grand-chose mais bon quand même ...

J'affiche mes fps à 5000, comme à 5 à l'aide d'une simple fonction en bitmap font. ( Je passe a 2000 et à 5 avec un std::cout , donc le problème ne vient pas de ma fonction d'affichage de texte je pense.

Mon affichage :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
	for (int i = 0 ; i < 10000 ; i++ )
	{
		glBegin(GL_QUADS);
 
			glColor4f(1.0, 0.0, 0.0, 1.0);
 
			glVertex3f(0.0, 0.0, 0.0);
			glVertex3f(0.0, 1.0, 0.0);
			glVertex3f(1.0, 1.0, 0.0);
			glVertex3f(1.0, 0.0, 0.0);
 
		glEnd();
	}
Je possède 4 go de ram, une ati 4870 en 1go et un core duo a 3.1, je pense que mon pc dit pouvoir gérer 10k+ de poly sans trop de problème

Je n'ai rein d'autre qui tourne qui pourrait justifier ce ralentissement dans mon prog. L'écrat entre 1 quad et 1 print et 10k quad et 1 print me parait vraiment trop important .

J'ai oublié d'activer une option quelquonque?

1 quad = 5k fps
10 quad = 3k fps
100 quad = 500 fps
1000 quad = 60 fps
10k quad = 5 fps

Pour fino, voici ma fonction d'init opengl

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
	if ( SDL_InitSubSystem(SDL_INIT_VIDEO)== -1 )
	{
		std::cout << "SDL_VIDEO have failed on initialisation" << std::endl ;
	}
 
	std::string WindowsName = "Demo openGL" ;     
	bool FullScreen = Application::Instance().m_Settings.m_FullScreen ;
	unsigned int ColorBits = Application::Instance().m_Settings.m_ColorBits ;
	unsigned int ScreenWidth = Application::Instance().m_Settings.m_ScreenWidth ;
	unsigned int ScreenHeight = Application::Instance().m_Settings.m_ScreenHeight ;
 
	// Setting up some parameters
	SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 );
	SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );   
	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 ); 
	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );  
	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, ColorBits ); 
	SDL_GL_SetAttribute( SDL_GL_BUFFER_SIZE, ColorBits );  
 
	// Center the windows on the screnn
	_putenv("SDL_VIDEO_WINDOW_POS=center"); 
 
	// Name the windows and give it an icon
	SDL_WM_SetCaption(WindowsName.c_str(),WindowsName.c_str()); 
 
	// SDL_VIDEO flags
	int VideoFlags = SDL_OPENGL | SDL_ANYFORMAT ;
	if ( FullScreen )
		VideoFlags |=   SDL_FULLSCREEN ;
 
	// Creating the ScreenSurface 
	m_ScreenSurface = SDL_SetVideoMode( ScreenWidth, ScreenHeight, ColorBits, VideoFlags );
 
	if ( !m_ScreenSurface )
	{
		std::cout << "SDL_VIDEO have failed creating the ScreenSurface" << std::endl ;
	}
 
	// OpenGl init settings 
	glClearColor(0,0,0,1);
	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); 
	glViewport(0,0,ScreenWidth,ScreenHeight);
	glClearDepth(1.0);
    glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);	
 
	glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
	gluPerspective(60.0,(float) ScreenWidth/ScreenHeight,0.1,100.);
	glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
 
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
 
	// can we use AA ?
	if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1) == -1)
	{
		std::cout << "Cant Init SDL_GL_MULTISAMPLEBUFFERS to 1" << std::endl ;
	}
 
	if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 8) == -1)
	{
		std::cout << "Cant Init SDL_GL_MULTISAMPLEBUFFERS to 8" << std::endl ;
	}
 
	std::cout << "RenderTask :: Init :: OK " << std::endl ;
Merci !