Irrlicht unit tests

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

There are some things we can check:

First - run it once more to check if you get the same 2 errors again. Reason is that there is often a bit of a problem with drivers if they are started/shutdown so fast as happens in tests (despite some workarounds where we try to prevent that - never got 100% rid of this problem). So please just run a second time (or alternatively modify the main.cpp to run only those tests that fail).

And if they fail again - the tests write the failed images to tests/results. So in this case results/OpenGL-rttAndAntiAlias.png and results/OpenGL-lineAntiAliasing.png. Can you post those please? Maybe they give me some hint what goes wrong.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
juozas
Posts: 15
Joined: Sun Mar 27, 2022 12:58 pm
Location: Lithuania
Contact:

Re: Irrlicht unit tests

Post by juozas »

After a fresh reboot both tests (Test 53 'renderTargetTexture' and Test 58 'antiAliasing') are still failing. Re-running them doesn't help. The requested images are listed below:
OpenGL-lineAntiAliasing.png:
Image
OpenGL-rttAndAntiAlias.png:
Image
Сделано в СССР

OS: Ubuntu Linux 22.04 LTS 64 bit
Motherboard: ASUS P5G41-M LE
CPU: Intel Pentium Dual-Core E6300 @ 2.80GHz
RAM: DDR2 @ 2G
GPU: NVIDIA GeForce GT 710 @ 2G (Driver version: 470)
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Interesting. Viewport in both cases wrong (showing only the left half for some reason).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Can you try to enforce a compile-error in CGLXManager constructor to find out which define (if any) is used in your case for anti-aliasing?
Like add some 'x' around that place in CGLXManager.cpp:

Code: Select all

#if defined(GLX_VERSION_1_4) && defined(GLX_SAMPLE_BUFFERS) // we need to check the extension string!
x				GLX_SAMPLE_BUFFERS, 1,
				GLX_SAMPLES, Params.AntiAlias, // 18,19
#elif defined(GLX_ARB_multisample)
x				GLX_SAMPLE_BUFFERS_ARB, 1,
				GLX_SAMPLES_ARB, Params.AntiAlias, // 18,19
#elif defined(GLX_SGIS_multisample)
x				GLX_SAMPLE_BUFFERS_SGIS, 1,
				GLX_SAMPLES_SGIS, Params.AntiAlias, // 18,19
#endif
Then check which line the compiler complains about when compiling Irrlicht. If any - maybe the problem is those are all wrong...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
juozas
Posts: 15
Joined: Sun Mar 27, 2022 12:58 pm
Location: Lithuania
Contact:

Re: Irrlicht unit tests

Post by juozas »

Introducing compile error as describes generates interesting results, maybe something useful can be found here :)

Code: Select all

g++ -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -g -D_DEBUG -Wall -pipe -fno-exceptions -fno-rtti -MM -MF CGLXManager.d CGLXManager.cpp
g++ -Wall -pipe -fno-exceptions -fno-rtti -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1 -g -D_DEBUG  -c -o CGLXManager.o CGLXManager.cpp
CGLXManager.cpp: In constructor ‘irr::video::CGLXManager::CGLXManager(const irr::SIrrlichtCreationParameters&, const irr::video::SExposedVideoData&, int)’:
CGLXManager.cpp:69:1: error: ‘x’ was not declared in this scope
   69 | x    GLX_SAMPLE_BUFFERS, 1,
      | ^
In file included from CGLXManager.cpp:19:
CGLXManager.cpp:69:6: error: expected ‘}’ before numeric constant
   69 | x    GLX_SAMPLE_BUFFERS, 1,
      |      ^~~~~~~~~~~~~~~~~~
