Unvanquished / Unvanquished

An FPS/RTS hybrid game powered by the Daemon engine (a combination of ioq3 and XreaL)
https://unvanquished.net
Other
976 stars 157 forks source link

Unvanquished 0.53.0 release thread #1789

Closed illwieckz closed 2 years ago

illwieckz commented 2 years ago

This is a revolution! (sorry)

This thread is about releasing 0.53.

Remaining PRs to merge:

Please list in comments if you see something being required, I'll update this post if needed.

Release process:

Post-release things:

We will say we are now 10 years old. The 10 years retrospective will be published after that.

slipher commented 2 years ago

I have some official Mac hardware now, so I could produce the Mac build (as well as Windows or Linux if desired).

There are still some issues with navmesh auto-generation, so we'll have to push that back to the next release.

1 bug I want to fix: the RmlUi crash on vid_restart.

illwieckz commented 2 years ago

I have some official Mac hardware now, so I could produce the Mac build (as well as Windows or Linux if desired).

Great! Out of curiosity, do you have access to M1 hardware? I know we are still limited by NaCl on x86_64 but it would be good to know for the future. I'm also interested in the kind of GPU you have (my mac has x86_64 CPU with Nvidia GPU).

There are still some issues with navmesh auto-generation, so we'll have to push that back to the next release.

Damn!

1 bug I want to fix: the RmlUi crash on vid_restart.

Ah yes ! I added it to the list.

slipher commented 2 years ago

One other thing I want to do is rebuild the external_deps packages. IIRC there is a problem with one of them which can make Mac unusable, so they should be rebuilt before the engine.

ghost commented 2 years ago

I checked those boxes:

ghost commented 2 years ago

 anything left in https://github.com/Unvanquished/Unvanquished/milestone/24

Hmm.... so, to close this issue, we need to close this issue first. This might be hard to do!

illwieckz commented 2 years ago

We can also decide to move some things from that milestone to the next one.

necessarily-equal commented 2 years ago

We can also decide to move some things from that milestone to the next one.

Especially if we can release often :smiley:

ghost commented 2 years ago

We can also decide to move some things from that milestone to the next one.

This is how OpenMW managed for a long time I believe (maybe still now): accepted issues were put to their next release milestone, except for long-term stuff (for us, could be a 3rd faction for example, or a flying alien). Then, when enough stuff were done, moving what remained to do to next milestone and actually doing a release. Not saying we should do the same, but it certainly worked well for them, to not insist at fixing everything for next release.

necessarily-equal commented 2 years ago

I've got a 0.53.0/sync server at https://play.unvanquished.net/unvanquished.net:27990 (/connect unvanquished.net:27990) that gets updated automatically.

It uses

The means it may be missing whatever is in *.dpkdir master if any.


I've also got a test flatpak here https://github.com/flathub/net.unvanquished.Unvanquished/pull/6 that you can pull locally and use to connect to this server.

necessarily-equal commented 2 years ago

https://github.com/DaemonEngine/Daemon/pull/659 is needed as well, I've added it in the first post

illwieckz commented 2 years ago

So I did a prebuild:

It used both:

Known issues:

This is not an issue:

For now I'm looking for people to try to run this on Windows, macOS and your favorite Linux distribution.

illwieckz commented 2 years ago

Also: some maps were rebuilt while having the same version and then same package name as before, that's because they don't have change themselves in repository but daemonmap was modified so I prefer to rebuild the navmeshes. The version will be fixed at release time when we'll bump the version numbers.

DolceTriade commented 2 years ago

Doesn't appear to run on OSX on my M1 macbook.

When clicking on the .app bundle, it says it can't find the Unvanquished basepak.

When running unvanquished.sh directly, we get:

❯ ./unvanquished.sh
Unvanquished 0.52.1 Mac OS X x86_64 Jul 28 2022
cmdline: -pakpath /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg
[FS] Lib path: /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/Unvanquished.app/Contents/MacOS
[FS] Home path: /Users/username/Library/Application Support/Unvanquished
[FS] Pak search path: /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg
[FS] Pak search path: /Users/username/Library/Application Support/Unvanquished/pkg
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk'...
Warn: [FS] Invalid deleted file list specification on line 3 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 4 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 5 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 6 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 7 in /Users/username/Downloads/unvanquished_0.52.1-20220727-23340
Warn: [FS] Invalid deleted file list specification on line 8 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 9 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk/DELETED
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.0.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/tex-common_2.2.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-players_0.52.1-20211223-105529-f497de5.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-players_0.52.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-legacy_0.52.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.1-20220725-232828-b40b85b.dpk'...
Warn: [FS] Invalid deleted file list specification on line 3 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.1-20220725-232828-b40b85b.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 4 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.1-20220725-232828-b40b85b.dpk/DELETED
Warn: [FS] Invalid deleted file list specification on line 5 in /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.1-20220725-232828-b40b85b.dpk/DELETED [further messages like this will be suppressed]
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.1.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-weapons_0.52.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-buildables_0.52.1-20220529-121927-db766e4.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-buildables_0.52.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-voices_0.52.dpk'...
[FS] Loading pak '/Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/res-soundtrack_0.52.dpk'...
execing 'default.cfg'
execing 'presets/input/wasd.cfg'
Warn: Couldn't read conhistory: No such file or directory
----- Client Initialization -----
Loading RSA keys from pubkey
Daemon RSA public-key file not found, regenerating

Regenerating RSA keypair; writing to pubkey

Daemon RSA keys generated
----- Client Initialization Complete -----
Hostname: hostname

