Page 1 of 3

Blue background and no 3D graphs when using new 3D engine

PostPosted: Sun Sep 18, 2022 11:56 am
by fc7
I'm new to Supermodel and I'm enjoying it a lot, so let me start by saying thanks for the great job done.

I'm using Supermodel on Linux exclusively on Debian 11 and Ubuntu 20.04 both running the latest updates for kernel and mesa.
Using an NVidia GTX 1660 Super with the proprietary NVidia driver Supermodel is running without any issues, using the new 3D engine.
But unfortunately when using the integrated Intel graphics (tested on Intel HD 630 -i7-7700- and Iris Xe -i7-1185G7-) or a Radeon RX6600XT card I get a solid background (colors change, most of the times is blue) as you can see in the attached images and no 3D graphs at all.

If I switch to the legacy 3D engine everything works perfectly.
I thought while playing on the Intel graphics card that it was a problem with them being under-powered as mentioned in https://www.supermodel3.com/FAQ.html#No3D but then I was a bit surprised about having the same issue on a relative new Radeon card like the RX6600XT.
I searched the forum and the Internet but I couldn't find anything so far.

Do you have any ideas on why this is happening?

Thanks in advance.

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Mon Sep 19, 2022 2:45 pm
by Bart
Which version of Supermodel and can you try to check out a revision from a couple months ago?

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Mon Sep 19, 2022 11:25 pm
by fc7
Sorry I missed to include the screenshots (pictures taken with my phone) in my original post so I just added them.

I'm building from source, so Supermodel version I'm using is current master (0eef09b) from Github.
I can try to build any revision or commit you point me to. Just let me know.

Thanks.

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 5:20 am
by Ian
does it give any shader errors?
check for any log file that is made

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 7:09 am
by fc7
I get a shader error indeed in the output of Supermodel that I didn't noticed before because I was launching Supermodel from a script (sorry for that):

Code: Select all
Supermodel: A Sega Model 3 Arcade Emulator (Version 0.3a-WIP)
Copyright 2003-2022 by The Supermodel Team
    Title:          Daytona USA 2 - Battle on the Edge (Japan, Revision A)
    ROM Set:        daytona2
    Developer:      Sega
    Year:           1998
    Stepping:       2.1
    Extra Hardware: Digital Sound Board (Type DSB2), Drive Board, Net Board, Security Board

0:110(14): error: no function with name 'texture2DLod'
0:111(14): error: no function with name 'texture2DLod'
0:112(14): error: no function with name 'texture2DLod'
0:113(14): error: no function with name 'texture2DLod'
0:116(5): warning: `p0q0' used uninitialized
0:116(14): warning: `p1q0' used uninitialized
0:116(35): warning: `p0q0' used uninitialized
0:117(5): warning: `p0q0' used uninitialized
0:117(14): warning: `p0q1' used uninitialized
0:117(35): warning: `p0q0' used uninitialized
0:119(14): warning: `p0q0' used uninitialized
0:120(14): warning: `p1q1' used uninitialized

error: linking with uncompiled/unspecialized shader


This is on a machine with Intel integrated graphics (HD 630).
I attached Supermodel log (info and debug -RAR compressed as it was 15MB-) and console output.

Thanks

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 12:02 pm
by Ian
Yeah it's the drivers. They are missing core features of opengl 2.1
Maybe someone can file bug reports and get this fixed? It should be fixed.

Meanwhile you can try -quad-rendering as a command line option

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 1:09 pm
by Bart
Question: could texture2DLod be substituted with something else like texture2D that samples a different way but still looks acceptable as a fallback? I'm thinking that maybe a workaround here is to check for shader compilation failure, see if "texture2DLod" is present in the error message, and perform a patch to a fallback sampling method and try again, while also printing a warning.

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 1:12 pm
by Ian
Maybe just texturelod but that technically shouldn't exist in 2.1 shaders

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 1:24 pm
by fc7
Just tested with -quad-rendering option on a machine with Intel Iris XE and now 3D graphs work without using the legacy 3D engine.
I only did a quick test with Daytona USA 2, but I noticed slowdowns on some parts of the track that were not present using the legacy 3D engine.

Should I try on the other machines with the Intel HD 630 and the RX6600XT or it would not make any difference nor add any value to the investigation?

Re: Blue background and no 3D graphs when using new 3D engin

PostPosted: Tue Sep 20, 2022 1:41 pm
by fc7
Ian wrote:Maybe just texturelod but that technically shouldn't exist in 2.1 shaders


I can certainly try this out. I found while doing some research that it seems that mesa drivers on Linux doesn't support texture2DLod or it may need some extension or different profile.
I can patch the code and replace that with textureLod (only found 4 occurences in the code) compile and test. It should only take me a few minutes.