CGLXManager.cpp:59:4: note: to match this ‘{’
   59 |    {
      |    ^
CGLXManager.cpp:58:8: warning: unused variable ‘visualAttrBuffer’ [-Wunused-variable]
   58 |    int visualAttrBuffer[] =
      |        ^~~~~~~~~~~~~~~~
CGLXManager.cpp:91:5: error: ‘visualAttrBuffer’ was not declared in this scope
   91 |     visualAttrBuffer[17] = 0;
      |     ^~~~~~~~~~~~~~~~
CGLXManager.cpp:96:53: error: ‘visualAttrBuffer’ was not declared in this scope
   96 |     configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
      |                                                     ^~~~~~~~~~~~~~~~
CGLXManager.cpp:132:5: error: ‘visualAttrBuffer’ was not declared in this scope
  132 |     visualAttrBuffer[15]=Params.Stencilbuffer?1:0;
      |     ^~~~~~~~~~~~~~~~
CGLXManager.cpp:166:5: error: ‘visualAttrBuffer’ was not declared in this scope
  166 |     visualAttrBuffer[13] = GLX_DONT_CARE;
      |     ^~~~~~~~~~~~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:255:2: error: expected unqualified-id before ‘else’
  255 |  else
      |  ^~~~
CGLXManager.cpp:259:1: error: ‘CGLXManager’ does not name a type
  259 | CGLXManager::~CGLXManager()
      | ^~~~~~~~~~~
CGLXManager.cpp:263:6: error: ‘CGLXManager’ has not been declared
  263 | bool CGLXManager::initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& videodata)
      |      ^~~~~~~~~~~
CGLXManager.cpp:263:79: error: ‘SExposedVideoData’ does not name a type
  263 | bool CGLXManager::initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& videodata)
      |                                                                               ^~~~~~~~~~~~~~~~~
CGLXManager.cpp: In function ‘bool irr::initialize(const irr::SIrrlichtCreationParameters&, const int&)’:
CGLXManager.cpp:266:2: error: ‘Params’ was not declared in this scope; did you mean ‘params’?
  266 |  Params=params;
      |  ^~~~~~
      |  params
CGLXManager.cpp:269:2: error: ‘CurrentContext’ was not declared in this scope; did you mean ‘glXGetCurrentContext’?
  269 |  CurrentContext.OpenGLLinux.X11Display=videodata.OpenGLLinux.X11Display;
      |  ^~~~~~~~~~~~~~
      |  glXGetCurrentContext
CGLXManager.cpp:269:50: error: request for member ‘OpenGLLinux’ in ‘videodata’, which is of non-class type ‘const int’
  269 |  CurrentContext.OpenGLLinux.X11Display=videodata.OpenGLLinux.X11Display;
      |                                                  ^~~~~~~~~~~
CGLXManager.cpp:272:49: error: request for member ‘OpenGLLinux’ in ‘videodata’, which is of non-class type ‘const int’
  272 |  CurrentContext.OpenGLLinux.X11Window=videodata.OpenGLLinux.X11Window;
      |                                                 ^~~~~~~~~~~
CGLXManager.cpp:273:7: error: ‘PrimaryContext’ was not declared in this scope
  273 |  if (!PrimaryContext.OpenGLLinux.X11Window)
      |       ^~~~~~~~~~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:281:6: error: ‘CGLXManager’ has not been declared
  281 | void CGLXManager::terminate()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘void irr::terminate()’:
CGLXManager.cpp:283:17: error: ‘CurrentContext’ was not declared in this scope; did you mean ‘glXGetCurrentContext’?
  283 |  memset((void*)&CurrentContext, 0, sizeof(CurrentContext));
      |                 ^~~~~~~~~~~~~~
      |                 glXGetCurrentContext
CGLXManager.cpp: At global scope:
CGLXManager.cpp:286:6: error: ‘CGLXManager’ has not been declared
  286 | bool CGLXManager::generateSurface()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘bool irr::generateSurface()’:
CGLXManager.cpp:288:6: error: ‘glxFBConfig’ was not declared in this scope; did you mean ‘GLXFBConfig’?
  288 |  if (glxFBConfig)
      |      ^~~~~~~~~~~
      |      GLXFBConfig
CGLXManager.cpp:290:3: error: ‘GlxWin’ was not declared in this scope
  290 |   GlxWin=glXCreateWindow((Display*)CurrentContext.OpenGLLinux.X11Display,(GLXFBConfig)glxFBConfig,CurrentContext.OpenGLLinux.X11Window,NULL);
      |   ^~~~~~
CGLXManager.cpp:290:36: error: ‘CurrentContext’ was not declared in this scope; did you mean ‘glXGetCurrentContext’?
  290 |   GlxWin=glXCreateWindow((Display*)CurrentContext.OpenGLLinux.X11Display,(GLXFBConfig)glxFBConfig,CurrentContext.OpenGLLinux.X11Window,NULL);
      |                                    ^~~~~~~~~~~~~~
      |                                    glXGetCurrentContext