Opening IP6 socket: [::]:*
Opening IP socket: 0.0.0.0:*
--- Common Initialization Complete ---
Calling GetRefAPI…
SDL_Init( SDL_INIT_VIDEO )...
Using SDL version 2.0.12
SDL using driver "cocoa"
Initializing OpenGL display
Using GLEW version 2.2.0
Display aspect: 1.547
Display resolution: 1728x1117
...setting mode -2: 1728×1117
Using preferred context - 24-bit OpenGL 3.2 core
OpenGL Renderer: Apple M1 Pro
Warn: Provided OpenGL 4.1 is not the same as requested 3.2 version
Using GL3 Renderer in OpenGL 3.x mode...
Available modes: '1168x755 1312x848 1496x967 1728x1117 2056x1329 2336x1510 2624x1696 2992x1934 3456x2234 960x600 1168x730 1280x800 1312x820 1496x935 1728x1080 1920x1200 2056x1285 2336x1460 2560x1600 2624x1640 2992x1870 3456x2160 '
Detected graphics driver class 'OpenGL 3+'
Detected graphics hardware class 'generic'
Initializing OpenGL extensions
...GL_ARB_debug_output not found.
...found shading language version 410
...using GL_ARB_half_float_pixel
...using GL_ARB_texture_float
...using GL_EXT_gpu_shader4
...using GL_EXT_texture_integer
...using GL_ARB_texture_rg
...using GL_ARB_texture_gather
...using GL_EXT_texture_compression_s3tc
...using GL_ARB_texture_compression_rgtc
...using GL_EXT_texture_filter_anisotropic
...using GL_ARB_half_float_vertex
...using GL_ARB_framebuffer_object
...no program binary formats
...GL_ARB_get_program_binary not found.
...GL_ARB_buffer_storage not found.
...using GL_ARB_uniform_buffer_object
...using GL_ARB_map_buffer_range
...using GL_ARB_sync
Warn: Couldn't find image file 'flareShader'
Warn: Couldn't find image file 'sun'
GL_VENDOR: Apple
GL_RENDERER: Apple M1 Pro
GL_VERSION: 4.1 Metal - 76.3
GL_MAX_TEXTURE_SIZE: 16384
GL_SHADING_LANGUAGE_VERSION: 4.10
GL_MAX_VERTEX_UNIFORM_COMPONENTS 4096
GL_MAX_VERTEX_ATTRIBS 16
Occlusion query bits: 32
GL_MAX_DRAW_BUFFERS: 8
GL_TEXTURE_MAX_ANISOTROPY_EXT: 16.000000
GL_MAX_RENDERBUFFER_SIZE: 16384
GL_MAX_COLOR_ATTACHMENTS: 8
PIXELFORMAT: color(24-bits)
MODE: -2, 1728 x 1117 fullscreen hz: N/A
Using OpenGL version 4.1, requested: 3.2
Using OpenGL 3.x context.
Using an OpenGL core profile.
OpenGL 3.x context is forward compatible.
Using OpenGL extensions: GL_ARB_half_float_pixel GL_ARB_texture_float GL_EXT_gpu_shader4 GL_EXT_texture_integer GL_ARB_texture_rg GL_ARB_texture_gather GL_EXT_texture_compression_s3tc GL_ARB_texture_compression_rgtc GL_EXT_texture_filter_anisotropic GL_ARB_half_float_vertex GL_ARB_framebuffer_object GL_ARB_uniform_buffer_object GL_ARB_map_buffer_range GL_ARB_sync
Missing OpenGL extensions: GL_ARB_debug_output GL_ARB_get_program_binary GL_ARB_buffer_storage
Using S3TC (DXTC) texture compression.
Using GPU vertex skinning with max 233 bones in
Extracting VM module cgame-x86_64.nexe from /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/pkg/unvanquished_0.52.1-20220725-232220-cc10336.dpk...

Loading VM module cgame-x86_64.nexe...
Using loader args:  /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/Unvanquished.app/Contents/MacOS/nacl_loader -v -B /Users/username/Downloads/unvanquished_0.52.1-20220727-233400-de2fca5/Unvanquished.app/Contents/MacOS/irt_core-x86_64.nexe -e -i 100:30 -- /Users/username/Library/Application Support/Unvanquished/cgame-x86_64.nexe 100
Loaded VM module in 391 msec
Loading Lua interpreter
Loaded font face unifont (from fonts/unifont.ttf).
Loaded font face Roboto (from fonts/Roboto-Bold.ttf).
Loaded font face Roboto (from fonts/Roboto-BoldItalic.ttf).
Loaded font face Roboto (from fonts/Roboto-Italic.ttf).
Loaded font face Roboto (from fonts/Roboto-Regular.ttf).
Loaded font face FontAwesome (from fonts/fontawesome-webfont.ttf).
Loaded font face DejaVu Sans (from fonts/DejaVuSansCondensed.ttf).
Loaded font face Material Icons (from fonts/MaterialIcons-Regular.ttf).
Warn: Source for shader program generic:
   0: #version 410 core
   1: #define HAVE_ARB_texture_gather 1
   2: #define HAVE_EXT_gpu_shader4 1
   3: #define HAVE_ARB_gpu_shader5 1
   4: #define HAVE_ARB_uniform_buffer_object 1
   5: #define IN(mode) mode in
   6: #define DECLARE_OUTPUT(type) out type outputColor;
   7: #define textureCube texture
   8: #define texture2D texture
   9: #define texture2DProj textureProj
  10: #define texture3D texture
  11: #ifndef r_dynamicLight
  12: #define r_dynamicLight 2
  13: #endif
  14: #ifndef r_precomputedLighting
  15: #define r_precomputedLighting 1
  16: #endif
  17: #ifndef r_vertexSkinning
  18: #define r_vertexSkinning 1
  19: #endif
  20: const int MAX_GLSL_BONES = 233;
  21: const float r_wrapAroundLighting = 6.9  35: #define r_glowMapping 1
  36: #endif
  37: #ifndef TEXTURE_RG
  38: #define TEXTURE_RG 1
  39: #endif
  40: #ifndef UNIFORM_BUFFER_OBJECT
  41: #define UNIFORM_BUFFER_OBJECT 1
  42: #endif
  43: #ifndef TEXTURE_INTEGER
  44: #define TEXTURE_INTEGER 1
  45: #endif
  46: #ifndef r_AmbientScale
  47: #define r_AmbientScale 1.00000000e+00
  48: #endif
  49: #ifndef r_SpecularScale
  50: #define r_SpecularScale 1.00000000e+00
  51: #endif
  52: #ifndef r_zNear
  53: #define r_zNear 3.00000000e+00
  54: #endif
  55: #ifndef M_PI
  56: #define M_PI 3.14159274e+00
  57: #endif
  58: #ifndef MAX_SHADOWMAPS
  59: #define MAX_SHADOWMAPS 5
  60: #endif
  61: #ifndef MAX_REF_LIGHTS
  62: #define MAX_REF_LIGHTS 1024
  63: #endif
  64: #ifndef T  53:
  54: #if defined(USE_DEPTH_FADE) || defined(USE_VERTEX_SPRITE)
  55:   float depth = texture2D(u_DepthMap, gl_FragCoord.xy / r_FBufSize).x;
  56:   float fadeDepth = 0.5 * var_FadeDepth.x / var_FadeDepth.y + 0.5;
  57:   color.a *= smoothstep(gl_FragCoord.z, fadeDepth, depth);
  58: #endif
  59:
  60:   color *= var_Color;
  61:   outputColor = color;
  62:
  63: #if defined(GENERIC_2D)
  64:   gl_FragDepth = 0;
  65: #endif
  66: }

Warn: Compile log:
ERROR: 0:38: Regular non-array variable 'gl_FragDepth' may not be redeclared

Warn: Unhandled exception (15ShaderException): Couldn't compile fragment shader: generic
slipher commented 2 years ago

The ERROR: 0:38: Regular non-array variable 'gl_FragDepth' may not be redeclared was introduced by the RmlUi transform changes.

It runs on Windows. A couple of HUD comments:

DolceTriade commented 2 years ago

The weird thing is that we declare the variable here: https://github.com/DaemonEngine/Daemon/blob/0.53.0/sync/src/engine/renderer/glsl_source/generic_fp.glsl#L39

But it doesn't show up in the debug output...

slipher commented 2 years ago

The shader text dump looks faulty -- check this part:

64: #ifndef T  53:

Anyway I have a fix https://github.com/DaemonEngine/Daemon/pull/660.

