TinyGL: FBO, Shaders and futur improvements
  • Butterfly
    Butterfly
    Posts: 91 from 2020/12/24
    There's some kind of issue with new includes (can't recompile D3):

    For example:

    Code:
    error: ‘PFNGLBINDBUFFERARBPROC’ does not name a type; did you mean ‘PFNGLBINDBUFFERPROC’?


    And a good streamed amount of errors like that.

    Probably some
    Code:
    external "C" { 

    is missing in some place ?

    Opengl + SDL2 C programs like sm64x work ok.
  • »17.12.22 - 12:11
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    @bigfoot My findings on the new update so far (G5 11,2. Radeon X1300/RV516):

    Shardertest works, moving around the Shadertest window works but as soon as I resize the Shardertest window rendering breaks inside with various artefacts. Also the mouse pointer gets kinda jerky and the G5 lags (though not 100% CPU load). If I manage to get the mouse pointer over the close button of the Shadertest window and close it the machine is back to normal. Also Shadertest can be restarted with correct rendering in the beginning.

    The colour issue in Virtual GP 2 i described in #204 is still there.
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »17.12.22 - 13:25
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 590 from 2010/2/10
    From: FRANCE
    @cowcat, i try to rebuild SDL2 here and same error. I try to understand... i think problem seem in SDL opengl headers.

    Problem seem here : https://github.com/BeWorld2018/SDL/blob/5e9a960fbf6f34465023b97194c4122e2eb3dde8/include/SDL_opengl.h#L40

    PS: i think i find something :

    https://github.com/BeWorld2018/SDL/commit/e2d8f21981c027cdd6c1f231b28bc10ed4cd5ffc

    Now i can build SDL2 again but SDL2 SDK from old version is broken i think

    [ Edité par beworld 17.12.2022 - 14:25 ]

    [ Edité par beworld 17.12.2022 - 14:25 ]
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »17.12.22 - 14:23
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 590 from 2010/2/10
    From: FRANCE
    @cowcat Other good new.... i will build your SM64 port with OpenGL 2 support (with shaders) and result... working :-)
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »17.12.22 - 14:27
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 91 from 2020/12/24
    @beworld

    Well, I thought that the issue was more towards SDL2 includes when C++ was in use, but not quite sure. Time to make another SDL2 lib ?

    I saw your fork. Whats the visual difference with old sm64 version ?

    If your SDL2 starts to allow GL2 support I see a good amount of upgrades, like scummvm (but only for r300+ users).
  • »17.12.22 - 15:02
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 590 from 2010/2/10
    From: FRANCE
    @cowcat...

    SM64 visual difference.. i dont see any difference lol but shaders working..., (i can publish this bin with sdl2.library beta to test)

    Make another SDL2 lib width new tinygl support... not sur, because :
    1. new TinyGL.. is beta... and not finished
    2. SDL2 can use shaders with opengl renderer but same as SM64, i dont see any difference (speed.. benefits etc...), i think FBOs support when available is more important with SDL2 (SDL_RENDERER_TARGETTEXTURE support for example)
    3. I could only compile PrBoomPlus with shaders support, SM64...
    ScummVM: i need to retry because it's more complex and not working with my last test.
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »17.12.22 - 15:56
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 91 from 2020/12/24
    @beworld

    - SM64 - Yep, should be no visual difference with shaders but who knows :)

    I think changing SDL_opengl.h (2.26.x) include with your finding is enough now. At least I can recompile my shit :)
  • »17.12.22 - 17:38
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 590 from 2010/2/10
    From: FRANCE
    ok,
    I'm trying to see with bigfoot if it's good for him or if he modifies his SDK or I don't really know what :-)
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »17.12.22 - 19:06
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    Cowcat wrote:
    There's some kind of issue with new includes (can't recompile D3):

    For example:

    Code:
    error: ‘PFNGLBINDBUFFERARBPROC’ does not name a type; did you mean ‘PFNGLBINDBUFFERPROC’?


    And a good streamed amount of errors like that.

    Probably some
    Code:
    external "C" { 

    is missing in some place ?

    Opengl + SDL2 C programs like sm64x work ok.


    No, it seems like that Dhewm3 depends on the OpenGL includes defining typedefs for function pointers to OpenGL functions, which MorphOS' current OpenGL includes don't have. I'll add them in the next update.

    The reason it worked before was that MorphOS' OpenGL includes also didn't create the preprocessor definition for example named "GL_ARB_vertex_buffer_object". With this preprocessor definition missing, the SDL includes would inject its own typedefs for the function pointers. Now that MorphOS' includes have these preprocessor definitions, the typedefs are missing, and hence Dhewm3 doesn't build.

    The easy fix for now is to edit gg:os-include/tgl/glstd.h and remove the block of #define statements from line 8 to line 93.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »18.12.22 - 08:51
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    ernsteiswuerfel wrote:
    @bigfoot My findings on the new update so far (G5 11,2. Radeon X1300/RV516):

    Shardertest works, moving around the Shadertest window works but as soon as I resize the Shardertest window rendering breaks inside with various artefacts.


    Yep, there is indeed a problem with resizing shader-using applications in window mode. I'll get that fixed :)

    Quote:

    ernsteiswuerfel wrote:
    Also the mouse pointer gets kinda jerky and the G5 lags (though not 100% CPU load). If I manage to get the mouse pointer over the close button of the Shadertest window and close it the machine is back to normal.


    That's probably because of the same issue as discussed here. There'll be a fix for it, but probably not right away, unfortunately.

    Quote:

    The colour issue in Virtual GP 2 i described in #204 is still there.


    I'll have to have a look at Virtual GP 2 soon to find out why the rear view mirrors broke, so hopefully I can find out what that texture problem is at the same time.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »18.12.22 - 08:55
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    beworld wrote:
    I'm trying to see with bigfoot if it's good for him or if he modifies his SDK or I don't really know what :-)


    I'll fix the include problems on my end for the next update :)
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »18.12.22 - 08:56
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2026 from 2003/2/24
    From: po-RNO
    Quote:

    ernsteiswuerfel wrote:
    I noticed another thing. On some courses (but not all) there are wrongly coloured (blue, red, yellow, etc.) lawn textures. E.g. Immola is all good, but Melbourne shows several sections of the track wrongly coloured. Hopefully attaching screenshot works...

    Machine is a G5 11,2 + ATI X1300 (r500). Screenshot: 9b112a2cd28f7b0aa6bd16433731f449


    I'm not sure if it's wrongly colored, or do you get different kind of colors on some older MorphOS/TinyGL version?

    For me it just looks that Melbourne has certain areas of blue/red/yellow gravel, which probably was like that on the real life F1 circuit too. In your screenshot the green/yellowish area is lawn, but the blue area with stripes is plowed gravel.

    I think it's looked like this always on VGP2... in original textures it's more colorful, but it's a bit lighter with the 3rd party HD textures.

    [ Edited by jPV 18.12.2022 - 10:56 ]
  • »18.12.22 - 09:29
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 91 from 2020/12/24
    A quick one question: Does Project1 fully applied to R200 driver ?

    Seems that some of the upgraded functions still not working here.
  • »18.12.22 - 11:01
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Quote:

    jPV schrieb:
    Here's a photo of 2005 Australian GP and you can see blue ground there: link

    And VGPHD texture set title picture shows the blue gravel too: link

    [ Edited by jPV 18.12.2022 - 10:54 ]

    You are right! So this probably isn't a bug after all. :-D

    I only didn't play VGP2 that often as it had annoying graphical glitches before the OpenGL update. So I probably didn't know the courses that well.
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »18.12.22 - 12:17
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    Cowcat wrote:
    A quick one question: Does Project1 fully applied to R200 driver ?

    Seems that some of the upgraded functions still not working here.


    Not yet! The fixed-function-pipeline-as-shaders functionality requires shader support, which I've not added to the R200 driver yet. However, it won't be too long till I add this, and it fortunately won't be too much work, as the vertex shader hardware in R200 is a predecessor to the vertex shader hardware in R300, so I can reuse much of the R300 code there.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »19.12.22 - 17:13
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 91 from 2020/12/24
    Quote:

    The fixed-function-pipeline-as-shaders functionality requires shader support, which I've not added to the R200 driver yet.


    Alright. So theoretically for R300+, Doom3 should start to look better without "r_usedrawinteraction0" enabled and with default r_renderer ARB. Probably testing "r_useTripleTextureARB" bumpmapping support even better (but this old hack is not totally correct).

    Don't know if shaders work for the latest D3 binary as is not compiled with github SDL2-tinyGL53 (and no offical library exists).

    Still bugged cubemap support in D3 for R200. Don't know if it was already correct for R300+ or it is fixed now in the new driver (same for g_doublevision visuals, etc).

    What tglEnableNewExtensions(0) does besides "new extensions" ? Is it needed for new pipeline-as-shaders, shaders support in general or for some of the upgraded/fixed functions ?
  • »19.12.22 - 18:24
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    Cowcat wrote:
    Still bugged cubemap support in D3 for R200. Don't know if it was already correct for R300+ or it is fixed now in the new driver (same for g_doublevision visuals, etc).


    Please remind me again, where in Doom 3 can I see this cubemap problem?

    Quote:

    What tglEnableNewExtensions(0) does besides "new extensions" ? Is it needed for new pipeline-as-shaders, shaders support in general or for some of the upgraded/fixed functions ?


    It does two things:
    1) It changes which extensions are advertised via glGetString(GL_EXTENSIONS). The affected extensions still exist, and are still available, even when tglEnableNewExtensions() is not called. They're just not advertised.
    2) It toggles a bug fix for glWindowPos#?() on. Some already existing software relies on the non-standard functionality present in previous TinyGL versions, so in order to retain binary compatibility, this particular bug fix is only available after calling tglEnableNewExtensions().

    And that's all. Nothing else. It doesn't affect the fixed-function-as-shaders functionality or anything else not listed above.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »20.12.22 - 13:02
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    koszer
    Posts: 1246 from 2004/2/8
    From: Poland
    Quote:

    bigfoot wrote:
    Please remind me again, where in Doom 3 can I see this cubemap problem?


    Cowcat was probably referring to this post:

    Seems like now D3 works again for R200 but it shows that cubemap fails doing his stuff there: A weird texture in pink/white for skymaps. Same for soldier googles or ship window in first stage game.
  • »20.12.22 - 13:35
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2042 from 2003/4/10
    From: France
    I have found a version of Doom3 ported by Cowcat work fine on my G5 + Radeon 1950 with last TinyGL (mouse is supported and no bug in the menu).

    Maybe it could help...

    MD5 is c860cbcc74722a592b66eebd33a93485

    [ Edité par Papiosaur 20.12.2022 - 17:30 ]
  • »20.12.22 - 17:17
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    I've released a small bug fix update, which you can download here.

    It fixes a couple of small issues, including the rear view mirrors in Virtual GP 2, FooBillard, the plasma blanker and crashes when resizing window mode programs that have a shader active.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »21.12.22 - 09:40
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Thanks bigfoot, that was fast! Out of interest - what was the cause of the rear view mirrors glitch in Virtual GP 2?
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »21.12.22 - 11:19
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    ernsteiswuerfel wrote:
    Thanks bigfoot, that was fast! Out of interest - what was the cause of the rear view mirrors glitch in Virtual GP 2?


    It was this entry in the changelog:
    Quote:

    - Fixed-function-as-shaders: Fixed alpha channel output from the vertex shader when GL_LIGHTING is enabled.


    To elaborate, when GL_LIGHTING is enabled, the alpha channel of the primary colour output of the lighting operation is taken from the alpha channel of the application-specified diffuse colour of material. I had initially overlooked this part, and thus my lighting calculations produced the wrong alpha value.

    And speculating from here on, I'm guessing that Virtual GP 2 mixes a rear view mirror colour together with the rendered scene based on the vertex colour's alpha channel, as generated by the OpenGL lighting computation, and with that alpha value being wrong, the blending factor was also wrong, and thus it probably only rendered the static rear view mirror colour.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »21.12.22 - 11:35
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ernsteiswuerfel
    Posts: 545 from 2015/6/18
    From: Funeralopolis
    Ah, interesting!

    Also I can confirm the fixes just work fine on my G5/X1300. Thanks!
    Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
  • »21.12.22 - 11:43
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    Cowcat wrote:
    Still bugged cubemap support in D3 for R200. Don't know if it was already correct for R300+ or it is fixed now in the new driver (same for g_doublevision visuals, etc).


    I just found a problem (in tinygl.library, so affecting every driver) that caused mipmapped cube maps to fail. Fixing that at least makes the ARB2 renderer in Doom 3 look a lot better, although I think there are still some issues that need fixing.

    I'll try to get another TinyGL update with this fix included out as soon as possible.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »26.12.22 - 10:56
    Profile Visit Website