CGLXManager.cpp: At global scope:
CGLXManager.cpp:302:6: error: ‘CGLXManager’ has not been declared
  302 | void CGLXManager::destroySurface()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘void irr::destroySurface()’:
CGLXManager.cpp:304:6: error: ‘GlxWin’ was not declared in this scope
  304 |  if (GlxWin)
      |      ^~~~~~
CGLXManager.cpp:305:30: error: ‘CurrentContext’ was not declared in this scope; did you mean ‘glXGetCurrentContext’?
  305 |   glXDestroyWindow((Display*)CurrentContext.OpenGLLinux.X11Display, GlxWin);
      |                              ^~~~~~~~~~~~~~
      |                              glXGetCurrentContext
CGLXManager.cpp: At global scope:
CGLXManager.cpp:308:6: error: ‘CGLXManager’ has not been declared
  308 | bool CGLXManager::generateContext()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘bool irr::generateContext()’:
CGLXManager.cpp:312:6: error: ‘glxFBConfig’ was not declared in this scope; did you mean ‘GLXFBConfig’?
  312 |  if (glxFBConfig)
      |      ^~~~~~~~~~~
      |      GLXFBConfig
CGLXManager.cpp:314:7: error: ‘GlxWin’ was not declared in this scope
  314 |   if (GlxWin)
      |       ^~~~~~
CGLXManager.cpp:317:44: error: ‘CurrentContext’ was not declared in this scope
  317 |    context = glXCreateNewContext((Display*)CurrentContext.OpenGLLinux.X11Display, (GLXFBConfig)glxFBConfig, GLX_RGBA_TYPE, NULL, True);
      |                                            ^~~~~~~~~~~~~~
CGLXManager.cpp:332:40: error: ‘CurrentContext’ was not declared in this scope
  332 |   context = glXCreateContext((Display*)CurrentContext.OpenGLLinux.X11Display, VisualInfo, NULL, True);
      |                                        ^~~~~~~~~~~~~~
CGLXManager.cpp:332:79: error: ‘VisualInfo’ was not declared in this scope; did you mean ‘XVisualInfo’?
  332 |   context = glXCreateContext((Display*)CurrentContext.OpenGLLinux.X11Display, VisualInfo, NULL, True);
      |                                                                               ^~~~~~~~~~
      |                                                                               XVisualInfo
CGLXManager.cpp:339:2: error: ‘CurrentContext’ was not declared in this scope
  339 |  CurrentContext.OpenGLLinux.X11Context=context;
      |  ^~~~~~~~~~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:343:7: error: ‘SExposedVideoData’ does not name a type
  343 | const SExposedVideoData& CGLXManager::getContext() const
      |       ^~~~~~~~~~~~~~~~~
CGLXManager.cpp:348:6: error: ‘CGLXManager’ has not been declared
  348 | bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero)
      |      ^~~~~~~~~~~
CGLXManager.cpp:348:41: error: ‘SExposedVideoData’ does not name a type
  348 | bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero)
      |                                         ^~~~~~~~~~~~~~~~~
CGLXManager.cpp: In function ‘bool irr::activateContext(const int&, bool)’:
CGLXManager.cpp:352:16: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  352 |  if (videoData.OpenGLLinux.X11Window)
      |                ^~~~~~~~~~~
CGLXManager.cpp:354:17: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  354 |   if (videoData.OpenGLLinux.X11Display && videoData.OpenGLLinux.X11Context)
      |                 ^~~~~~~~~~~
CGLXManager.cpp:354:53: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  354 |   if (videoData.OpenGLLinux.X11Display && videoData.OpenGLLinux.X11Context)
      |                                                     ^~~~~~~~~~~
CGLXManager.cpp:356:44: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  356 |    if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)videoData.OpenGLLinux.X11Context))
      |                                            ^~~~~~~~~~~
CGLXManager.cpp:356:78: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  356 |    if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)videoData.OpenGLLinux.X11Context))
      |                                                                              ^~~~~~~~~~~