ghost commented 2 years ago

My remarks:

I have not seen any other problem, running on debian stable + X11 + i3, but this was a very quick test

slipher commented 2 years ago

https://github.com/UnvanquishedAssets/unvanquished_src.dpkdir/pull/139 fixing my alien BP issue and gets rid of the sprinting color change. The icon change is fine.

Maybe we should just delete the translation files for now. Having 5% of string translated just looks worse than having nothing translated.

@illwieckz Do you mean the label column in the server browser that's usually empty? What is that column for?

ghost commented 2 years ago

Having 5% of string translated just looks worse than having nothing translated.

+1

But I'm not sure actually deleting the .po files is a good idea, since it could reduce work to get those back. Also, is the .pot file actually up-to-date? It seems unlikely, since it was last touched in 2014.

ghost commented 2 years ago

I don't think the translation questions should be solved for 0.53, except for the "ban them from the builds" thing. For more discussion on this topic (but please, after 0.53) I've opened #1986

illwieckz commented 2 years ago

When clicking on the .app bundle, it says it can't find the Unvanquished basepak.

@DolceTriade Yes, this is because of Application Translocation, macOS now prevents a .app to load its assets from outside the .app. To workaround that we would have to store the pkg/ folder within the .app, meaning we would have to do a dedicated macOS zip and not an unizip anymore.

That's one of the reasons why for release builds (that's obviously not the case here since we're testing what to be released) we recommend users to use the updater because the updater takes care of everything.

DolceTriade commented 2 years ago

Pounce bar, rant charge bar broken, luci charge bar, granger/ckit force decon bars broken

https://github.com/Unvanquished/Unvanquished/issues/1997

