PadWorld-Entertainment / worldofpadman

World of PADMAN game repository
https://worldofpadman.net
Other
39 stars 9 forks source link

OpenGL2 renderer breaks wopSky feature or vice versa in PadShip #246

Closed kai-li-wop closed 7 months ago

kai-li-wop commented 9 months ago

Seems that the OpenGL2 renderer don't know how to handle the wopSky feature in PadShip which leads to a HOM effect for the whole skybox. The wopSky feature is kind of a hack into the skybox which enables the possibility to "animate" it to a certain degree, here to simulate the waves of the sea. Therefore the skybox fluctuates, not the ship itself. i need to admit, this feature is not well documented and only used in PadShip, but I could find out the following:

The worldspawn takes this: "wopSky" "env/doornthree512<1 4 0 0 2 4"

According code, info comes from @mgerhardy: wopSky: shadername<a t a t a t a = angle (in degrees, float) t = timefactor (for stretching the sine curve, float)

The skybox shader looks like this:

textures/pad_pirate/doornthree
{
    qer_editorimage env/doornthree512_ft
    surfaceparm noimpact
    surfaceparm nolightmap
    q3map_lightimage textures/colors/hex_f67536ff
    q3map_sun 1.000000 0.635081 0.272618 280 45 45
    q3map_surfacelight 230
    {
        alphafunc LT128
        map *white
    }
}

So the skybox texture is directly set in the worldspawn which is really awkward, but what to say. We need to find a solution to make it comatible with the OpenGL2 renderer here.

kai-li-wop commented 7 months ago

@mgerhardy: ENTE reports the issue with the skybox in PadShip also with OpenGL1 renderer in WoP 1.6.2! So probably it is somehow hardware related too.

GeForce GT 730 Driver version 30.0.14.7444 Windows 10

zturtleman commented 7 months ago

In the OpenGL2 renderer the sky works with r_hdr 0 and r_ext_framebuffer_multisample 0. Otherwise (r_hdr 1 by default) the OpenGL2 renderer draws the world scene to a separate framebuffer object from the rest of the screen and then copies it (without blending) over the screen. (The separate framebuffer object for the world is never cleared so it has HOM.)

The OpenGL2 issue is fixed in ioquake3 in https://github.com/ioquake/ioq3/commit/f9547e4533d9195d4f08aebd4691429ea8005f81.

I don't know about the opengl1 renderer issue though.

kai-li-wop commented 7 months ago

This seems to be fixed as far as I could test. If this issue still appears with OpenGL1, we should take care about it in a new ticket. Thank you very much @zturtleman!

3aTmE commented 7 months ago

Just tested the fix, works like it should! The Sky now displays properly on wop_padship! 😄