CGLXManager.cpp:356:123: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  356 |    if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)videoData.OpenGLLinux.X11Context))
      |                                                                                                                           ^~~~~~~~~~~
CGLXManager.cpp:363:5: error: ‘CurrentContext’ was not declared in this scope
  363 |     CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
      |     ^~~~~~~~~~~~~~
CGLXManager.cpp:363:54: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  363 |     CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
      |                                                      ^~~~~~~~~~~
CGLXManager.cpp:364:55: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  364 |     CurrentContext.OpenGLLinux.X11Display = videoData.OpenGLLinux.X11Display;
      |                                                       ^~~~~~~~~~~
CGLXManager.cpp:370:34: error: ‘PrimaryContext’ was not declared in this scope
  370 |    if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)PrimaryContext.OpenGLLinux.X11Context))
      |                                  ^~~~~~~~~~~~~~
CGLXManager.cpp:370:83: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  370 |    if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)PrimaryContext.OpenGLLinux.X11Context))
      |                                                                                   ^~~~~~~~~~~
CGLXManager.cpp:377:5: error: ‘CurrentContext’ was not declared in this scope
  377 |     CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
      |     ^~~~~~~~~~~~~~
CGLXManager.cpp:377:54: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  377 |     CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
      |                                                      ^~~~~~~~~~~
CGLXManager.cpp:382:47: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  382 |  else if (!restorePrimaryOnZero && !videoData.OpenGLLinux.X11Window && !videoData.OpenGLLinux.X11Display)
      |                                               ^~~~~~~~~~~
CGLXManager.cpp:382:83: error: request for member ‘OpenGLLinux’ in ‘videoData’, which is of non-class type ‘const int’
  382 |  else if (!restorePrimaryOnZero && !videoData.OpenGLLinux.X11Window && !videoData.OpenGLLinux.X11Display)
      |                                                                                   ^~~~~~~~~~~
CGLXManager.cpp:384:33: error: ‘PrimaryContext’ was not declared in this scope
  384 |   if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, None, NULL))
      |                                 ^~~~~~~~~~~~~~
CGLXManager.cpp:389:3: error: ‘CurrentContext’ was not declared in this scope
  389 |   CurrentContext.OpenGLLinux.X11Window = 0;
      |   ^~~~~~~~~~~~~~
CGLXManager.cpp:393:11: error: ‘CurrentContext’ was not declared in this scope
  393 |  else if (CurrentContext.OpenGLLinux.X11Display != PrimaryContext.OpenGLLinux.X11Display)
      |           ^~~~~~~~~~~~~~
CGLXManager.cpp:393:52: error: ‘PrimaryContext’ was not declared in this scope
  393 |  else if (CurrentContext.OpenGLLinux.X11Display != PrimaryContext.OpenGLLinux.X11Display)
      |                                                    ^~~~~~~~~~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:408:6: error: ‘CGLXManager’ has not been declared
  408 | void CGLXManager::destroyContext()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘void irr::destroyContext()’:
CGLXManager.cpp:410:6: error: ‘CurrentContext’ was not declared in this scope
  410 |  if (CurrentContext.OpenGLLinux.X11Context)
      |      ^~~~~~~~~~~~~~
CGLXManager.cpp:412:7: error: ‘GlxWin’ was not declared in this scope
  412 |   if (GlxWin)
      |       ^~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:426:6: error: ‘CGLXManager’ has not been declared
  426 | bool CGLXManager::swapBuffers()
      |      ^~~~~~~~~~~
CGLXManager.cpp: In function ‘bool irr::swapBuffers()’:
CGLXManager.cpp:428:27: error: ‘CurrentContext’ was not declared in this scope
  428 |  glXSwapBuffers((Display*)CurrentContext.OpenGLLinux.X11Display, CurrentContext.OpenGLLinux.X11Window);
      |                           ^~~~~~~~~~~~~~
CGLXManager.cpp: At global scope:
CGLXManager.cpp:433:1: error: expected declaration before ‘}’ token
  433 | }
      | ^
make: *** [<builtin>: CGLXManager.o] Error 1
Edit: Generated a list of suspect lines using a one line command as shown below, shows all the places worth checking :)

Code: Select all