DolceTriade commented 2 years ago
Warn: CM_AddFacetBevels... invalid bevel
Warn: CM_AddFacetBevels... invalid bevel
Warn: CM_AddFacetBevels... invalid bevel
Warn: CM_AddFacetBevels... invalid bevel
Warn: Source for shader program lightMapping:
   0: #version 410 core
   1: #define HAVE_ARB_texture_gather 1
   2: #define HAVE_EXT_gpu_shader4 1
   3: #define HAVE_ARB_gpu_shader5 1
   4: #define HAVE_ARB_uniform_buffer_object 1
   5: #define IN(mode) mode in
   6: #define DECLARE_OUTPUT(type) out type outputColor;
   7: #define textureCube texture
   8: #define texture2D texture
   9: #define texture2DProj textureProj
  10: #define texture3D texture
  11: #ifndef r_dynamicLight
  12: #define r_dynamicLight 2
  13: #endif
  14: #ifndef r_precomputedLighting
  15: #define r_precomputedLighting 1
  16: #endif
  17: #ifndef r_vertexSkinning
  18: #define r_vertexSkinning 1
  19: #endif
  20: const int MAX_GLSL_BONES = 233;
  21: const float r_wrapAroundLighting   24: #endif
  25: #ifndef r_normalMapping
  26: #define r_normalMapping 1
  27: #endif
  28: #ifndef r_specularMapping
  29: #define r_specularMapping 1
  30: #endif
  31: #ifndef r_physicalMapping
  32: #define r_physicalMapping 1
  33: #endif
  34: #ifndef r_glowMapping
  35: #define r_glowMapping 1
  36: #endif
  37: #ifndef TEXTURE_RG
  38: #define TEXTURE_RG 1
  39: #endif
  40: #ifndef UNIFORM_BUFFER_OBJECT
  41: #define UNIFORM_BUFFER_OBJECT 1
  42: #endif
  43: #ifndef TEXTURE_INTEGER
  44: #define TEXTURE_INTEGER 1
  45: #endif
  46: #ifndef r_AmbientScale
  47: #define r_AmbientScale 1.00000000e+00
  48: #endif
  49: #ifndef r_SpecularScale
  50: #define r_SpecularScale 1.00000000e+00
  51: #endif
  52: #ifn  53: #define r_zNear 3.00000000e+00
  54: #endif
  55: #ifndef M_PI
  56: #define M_PI 3.14159274e+00
  57: #endif
  58: #ifndef MAX_SHADOWMAPS
  59: #define MAX_SHADOWMAPS 5
  60: #endif
  61: #ifndef MAX_REF_LIGHTS
  62: #define MAX_REF_LIGHTS 1024
  63: #endif
  64: #ifndef TILE_SIZE
  65: #define TILE_SIZE 16
  66: #endif
  67: #ifndef r_FBufSize
  68: #define r_FBufSize vec2(1.72800000e+03, 1.11700000e+03)
  69: #endif
  70: #ifndef r_tileStep
  71: #define r_tileStep vec2(9.25925933e-03, 1.43240821e-02)
  72: #endif
   0: #line 0
   1: /*
   2: ===========================================================================
   3: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
   4:
   5: This file is part of XreaL source code.
   6:
   7: XreaL source code is free software; you can redistribute it
   8: and/or modify it under the terms of the GNU General Public License as
   9: published by the Free Software Foundation; either version 2 of the License,
  10: or (at your option) any later version.
  11:
  12: XreaL source code is distributed in the hope that it will be
  13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15: GNU General Public License for more details.
  16:
  17: You should have received a copy of the GNU General Public License
  18: along with XreaL source code; if not, write to the Free Software
  19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20: ===========================================================================
  21: */
  22: // computeLight_fp.glsl - Light computing helper function 155: #else // !TEXTURE INTEGER
 156: const int lightsPerLayer = 4;
 157: uniform sampler3D u_LightTiles;
 158: #define idxs_t vec4
 159: idxs_t fetchIdxs( in vec3 coords ) {
 160:   return texture3D( u_LightTiles, coords ) * 255.0;
 161: }
 162: int nextIdx( inout idxs_t idxs ) {
 163:   vec4 tmp = idxs;
 164:   idxs = floor(idxs * 0.25);
 165:   tmp -= 4.0 * idxs;
 166:   return int( dot( tmp, vec4( 64.0, 16.0, 4.0, 1.0 ) ) );
 167: }
 168: #endif // TEXTURE_INTEGER
 169:
 170: const int numLayers = MAX_REF_LIGHTS / 256;
 171:
 172: #if defined(r_dynamicLight)
 173: void computeDLight( int idx, vec3 P, vec3 normal, vec3 viewDir, vec4 diffuse,
 174:           vec4 material, inout vec4 color ) {
 175:   vec4 center_radius = GetLight( idx, center_radius );
 176:   vec4 color_type = GetLight( idx, color_type );
 177:   vec3 L;
 178:   float attenuation;
 179:
 180:   if( color_type.w == 0.0 ) {
 181:     // point light
 182:     L = center_radius.xyz - P;
 183:     attenuation = 1.0 / (1.0 + 8.0 * length(L) / center_radius.w);
 184:     L = normalize(L);
 185:   } else if( color_type.w == 1.0 ) {
 186:     // spot light
 187:     vec4 direction_angle = GetLight( idx, direction_angle );
 188:     L = center_radius.xyz - P;
 189:     attenuation = 1.0 / (1.0 + 8.0 * length(L) / c
 199:   }
 200:   computeLight( L, normal, viewDir,
 201:       attenuation * attenuation * color_type.xyz,
 202:       diffuse, material, color );
 203: }
 204:
 205: void computeDLights( vec3 P, vec3 normal, vec3 viewDir, vec4 diffuse, vec4 material,
 206:            inout vec4 color ) {
 207:   vec2 tile = floor( gl_FragCoord.xy * (1.0 / float( TILE_SIZE ) ) ) + 0.5;
 208:   vec3 tileScale = vec3( r_tileStep, 1.0/numLayers );
 209:
 210: #if defined(r_showLightTiles)
 211:   float numLights = 0.0;
 212: #endif
 213:
 214:   for( int layer = 0; layer < numLayers; layer++ ) {
 215:     idxs_t idxs = fetchIdxs( tileScale * vec3( tile, float( layer ) + 0.5 ) );
 216:     for( int i = 0; i < lightsPerLayer; i++ ) {
 217:       int idx = numLayers * nextIdx( idxs ) + layer;
 218:
 219:       if( idx >= u   2: ===========================================================================
   3: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
   4:
   5: This file is part of XreaL source code.
   6:
   7: XreaL source code is free software; you can redistribute it
   8: and/or modify it under the terms of the GNU General Public License as
   9: published by the Free Software Foundation; either version 2 of the License,
  10: or (at your option) any later version.
  11:
  12: XreaL source code is distributed in the hope that it will be
  13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15: GNU General Public License for more details.
  16:
  17: You should have received a copy of the GNU General Public License
  18: al
  31:
  32: #if defined(USE_RELIEF_MAPPING)
  33: #if !defined(USE_HEIGHTMAP_IN_NORMALMAP)
  34: uniform sampler2D u_HeightMap;
  35: #endif // !USE_HEIGHTMAP_IN_NORMALMAP
  36: uniform float       u_ReliefDepthScale;
  37: uniform float       u_ReliefOffsetBias;
  38: #endif // USE_RELIEF_MAPPING
  39:
  40: // compute normal in tangent space
  41: vec3 NormalInTangentSpace(vec2 texNormal)
  42: {
  43:   vec3 normal;
  44:
  45: #if defined(r_normalMapping)
  46: #if defined(USE_HEIGHTMAP_IN_NORMALMAP)
  47:   // alpha channel contains the height map so do not try to reconstruct normal map from it
  48:   normal = texture2D(u_NormalMap, texNormal).rgb;
  49:   normal = 2.0 * normal - 1.0;
  50: #else // !USE_HEIGHTMAP_IN_NORMALMAP
  51:   // the Capcom trick abusing alpha channel of DXT1/5 formats to encode normal map
  52:   // https://github.com/DaemonEngine/Daemon/issues/183#issuecomment-473691252
  53:   //
  54:   // the algorithm also works with normal maps in rgb format without alpha channel
  55:   // but we still must be sure there is no height map in alpha channel hence the test
  56:   //
  57:   // crunch -dxn seems to produce such files, since alpha channel is abused such format
  58:   // is unsuitable to embed height map, then height map must be distributed as loose file
  59:   normal = texture2D(u_NormalMap, texNormal).rga;
  60:   normal.x *= normal.z;
  61:   normal.xy = 2.0 * normal.xy - 1.0;
  62:   // In a perfect world this code must be enough:
  63:   // normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
  64:   //
 115:   #if !defined(USE_LIGHT_MAPPING) || !defined(USE_DELUXE_MAPPING)
 116:       #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)
 117:           // Compute light grid position.
 118:           vec3 lightGridPos = (var_Position - u_LightGridOrigin) * u_LightGridScale;
 119:       #endif
 120:   #endif
 121:
 122:   #if defined(USE_DELUXE_MAPPING)
 123:       // Compute light direction in world space from deluxe map.
 124:       vec4 deluxe = texture2D(u_DeluxeMap, var_TexLight);
 125:       vec3 lightDir = normalize(2.0 * deluxe.xyz - 1.0);
 126:   #else
 127:       #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)
 128:           // Compute light direction in world space from light grid.
 129:           vec4 texel = texture3D(u_LightGrid2, lightGridPos);
 130:           vec3 lightDir = normalize(texel.xyz - (128.0 / 255.0));
 131:       #endif
 132:   #endif
 133:
 134:   #if defined(USE_LIGHT_MAPPING)
 135:       // Compute light color from world space lightmap.
 136:       vec3 lightColor = texture2D(u_LightMap, var_TexLight).rgb;
 137:
 138:       #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)
 139:           color.rgb = vec3(0.0);
 140:       #else
 141:           color.rgb = lightColor.rgb * diffuse.rgb;
 142:       #endif
 143:   #else
 144:       // Compute light color from lightgrid.
 145:       vec3 ambientColor, lightColor;
 146:       ReadLightGrid(texture3D(u_LightGrid1, lightGridPos), ambientColor, lightColor);
 147:
 148:       color.rgb = ambientColor * r_AmbientScale * diffuse.rgb;
 149:   #endif
 150:
 151:   #if defined(USE_LIGHT_MAPPING)
 152:       /* Lightmaps generated by q3map2 don't store the raw light value, but
 153:       they store light premultiplied with the dot product of the ligh 157:        The lightmap stores the light in this way because for the diffuse
 158:       lighting formula the outgoing light is equal to the incoming light
 159:       multiplied by the above dot product multiplied by the surface albedo.
 160:       So this premultiplication means that the diffuse lighting value can
 161:       be calculated with a single multiply operation.
 162:
 163:       But specular lighting and/or normal mapping formulas are more complex,
 164:       and so you need the true light value to get correct lighting.
 165:       Obviously the data is not good enough to recover the original color
 166:       in all cases. The lower bound was an arbitrary chose factor to
 167:       prevent too small divisors resulting in too bright lights.
 168:
 169:       Increasing the value should reduce these artifacts. -- gimhael
 170:       https://github.com/DaemonEngine/Daemon/issues/299#issuecomment-606186347
 171:       */
 172:
 173:       #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)
 174:           // Divide by cosine term to restore original light color.
 175:           lightColor /= clamp(dot(normalize(var_Normal), lightDir), 0.3, 1.0);
 176:       #endif
 177:   #endif
 178:
 179:   #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)
 180:       // Blend static light.
 181:       computeLight(lightDir, normal, viewDir, lightColor, diffuse, material, color);
 182:   #endif
 183:
 184:   #if defined(r_dynamicLight)
 185:       // Blend dynamic lights.
 186:       computeDLights(var_Position, normal, viewDir, diffuse, material, color);
 187:   #endif
 188:
 189:   // Add Rim Lighting to highlight the edges on model entities.
 190:   #if defined(r_rimLighting) && !defined(USE_BSP_SURFACE) && !defined(USE_LIGHT_MAPPING)
 191:       float rim = pow(1.0 - clamp(dot(normal, viewDir), 0.0, 1.0), r_RimExponent);
 192:       vec3 emission = ambientColor * rim * rim * 0.2;
 193:       color.rgb += 0.7 * emission;
 194:   #endif
 195:
 196:   #if defined(r_glowMapping)
 197:       // Blend gl
Warn: Compile log:
ERROR: 0:135: '+=' : syntax error: syntax error

Warn: Unhandled exception (15ShaderException): Couldn't compile fragment shader: lightMapping

New error on OSX

illwieckz commented 2 years ago

What's that ????

  22: // computeLight_fp.glsl - Light computing helper function 155: #else // !TEXTURE INTEGER
 156: const int lightsPerLayer = 4;

Edit: also this:

 219:       if( idx >= u   2: ===========================================================================
  3: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>

this:

  63:   // normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
  64:   //
 115:   #if !defined(USE_LIGHT_MAPPING) || !defined(USE_DELUXE_MAPPING)
 116:       #if !defined(HACK_NO_BSP_GRID_LIGHTDIR)

and this:

 153:       they store light premultiplied with the dot product of the ligh 157:        The lightmap stores the light in this way because for the diffuse
 158:       lighting formula the outgoing light is equal to the incoming light
illwieckz commented 2 years ago

I got a different but as meaningless error on an Intel+Nvidia mac:

Client 0 connecting 
Calling GetRefAPI… 
GL_VENDOR: NVIDIA Corporation 
GL_RENDERER: NVIDIA GeForce GT 640M OpenGL Engine 
GL_VERSION: 4.1 NVIDIA-14.0.32 355.11.11.10.10.143 
GL_MAX_TEXTURE_SIZE: 16384 
GL_SHADING_LANGUAGE_VERSION: 4.10 
GL_MAX_VERTEX_UNIFORM_COMPONENTS 4096 
GL_MAX_VERTEX_ATTRIBS 16 
Occlusion query bits: 32 
GL_MAX_DRAW_BUFFERS: 8 
GL_MAX_RENDERBUFFER_SIZE: 16384 
GL_MAX_COLOR_ATTACHMENTS: 8 
PIXELFORMAT: color(24-bits) 
MODE: -1, 1344 x 756 windowed hz: N/A 
Using OpenGL version 4.1, requested: 3.2 
Using OpenGL 3.x context. 
Using an OpenGL core profile. 
OpenGL 3.x context is forward compatible. 
Using OpenGL extensions: GL_ARB_half_float_pixel GL_ARB_texture_float GL_EXT_gpu_shader4 GL_EXT_texture_integer GL_ARB_texture_rg GL_ARB_texture_gather GL_EXT_texture_compression_s3tc GL_ARB_texture_compression_rgtc GL_ARB_half_float_vertex GL_ARB_framebuffer_object GL_ARB_uniform_buffer_object GL_ARB_map_buffer_range GL_ARB_sync 
Missing OpenGL extensions: GL_ARB_debug_output GL_ARB_get_program_binary GL_ARB_buffer_storage 
Using S3TC (DXTC) texture compression. 
Using GPU vertex skinning with max 233 bones in a single pass, models are hardware accelerated. 
Extracting VM module cgame-x86_64.nexe from /Users/demo/Desktop/unvanquished_0.52.1-20220730-212637-57e726b/pkg/unvanquished_0.52.1-20220730-212637-57e726b.dpk...

Loading VM module cgame-x86_64.nexe... 
Using loader args:  /Users/demo/Desktop/unvanquished_0.52.1-20220730-212637-57e726b/Unvanquished.app/Contents/MacOS/nacl_loader -v -B /Users/demo/Desktop/unvanquished_0.52.1-20220730-212637-57e726b/Unvanquished.app/Contents/MacOS/irt_core-x86_64.nexe -e -i 100:45 -- /Users/demo/Library/Application Support/Unvanquished/cgame-x86_64.nexe 100 
Loaded VM module in 139 msec 
Loading Lua interpreter 
Loaded font face unifont (from fonts/unifont.ttf). 
Loaded font face Roboto (from fonts/Roboto-Bold.ttf). 
Loaded font face Roboto (from fonts/Roboto-BoldItalic.ttf). 
Loaded font face Roboto (from fonts/Roboto-Italic.ttf). 
Loaded font face Roboto (from fonts/Roboto-Regular.ttf). 
Loaded font face FontAwesome (from fonts/fontawesome-webfont.ttf). 
Loaded font face DejaVu Sans (from fonts/DejaVuSansCondensed.ttf). 
Loaded font face Material Icons (from fonts/MaterialIcons-Regular.ttf). 
Warn: CM_AddFacetBevels... invalid bevel 
Warn: CM_AddFacetBevels... invalid bevel 
Warn: CM_AddFacetBevels... invalid bevel 
Warn: CM_AddFacetBevels... invalid bevel 
Warn: Source for shader program lightMapping:
   0: #version 410 core
   1: #define HAVE_ARB_texture_gather 1
   2: #define HAVE_EXT_gpu_shader4 1
   3: #define HAVE_ARB_gpu_shader5 1
   4: #define HAVE_ARB_uniform_buffer_object 1
   5: #define IN(mode) mode in
   6: #define DECLARE_OUTPUT(type) out type outputColor;
   7: #define textureCube texture
   8: #define texture2D texture
   9: #define texture2DProj textureProj
  10: #define texture3D texture
  11: #ifndef r_precomputedLighting
  12: #define r_precomputedLighting 1
  13: #endif
  14: #ifndef r_vertexSkinning
  15: #define r_vertexSkinning 1
  16: #endif
  17: const int MAX_GLSL_BONES = 233;
  18: const float r_wrapAroundLighting = 6.99999988e-01;
  19: #ifndef r_halfLambertLighting
  20: #define r_halfLambertLighting 1
  21: #endif
  22: #ifndef r_glowMapping
  23: #define r_glowMapping 1
  24: #endif
  25: #ifndef TEXTURE_RG
  26: #define TEXTURE_RG 1
  27: #endif
  28: #ifndef UNIFORM_BUFFER_OBJECT
  29: #define UNIFORM_BUFFER_OBJECT 1
  30: #endif
  31: #ifndef TEXTURE_INTEGER
  32: #define TEXTURE_INTEGER 1
  33: #endif
  34: #ifndef r_AmbientScale
  35: #define r_AmbientScale 1.00000000e+00
  36: #endif
  37: #ifndef r_SpecularScale
  38: #define r_SpecularScale 1.00000000e+00
  39: #endif
  40: #ifndef r_zNear
  41: #define r_zNear 3.00000000e+00
  42: #endif
  43: #ifndef M_PI
  44: #define M_PI 3.14159274e+00
  45: #endif
  46: #ifndef MAX_SHADOWMAPS
  47: #define MAX_SHADOWMAPS 5
  48: #endif
  49: #ifndef MAX_REF_LIGHTS
  50: #define MAX_REF_LIGHTS 1024
  51: #endif
  52: #ifndef TILE_SIZE
  53: #define TILE_SIZE 16
  54: #endif
  55: #ifndef r_FBufSize
  56: #define r_FBufSize vec2(1.34400000e+03, 7.56000000e+02)
  57: #endif
  58: #ifndef r_tileStep
  59: #define r_tileStep vec2(1.19047621e-02, 2.11640205e-02)
  60: #endif
   0: #line 0
   1: /*
   2: ===========================================================================
   3: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
   4: 
   5: This file is part of XreaL source code.
   6: 
   7: XreaL source code is free software; you can redistribute it
   8: and/or modify it under the terms of the GNU General Public License as
   9: published by the Free Software Foundation; either version 2 of the License,
  10: or (at your option) any later version.
  11: 
  12: XreaL source code is distributed in the hope that it will be
  13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15: GNU General Public License for more details.
  16: 
  17: You should have received a copy of the GNU General Public License
  18: along with XreaL source code; if not, write to the Free Software
  19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20: ===========================================================================
  21: */
  22: // computeLight_fp.glsl - Light computing helper functions
  23: 
  24: #if defined(USE_REFLECTIVE_SPECULAR)
  25: uniform samplerCube u_EnvironmentMap0;
  26: uniform samplerCube u_EnvironmentMap1;
  27: uniform float u_EnvironmentInterpolation;
  28: #endif // USE_REFLECTIVE_SPECULAR
  29: 
  30: #ifdef HAVE_ARB_uniform_buffer_object
  31: struct light {
  32:   vec4  center_radius;
  33:   vec4  color_type;
  34:   vec4  direction_angle;
  35: };
  36: 
  37: layout(std140) uniform u_Lights {
  38:   light lights[ MAX_REF_LIGHTS ];
  39: };
  40: #define GetLight(idx, component) lights[idx].component
  41: #else // !HAVE_ARB_uniform_buffer_object
  42: uniform sampler2D u_Lights;
  43: #define idxToTC( idx, w, h ) vec2( floor( ( idx * ( 1.0 / w ) ) + 0.5 ) * ( 1.0 / h ), \
  44:                  fract( ( idx + 0.5 ) * (1.0 / w ) ) )
  45: const struct GetLightOffsets {
  46:   int center_radius;
  47:   int color_type;
  48:   int direction_angle;
  49: } getLightOffsets = GetLightOffsets(0, 1, 2);
  50: #define GetLight(idx, component) texture2D( u_Lights, idxToTC(3 * idx + getLightOffsets.component, 64.0, float( 3 * MAX_REF_LIGHTS / 64 ) ) )
  51: #endif // HAVE_ARB_uniform_buffer_object
  52: 
  53: uniform int u_numLights;
  54: 
  55: uniform vec2 u_SpecularExponent;
  56: 
  57: // lighting helper functions
  58: 
  59: void ReadLightGrid(in vec4 texel, out vec3 ambientColor, out vec3 lightColor) {
  60:   float ambientScale = 2.0 * texel.a;
  61:   float directedScale = 2.0 - ambientScale;
  62:   ambientColor = ambientScale * texel.rgb;
  63:   lightColor = directedScale * texel.rgb;
  64: }
  65: 
  66: void computeLight( vec3 lightDir, vec3 normal, vec3 viewDir, vec3 lightColor,
  67:          vec4 diffuseColor, vec4 materialColor,
  68:          inout vec4 color ) {
  69:   vec3 H = normalize( lightDir + viewDir );
  70: 
  71: #if defined(USE_PHYSICAL_MAPPING) || defined(r_specularMapping)
  72:   float NdotH = clamp( dot( normal, H ), 0.0, 1.0 );
  73: #endif // USE_PHYSICAL_MAPPING || r_specularMapping
  74: 
  75:   // clamp( NdotL, 0.0, 1.0 ) is done below
  76:   // if no r_halfLambertLighting and no r_wrapAroundLighting.
  77:   float NdotL = dot( normal, lightDir );
  78: 
  79: #if defined(r_halfLambertLighting)
  80:   // http://developer.valvesoftware.com/wiki/Half_Lambert
  81:   NdotL = NdotL * 0.5 + 0.5;
  82:   NdotL *= NdotL;
  83: #elif defined(r_wrapAroundLighting)
  84:   NdotL = clamp( NdotL + r_wrapAroundLighting, 0.0, 1.0) / clamp(1.0 + r_wrapAroundLighting, 0.0, 1.0);
  85: #else
  86:   NdotL = clamp( NdotL, 0.0, 1.0 );
  87: #endif
  88: 
  89:   vec3 light = lightColor.rgb * NdotL * diffuseColor.rgb;
  90: 
  91: #if defined(USE_PHYSICAL_MAPPING)
  92:   // Daemon PBR packing defaults to ORM like glTF 2.0 defines
  93:   // https://www.khronos.org/blog/art-pipeline-for-gltf
  94:   // > ORM texture for Occlusion, Roughness, and Metallic
  95:   // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/schema/material.pbrMetallicRoughness.schema.json
  96:   // > The metalness values are sampled from the B channel. The roughness values are sampled from the G channel.
  97:   // > These values are linear. If other channels are present (R or A), they are ignored for metallic-roughness calculations.
  98:   // https://docs.blender.org/manual/en/2.80/addons/io_scene_gltf2.html
  99:   // > glTF stores occlusion in the red (R) channel, allowing it to optionally share the same image
 100:   // > with the roughness and metallic channels.
 101:   float roughness = materialColor.g;
 102:   float metalness = materialColor.b;
 103: 
 104:   float NdotV = clamp( dot( normal, viewDir ), 0.0, 1.0);
 105:   float VdotH = clamp( dot( viewDir, H ), 0.0, 1.0);
 106: 
 107:   float alpha = roughness * roughness;
 108:   float k = 0.125 * (roughness + 1.0) * (roughness + 1.0);
 109: 
 110:   float D = alpha / ((NdotH * NdotH) * (alpha * alpha - 1.0) + 1.0);
 111:   D *= D;
 112: 
 113:   float FexpNH = pow(1.0 - NdotH, 5.0);
 114:   float FexpNV = pow(1.0 - NdotV, 5.0);
 115:   vec3 F = mix(vec3(0.04), diffuseColor.rgb, metalness);
 116:   F = F + (1.0 - F) * FexpNH;
 117: 
 118:   float G = NdotL / (NdotL * (1.0 - k) + k);
 119:   G *= NdotV / (NdotV * (1.0 - k) + k);
 120: 
 121:   light *= (1.0 - metalness);
 122:   light += lightColor.rgb * vec3((D * F * G) / (4.0 * NdotV));
 123:   color.a = mix(diffuseColor.a, 1.0, FexpNV);
 124: #else // !USE_PHYSICAL_MAPPING
 125: 
 126: #if defined(USE_REFLECTIVE_SPECULAR)
 127:   // not implemented for PBR yet
 128:   vec4 envColor0 = textureCube(u_EnvironmentMap0, reflect(-viewDir, normal));
 129:   vec4 envColor1 = textureCube(u_EnvironmentMap1, reflect(-viewDir, normal));
 130: 
 131:   materialColor.rgb *= mix(envColor0, envColor1, u_EnvironmentInterpolation).rgb;
 132: #endif // USE_REFLECTIVE_SPECULAR
 133: 
 134: #if defined(r_specularMapping)
 135:   // The minimal specular exponent should preferably be nonzero to avoid the undefined pow(0, 0)
 136:   light += lightColor.rgb * materialColor.rgb * pow(NdotH, u_SpecularExponent.x * materialColor.a + u_SpecularExponent.y) * r_SpecularScale;
 137: #endif // r_specularMapping
 138: #endif // !USE_PHYSICAL_MAPPING
 139: 
 140:   color.rgb += light;
 141: }
 142: 
 143: #if defined(TEXTURE_INTEGER)
 144: const int lightsPerLayer = 16;
 145: uniform usampler3D u_LightTiles;
 146: #define idxs_t uvec4
 147: idxs_t fetchIdxs( in vec3 coords ) {
 148:   return texture3D( u_LightTiles, coords );
 149: }
 150: int nextIdx( inout idxs_t idxs ) {
 151:   uvec4 tmp = ( idxs & uvec4( 3 ) ) * uvec4( 0x40, 0x10, 0x04, 0x01 );
 152:   idxs = idxs >> 2;
 153:   return int( tmp.x + tmp.y + tmp.z + tmp.w );
 154: }
 155: #else // !TEXTURE INTEGER
 156: const int lightsPerLayer = 4;
 157: uniform sampler3D u_LightTiles;
 158: #define idxs_t vec4
 159: idxs_t fetchIdxs( in vec3 coords ) {
 160:   return texture3D( u_LightTiles, coords ) * 255.0;
 161: }
 162: int nextIdx( inout idxs_t idxs ) {
 163:   vec4 tmp = idxs;
 164:   idxs = floor(idxs * 0.25);
 165:   tmp -= 4.0 * idxs;
 166:   return int( dot( tmp, vec4( 64.0, 16.0, 4.0, 1.0 ) ) );
 167: }
 168: #endif // TEXTURE_INTEGER
 169: 
 170: const int numLayers = MAX_REF_LIGHTS / 256;
 171: 
 172: #if defined(r_dynamicLight)
 173: void computeDLight( int idx, vec3 P, vec3 normal, vec3 viewDir, vec4 diffuse,
 174:           vec4 material, inout vec4 color ) {
 175:   vec4 center_radius = GetLight( idx, center_radius );
 176:   vec4 color_type = GetLight( idx, color_type );
 177:   vec3 L;
 178:   float attenuation;
 179: 
 180:   if( color_type.w == 0.0 ) {
 181:     // point light
 182:     L = center_radius.xyz - P;
 183:     attenuation = 1.0 / (1.0 + 8.0 * length(L) / center_radius.w);
 184:     L = normalize(L);
 185:   } else if( color_type.w == 1.0 ) {
 186:     // spot light
 187:     vec4 direction_angle = GetLight( idx, direction_angle );
 188:     L = center_radius.xyz - P;
 189:     attenuation = 1.0 / (1.0 + 8.0 * length(L) / center_radius.w);
 190:     L = normalize( L );
 191: 
 192:     if( dot( L, direction_angle.xyz ) <= direction_angle.w ) {
 193:       attenuation = 0.0;
 194:     }
 195:   } else if( color_type.w == 2.0 ) {
 196:     // sun (directional) light
 197:     L = GetLight( idx, direction_angle ).xyz;
 198:     attenuation = 1.0;
 199:   }
 200:   computeLight( L, normal, viewDir,
 201:       attenuation * attenuation * color_type.xyz,
 202:       diffuse, material, color );
 203: }
 204: 
 205: void computeDLights( vec3 P, vec3 normal, vec3 viewDir, vec4 diffuse, vec4 material,
 206:            inout vec4 color ) {
 207:   vec2 tile = floor( gl_FragCoord.xy * (1.0 / float( TILE_SIZE ) ) ) + 0.5;
 208:   vec3 tileScale = vec3( r_tileStep, 1.0/numLayers );
 209: 
 210: #if defined(r_showLightTiles)
 211:   float numLights = 0.0;
 212: #endif
 213: 
 214:   for( int layer = 0; layer < numLayers; layer++ ) {
 215:     idxs_t idxs = fetchIdxs( tileScale * vec3( tile, float( layer ) + 0.5 ) );
 216:     for( int i = 0; i < lightsPerLayer; i++ ) {
 217:       int idx = numLayers * nextIdx( idxs ) + layer;
 218: 
 219:       if( idx >= u_numLights )
 220:       {
 221: #if defined(r_showLightTiles)
 222:         if (numLights > 0.0)
 223:         {
 224:           color = vec4(numLights/(lightsPerLayer*numLayers), numLights/(lightsPerLayer*numLayers), numLights/(lightsPerLayer*numLayers), 1.0);
 225:         }
 226: #endif
 227:         return;
 228:       }
 229: 
 230:       computeDLight( idx, P, normal, viewDir, diffuse, material, color );
 231: 
 232: #if defined(r_showLightTiles)
 233:       numLights++;
 234: #endif
 235:     }
 236:   }
 237:   
 238: #if defined(r_showLightTiles)
 239:   if (numLights > 0.0)
 240:   {
 241:     color = vec4(numLights/(lightsPerLayer*numLayers), numLights/(lightsPerLayer*numLayers), numLights/(lightsPerLayer*numLayers), 1.0);
 242:   }
 243: #endif
 244: }
 245: #endif
   0: #line 0
   1: /*
   2: ===========================================================================
   3: Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
   4: 
   5: This file is part of XreaL source code.
   6: 
   7: XreaL source code is free software; you can redistribute it
   8: and/or modify it under the terms of the GNU General Public License as
   9: published by the Free Software Foundation; either version 2 of the License,
  10: or (at your option) any later version.
  11: 
  12: XreaL source code is distributed in the hope that it will be
  13: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15: GNU General Public License for more details.
  16: 
  17: You should have received a copy of the GNU General Public License
  18: along with XreaL source code; if not, write to the Free Software
  19: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20: ===========================================================================
  21: */
  22: // reliefMapping_fp.glsl - Relief mapping helper functions
  23: 
  24: #if defined(r_normalMapping) || defined(USE_HEIGHTMAP_IN_NORMALMAP)
  25: uniform sampler2D u_NormalMap;
  26: #endif // r_normalMapping || USE_HEIGHTMAP_IN_NORMALMAP
  27: 
  28: #if defined(r_normalMapping)
  29: uniform vec3        u_NormalScale;
  30: #endif // r_normalMapping
  31: 
  32: #if defined(USE_RELIEF_MAPPING)
  33: #if !defined(USE_HEIGHTMAP_IN_NORMALMAP)
  34: uniform sampler2D u_HeightMap;
  35: #endif // !USE_HEIGHTMAP_IN_NORMALMAP
  36: uniform float       u_ReliefDepthScale;
  37: uniform float       u_ReliefOffsetBias;
  38: #endif // USE_RELIEF_MAPPING
  39: 
  40: // compute normal in tangent space
  41: vec3 NormalInTangentSpace(vec2 texNormal)
  42: {
  43:   vec3 normal;
  44: 
  45: #if defined(r_normalMapping)
  46: #if defined(USE_HEIGHTMAP_IN_NORMALMAP)
  47:   // alpha channel contains the height map so do not try to reconstruct normal map from it
  48:   normal = texture2D(u_NormalMap, texNormal).rgb;
  49:   normal = 2.0 * normal - 1.0;
  50: #else // !USE_HEIGHTMAP_IN_NORMALMAP
  51:   // the Capcom trick abusing alpha channel of DXT1/5 formats to encode normal map
  52:   // https://github.com/DaemonEngine/Daemon/issues/183#issuecomment-473691252
  53:   //
  54:   // the algorithm also works with normal maps in rgb format without alpha channel
  55:   // but we still must be sure there is no height map in alpha channel hence the test
  56:   //
  57:   // crunch -dxn seems to produce such files, since alpha channel is abused such format
  58:   // is unsuitable to embed height map, then height map must be distributed as loose file
  59:   normal = texture2D(u_NormalMap, texNormal).rga;
  60:   normal.x *= normal.z;
  61:   normal.xy = 2.0 * normal.xy - 1.0;
  62:   // In a perfect world this code must be enough:
  63:   // normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
  64:   //
  65:   // Unvanquished texture known to trigger black normalmap artifacts
  66:   // when doing Z reconstruction:
  67:   //   textures/shared_pk02_src/rock01_n
  68:   //
  69:   // Although the normal vector is supposed to have a length of 1,
  70:   // dot(normal.xy, normal.xy) may be greater than 1 due to compression
  71:   // artifacts: values as large as 1.27 have been observed with crunch -dx .
Warn: Compile log:
ERROR: 0:139: ';' : syntax error: syntax error

Warn: Unhandled exception (15ShaderException): Couldn't compile fragment shader: lightMapping 
illwieckz commented 2 years ago

@DolceTriade dedicated issue: https://github.com/DaemonEngine/Daemon/issues/670

ghost commented 2 years ago

Github really needs a way to hide those long quotes of random stuff, they really make this unreadable.

illwieckz commented 2 years ago

Version names are set, just the zip is renamed. If it works, we will rename the zip to unvanquished_0.53.0.zip and it will be a release. Release tags are ready to push on my end.

I tested on:

I tested those resolutions:

I tested all the maps and tested both client, tty and server with client and tty connect to the server hosting the maps.

I tested with my existing Linux home, my existing macOS home and brand new Linux home and brand new Window home (one Wine).

I tested default options and lowest, low, medium, high and ultra presets on Linux. I also tested flamer and ground fire on ultra preset on Linux (AMD GPU).

I tested on a virtual machine without required OpenGL and got the error message I expected.

I was testing a real game against bots with a client on a dedicated server on LAN, building stuff and fighting, I got an unexpected disconnection:

[…]
^4●^7[bot] Bot#5 ^*was shredded by ^1●^7[bot] Bot#3^*'s Marauder
Machinegun Turret ^2built^* by ^4ill^7wie^1ckz
^1●^7[bot] Bot#3 ^*was gunned down by a turret; ^4●^7[bot] Bot#5^* assisted
Machinegun Turret ^2built^* by ^4ill^7wie^1ckz
Drill ^2built^* by ^4ill^7wie^1ckz
Rocket Pod ^2built^* by ^4ill^7wie^1ckz
Rocket Pod ^2built^* by ^4ill^7wie^1ckz
^4●^7[bot] Bot#5 ^*was shredded by ^1●^7[bot] Bot#3^*'s Marauder
Medistation ^2built^* by ^4ill^7wie^1ckz
You can not buy or sell weapons until your build timer expires
You have no room to carry this
^1●^7[bot] Bot#3 ^*caught a rocket; ^4●^7[bot] Bot#5^* assisted
^4●^7[bot] Bot#5 ^*was shredded by ^1●^7[bot] Bot#2^*'s Marauder
^1●^7[bot] Bot#2 ^*was gunned down by ^4●^7^4ill^7wie^1ckz
You don't have the medkit
^3Warn: IPC: Socket closed by remote end
[…]
Error during cgame shutdown: IPC: Failed to send message: Broken pipe
Error sending exit message to cgame: IPC: Failed to send message: Broken pipe
^3Warn: VM exited with non-zero exit code 245

I don't know if I was just unlucky…

DolceTriade commented 2 years ago

Definitely a crash, but I couldn't repro it. If you built with BREAKPAD, you should be able to find a crash dump

illwieckz commented 2 years ago

I have no one crashdump, the binary was built with the docker file so it should have breakpad. I don't know why I don't have any crashdump at the date of today.

My computer currently has some heavy usage with some virtual machines running, etc. (even right now Firefox is lagging while I type) so maybe that's just a side effect of that.

illwieckz commented 2 years ago

That was the log on server side:

Die: 3 5 MOD_LEVEL2_CLAW: [bot] Bot#3^* killed [bot] Bot#5
Construct: 0 192 mgturret: ^4ill^7wie^1ckz^* is building Machinegun Turret
Die: 106 3 MOD_MGTURRET 5 2: <world>^* killed [bot] Bot#3^*; [bot] Bot#5^* assisted
Construct: 0 194 mgturret: ^4ill^7wie^1ckz^* is building Machinegun Turret
Construct: 0 203 drill: ^4ill^7wie^1ckz^* is building Drill
Construct: 0 67 rocketpod: ^4ill^7wie^1ckz^* is building Rocket Pod
Construct: 0 198 rocketpod: ^4ill^7wie^1ckz^* is building Rocket Pod
Die: 3 5 MOD_LEVEL2_CLAW: [bot] Bot#3^* killed [bot] Bot#5
Construct: 0 211 medistat: ^4ill^7wie^1ckz^* is building Medistation
Die: 198 3 MOD_ROCKETPOD 5 2: <world>^* killed [bot] Bot#3^*; [bot] Bot#5^* assisted
Die: 2 5 MOD_LEVEL2_CLAW: [bot] Bot#2^* killed [bot] Bot#5
Die: 0 2 MOD_SHOTGUN: ^4ill^7wie^1ckz^* killed [bot] Bot#2
ClientDisconnect: 0 [127.0.0.1] (--------------------------------) "^4ill^7wie^1ckz^*"
Broadcast: ^4ill^7wie^1ckz^* disconnected
ClientConnect: 4 [127.0.0.1] (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) "[bot] Bot#4^*" "[bot] Bot#4^*" [BOT]
Broadcast: [bot] Bot#4^* is connecting…
Broadcast: [bot] Bot#4^* entered the game
ChangeTeam: 4 human: [bot] Bot#4^* switched teams
ClientBegin: 4
DolceTriade commented 2 years ago

Looks like a cgame bug possibly.