TinyGL: FBO, Shaders and futur improvements
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Hi guys!

    So it's been a short while since I've last posted in here, so I figure it's time for a status update.

    First I'll start with the bad news: South Africa, where I live, has been hit really hard with problems with electricity generation. The last couple of months, it's been much worse than it ever has before. That means that most days I'm without electricity for about 4 hours, and on bad days - such as yesterday - I'm without electricity for 10 hours. On really bad days, when there's a breakdown of electricity infrastructure, there's just no electricity at all. That's unfortunately also happening at an increasing rate.

    I'm mentioning this because I know that I'm well beyond the self-imposed deadline for being done with this project, but I'm hoping that in light of the above, you can forgive me for not yet being done with this bounty.

    The good news: I'll be releasing another TinyGL update probably next weekend. Project 1: Implement the fixed-function OpenGL pipeline as shaders is very close to being done now, and I've spent the past couple of days fixing bugs resulting from implementing this, or bugs exposed by this feature finally being available. Besides that there's a mountain of bug fixes and other OpenGL compliance changes I've done since the last public release, so much so that I'm not looking forward to having to write the changelog :)

    I've also ported the most recent version of FreeGLUT to MorphOS, as a shared library named freeglut.library. GLUT is used for many smaller OpenGL examples and demos, including the ones I've written for this for bounty, and having a current version of FreeGLUT available means that compiling many third-party OpenGL examples will require a lot less effort than before, and they will work better as well. freeglut.library will be included in the TinyGL update I'll be releasing next.
    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.
  • »09.12.22 - 16:52
    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
    Who would have thought of South Africa being ravaged by power outages to that extent?? Not me, for sure! Is this 'business as usual' for the time of the year or are there specific reasons?

    And for the bounty - I think most people will understand. Also having freeglut ported is an additional bonus above the bounty we could not have expected. Looking forward do your update!
    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]
  • »09.12.22 - 17:54
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2051 from 2003/4/10
    From: France
    @bigfoot: if you have a G5 to compile, normal they switch off electricity ;-)

    I hope you desagrement will stop quickly...

    Thanks a lot for the bonus FreeGLUT!

    No probleme to waiting the next update and others, we know you give the best for this project.
  • »09.12.22 - 18:25
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Falcon_11
    Posts: 28 from 2004/2/7
    From: Slovakia
    Hi Mark.
    I see you don't have it easy. I think it doesn't matter to make a deadline, but very important and I think that not only for me is that the project will take place in the future.
    Keep my fingers crossed and I look forward to updating.
    DEAD
    MB :Pegasos-II
    CPU :G4/1GHz
    OS :MOS 2.2 reg, MOS 1.4.5, Ubuntu 8.04, MACOSX Panther on MOLk
    RAM :512MB-DDR266 Apacer
    GFX :ATI-Radeon 9200 128MB
    HDD :MAXTOR-160+80GB ATA133
    TV :Pinnacle Studio PCTV


    Powerbook G4 A1139, MOS3.18
  • »09.12.22 - 18:57
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 502 from 2013/5/29
    No problem Mark. Your work is fantastic. Hope things goes better.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »09.12.22 - 20:34
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    ernsteiswuerfel wrote:
    Who would have thought of South Africa being ravaged by power outages to that extent?? Not me, for sure! Is this 'business as usual' for the time of the year or are there specific reasons?


    The fact that we have loadshedding - which is our local term for rolling blackouts - is not new or unexpected. That's been going on for about 10 years now, what is new and unexpected is the extent of it. To quote Wikipedia: "By the end of September, 2022 had had more load shedding than all previous years combined." This year's loadshedding has been massive, relentless and unprecedented.
    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.
  • »10.12.22 - 05:26
    Profile Visit Website
  • IKE
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    IKE
    Posts: 146 from 2009/11/7
    From: Southern CA
    Appreciate the transparency...keep up the good work!
    IKE

    MacMini G4 1.5Ghz/PowerBook G4 1.67Ghz/PowerMac G5 2.0Ghz DP 7,2 Radeon 9650/256MB

    Join the conversation @ r/morphos
  • »10.12.22 - 05:41
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    MoerBoer
    Posts: 212 from 2019/10/15
    Living in the same country as BigFoot, I understand his pain.

    Thanks for the great work you are doing! Hope fully I might be see you again one day soon :-)
  • »10.12.22 - 08:32
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Thank you for the support, everyone! I appreciate it! :)

    The sixth public TinyGL beta release is now out.

    The main change in this update is the completion of project 1: Implement the fixed-function OpenGL pipeline as shaders. This change fixes a variety of rendering problems in various apps and games on hardware that currently supports shaders, meaning R300 and newer.

    Unfortunately there are a couple of known regressions in this update as well, but at this point they've reached a number and severity that is low enough that I didn't want to hold off this update any longer before getting it out to you all.

    The known problems all affect R300 and newer hardware and are:
    - Virtual Grand Prix 2 runs noticeably slower than before, and the rear view mirrors no longer render correctly.
    - FooBillard has rendering glitches it didn't have before. However this update also does fix some rendering issues that were previously broken, so this one is a mixed bag.
    - Descent Freespace is completely broken.
    - Reportedly there's an issue with the plasma blanker, but I'm not entirely sure of the details at this point.

    I will probably release one more TinyGL update this year that hopefully addresses all of the above, plus any other regressions that might be reported by you.
    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.
  • »16.12.22 - 13:28
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    I also want to say thank you to the usual suspects for testing the TinyGL changes for me! In particular beworld has supplied me with plenty of examples of things that didn't work for me to fix, as well as provided feedback on the changes I've made. jPV has also put in considerable effort doing regression testing for me this week, helping me put out a TinyGL update with much fewer regressions than it would have otherwise had. Also a thank you to cyfm for incessantly pestering me to fix regressions in Blender ;) And lastly a continued thank you to all of you for supporting this project!

    [ Edited by bigfoot 16.12.2022 - 13:36 ]
    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.
  • »16.12.22 - 13:35
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    MoerBoer
    Posts: 212 from 2019/10/15
    Hey bigfoot,

    I just installed the latest version on my FrankenMac, and now the Shader Test fails with :

    A required OpenGL extension, "GL_ARB_shader_objects", is not supported

    Clicking on GraphicsBoards, the driver says:

    Driver: ATIRadeon 52.40 (5.8.2022)

    ^ The date looks "old" or is that correct?

    Device: RV360 [Radeon 9600/X1050 Series] (0x4152)

    p.s. Previous version of the beta didn't show this behavior.

    Thanks
  • »16.12.22 - 14:07
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    MoerBoer wrote:
    Hey bigfoot,

    I just installed the latest version on my FrankenMac, and now the Shader Test fails with :

    A required OpenGL extension, "GL_ARB_shader_objects", is not supported


    Whoops. Well, it seems like this problem is in Shader Test itself, rather than the TinyGL update itself. If you try to run Shader Test from the previous update (with the current update installed), then I guess it works correctly?

    Quote:

    MoerBoer wrote:
    Clicking on GraphicsBoards, the driver says:

    Driver: ATIRadeon 52.40 (5.8.2022)

    ^ The date looks "old" or is that correct?


    That is correct! The version shown there is that of the '2D' part of the driver.
    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.
  • »16.12.22 - 14:17
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    MoerBoer
    Posts: 212 from 2019/10/15
    Quote:

    bigfoot wrote:
    Quote:

    MoerBoer wrote:
    Hey bigfoot,

    I just installed the latest version on my FrankenMac, and now the Shader Test fails with :

    A required OpenGL extension, "GL_ARB_shader_objects", is not supported


    Whoops. Well, it seems like this problem is in Shader Test itself, rather than the TinyGL update itself. If you try to run Shader Test from the previous update (with the current update installed), then I guess it works correctly?

    Quote:

    MoerBoer wrote:
    Clicking on GraphicsBoards, the driver says:

    Driver: ATIRadeon 52.40 (5.8.2022)

    ^ The date looks "old" or is that correct?


    That is correct! The version shown there is that of the '2D' part of the driver.



    Confirmed, older Shader Test works :-)
  • »16.12.22 - 14:20
    Profile
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    MoerBoer wrote:
    Confirmed, older Shader Test works :-)



    I've updated the TinyGL update archive to include a working version of Shader Test now :D So anyone who downloads the update from now on should have that working.
    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.
  • »16.12.22 - 14:31
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2051 from 2003/4/10
    From: France
    Quote:

    bigfoot a écrit :
    I've updated the TinyGL update archive to include a working version of Shader Test now :D So anyone who downloads the update from now on should have that working.



    Glitchs fixed on Shader test here and dark colors fixed too on Neverput and neverball!

    Thanks a lot bigfoot for this new update!

    Continue testing...
  • »16.12.22 - 15:53
    Profile Visit Website
  • 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: 592 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: 592 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: 592 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: 592 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