grep ^CGLXManager\.cpp\:[0-9] output.txt|grep -i error|cut -d\  -f-1|rev|cut -d\: -f3-|rev|sort -V|uniq

Code: Select all

CGLXManager.cpp:69
CGLXManager.cpp:91
CGLXManager.cpp:96
CGLXManager.cpp:132
CGLXManager.cpp:166
CGLXManager.cpp:255
CGLXManager.cpp:259
CGLXManager.cpp:263
CGLXManager.cpp:266
CGLXManager.cpp:269
CGLXManager.cpp:272
CGLXManager.cpp:273
CGLXManager.cpp:281
CGLXManager.cpp:283
CGLXManager.cpp:286
CGLXManager.cpp:288
CGLXManager.cpp:290
CGLXManager.cpp:302
CGLXManager.cpp:304
CGLXManager.cpp:305
CGLXManager.cpp:308
CGLXManager.cpp:312
CGLXManager.cpp:314
CGLXManager.cpp:317
CGLXManager.cpp:332
CGLXManager.cpp:339
CGLXManager.cpp:343
CGLXManager.cpp:348
CGLXManager.cpp:352
CGLXManager.cpp:354
CGLXManager.cpp:356
CGLXManager.cpp:363
CGLXManager.cpp:364
CGLXManager.cpp:370
CGLXManager.cpp:377
CGLXManager.cpp:382
CGLXManager.cpp:384
CGLXManager.cpp:389
CGLXManager.cpp:393
CGLXManager.cpp:408
CGLXManager.cpp:410
CGLXManager.cpp:412
CGLXManager.cpp:426
CGLXManager.cpp:428
CGLXManager.cpp:433
Сделано в СССР

OS: Ubuntu Linux 22.04 LTS 64 bit
Motherboard: ASUS P5G41-M LE
CPU: Intel Pentium Dual-Core E6300 @ 2.80GHz
RAM: DDR2 @ 2G
GPU: NVIDIA GeForce GT 710 @ 2G (Driver version: 470)
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Thank you. It's just the first error that matters - if it goes in there that means GLX_VERSION_1_4 and GLX_SAMPLE_BUFFERS are both set. Which is more or less the standard, so unfortunately not giving much of a hint yet where the bug comes from.

I think it somehow has to do with AntiAlias being set to 2 in SIrrlichtCreationParameters. But no clue yet why.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Maybe we should make certain first that's the problem - can you add the following line to exampe 12 (TerrainRendering) before createDeviceEx:

Code: Select all

params.AntiAlias = 2;
Just to see if it shows the same bug - the screen suddenly rendered differen. Like if you rendered only it's left side and then stretched that again to full window.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
juozas
Posts: 15
Joined: Sun Mar 27, 2022 12:58 pm
Location: Lithuania
Contact:

Re: Irrlicht unit tests

Post by juozas »

Not sure if it is antialiasing or not with the change, the change is minimal, compare tool not showing much, does not appear only one side is affected.
Image
I've also recorded a video, I don't see many antialiasing artifacts, link https://youtu.be/VAX13uNGgYM (youtube compression might affect the quality, original [link removed (file deleted from my server)])
Last edited by juozas on Mon May 23, 2022 8:23 pm, edited 2 times in total.
Сделано в СССР

OS: Ubuntu Linux 22.04 LTS 64 bit
Motherboard: ASUS P5G41-M LE
CPU: Intel Pentium Dual-Core E6300 @ 2.80GHz
RAM: DDR2 @ 2G
GPU: NVIDIA GeForce GT 710 @ 2G (Driver version: 470)
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Thanks. It would be very visible if it's like test-results (you can compare the error screenshots in tests/results with the one with the same name in tests/media then you see how different they are. That's basically what most of our tests do - they use the media files as reference images and compare how different current results in the engine are to those).

I got another idea (maybe screenshot function is affected), but have to write some test-code for that first.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

OK, I've modified the screenshot test in svn trunk. My hope is that the new OpenGL-shotsInShots2.png will also fail now in your case. And if so would be great if you could post the result again.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
juozas
Posts: 15
Joined: Sun Mar 27, 2022 12:58 pm
Location: Lithuania
Contact:

Re: Irrlicht unit tests

Post by juozas »

Surely screenshot test fails for me too. Image:
Image
Сделано в СССР

OS: Ubuntu Linux 22.04 LTS 64 bit
Motherboard: ASUS P5G41-M LE
CPU: Intel Pentium Dual-Core E6300 @ 2.80GHz
RAM: DDR2 @ 2G
GPU: NVIDIA GeForce GT 710 @ 2G (Driver version: 470)
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

OK, so if OpenGL-shotsInShots0.png work that means we know now for certain it's related to the AntiAlias setting (only difference between those 2 tests).
Now I'd like to make sure it's happening only in screenshot in not in rendering.
Can you run the following (just copy the code over any of the examples) and send me a screenshot of how the rendered window looks like?

Code: Select all

#include <irrlicht.h>
#include <iostream>

using namespace irr;

#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif

// render some recognizable stuff
static void drawSomeStuff(video::IVideoDriver* driver)
{
	driver->draw2DRectangle(core::recti(5,5,155,115), 
				video::SColor(255, 100, 0, 0),
				video::SColor(255, 0, 200, 0),
				video::SColor(255, 0, 0, 200),
				video::SColor(255, 20, 150, 150));
	driver->draw2DLine(core::position2di(10,10), core::position2di(150,110), video::SColor(255,250,50,0));
	driver->draw2DLine(core::position2di(0,120), core::position2di(80,60), video::SColor(255,50,50,250));
}

int main()
{
	SIrrlichtCreationParameters params;
	params.AntiAlias = 2;
	params.WindowSize = core::dimension2du(160, 120);
	params.DriverType = video::EDT_OPENGL;

	IrrlichtDevice *device = createDeviceEx(params);
	if (!device)
		return 0; 

	video::IVideoDriver* driver = device->getVideoDriver();

	device->run();
	driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
	drawSomeStuff(driver);
	driver->endScene();
	video::IImage* img = driver->createScreenShot();

	if ( img )
	{
		std::cout << video::ColorFormatNames[driver->getColorFormat()];
		video::ITexture * screenshot = driver->addTexture(io::path("firstScreenshot"), img);
		while(device->run())
		{
			driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
			drawSomeStuff(driver);
			driver->draw2DImage(screenshot, core::recti(0, 30, 80, 90), core::recti(screenshot->getOriginalSize()), 0, 0, 0);
			driver->endScene();
		}
		img->drop();
	}

	device->closeDevice();
	device->drop();
    return 0;
}
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
juozas
Posts: 15
Joined: Sun Mar 27, 2022 12:58 pm
Location: Lithuania
Contact:

Re: Irrlicht unit tests

Post by juozas »

I copied HelloWorld example folder and made sure it writes exacutable as different name and replaced main.cpp with your code. After compiling and running I found that rendering might not be correct but I'm not sure if realy it is. The overayed image is stretched and wrongly positioned, compared to image on background, and appears different from what is shown in media/OpenGL-shotsInShots2.png file. Screenshot including window decorations:
Image
Сделано в СССР

OS: Ubuntu Linux 22.04 LTS 64 bit
Motherboard: ASUS P5G41-M LE
CPU: Intel Pentium Dual-Core E6300 @ 2.80GHz
RAM: DDR2 @ 2G
GPU: NVIDIA GeForce GT 710 @ 2G (Driver version: 470)
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Thank you. That's exactly what I hoped to see. It renders correct - but the screenshot is taken wrong. In the test-case above it was using 2 times screenshots, so both were wrong. In that new code only the small one is screenshot while the big background is real rendering.
Couldn't completely automate that test as I needed you to take a manual screenshot if the screenshot function itself messes up ;-)

Now to figure out _why_ it happens... my first guess something about it using the wrong screenbuffer for some reason (antialiasing might render twice the size and scale down to antialias which might somehow mess this up). But at least I know where to look now.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht unit tests

Post by CuteAlien »

Sorry, I could use another bit of information. It would be useful to know which color format your driver is running.
I've changed the example code above slights (adding iostream and a std::cout call). Could you please run the new one and tell me about the last line you'll get on console (something like "R8G8B8")?

edit: OK, not necessary. Seems it's always R8G8B8 in OpenGL and not used for anything besides getting a screenshot either.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply