Search the Community
Searched results for '/tags/forums/bugfix scons linux/' or tags 'forums/bugfix scons linux/q=/tags/forums/bugfix scons linux/&'.
-
Of course if you enable tonemap then you get gamma = 1.2 which increases contrast and sharpening filter which reduces antialiasing/blurry border of the fonts. But is crisper always better? Maybe we should make all fonts black-and-white without antialiasing and use nearest sampling? Because then we'll get the most crisp result. I don't see a major difference in the menu with/without tonemap. The fonts look crisp enough for me both ways. I wonder how many people are actually disappointed by the increased blurring. Removal of tonemapping in main menu has other side benefits, like no color banding in videos, and presenting custom images exactly as mappers intended them to be. Finally, I suppose sharpening filter might be dropped in the future. Modern graphical effects often rely on dithering and low-resolution rendering, simply because rendering that stuff in full resolution is too costly. Sharpening makes the artifacts much more noticeable, as it happened on volumetric lights. UPDATE: As for clipping, I can't reproduce any dependence on tonemap/sharpening. I also tested inside Linux VM. Subpixel clipping might depend on resolution, but thus far clipping is the same for me in all cases.
-
When launching the game (from the OS desktop) with antialiasing turned on, there is a distorted frame before the main menu is shown. After the brief distortion, the main menu displays correctly and the game can be played without issue. I've included a photo of my screen that I took with a camera. With antialiasing turned off, I do not see any distortion when launching the game. Anyone else notice this or just me? Linux, Ubuntu 22.04 AMD Radeon RX 6000 Series OpenGL version: 4.6 (Core Profile) Mesa 22.0.5 core Bug: https://bugs.thedarkmod.com/view.php?id=6150
-
Can someone confirm that the linux version is working correctly? I'm using a VBox machine to compile it but when I run it the mouse doesn't work for whatever reason, so I can't actually test it. Thank you
-
In case you missed it, I updated the Visible Player Hands mod to version 2.0. It now works while a weapon is selected and has a Linux version too.
Check it out if you're interested: Visible Player Hands 2.0
-
-
5
-
- Report
-
I just uploaded a version with the linux binary to the ModDB page. Can someone test it out to see if it's working?
-
Can anyone help with the following? When running make, I get this when it gets to OpenGLRenderSystem: Never mind. I built it again without errors.
-
- 1
-
-
Version 2.0 released! Hello everyone! I've been busy with my thesis and haven't had much time to update this mod but I finally managed to find sometime to work on it and release version 2.0. It includes the new lantern and compass animations and now works while holding a weapon. Check out the original post in this thread to find the link to the ModDB page where the mod is uploaded. I'm sure there are a ton of weird behaviors and overlapping animations due to having to synchronize many components but with normal use cases it seems to be fine. I'll be adding new item animations next and working to eliminate any bugs that may occur, so feel free to share if you find issues with the mod. I'll also finally create the public github repository so you can check out the changes I made to the TDM source code if you wish, and upload a version with the linux executable. Probably tomorrow, as I'm very tired of looking at this right now Enjoy! Edit: This is the kind of issue that can happen with the mod. If you see something like this, please try to find the sequence of inputs that led to it happening so I know what is causing it. Another problem that may occur is the weapon logic getting stuck somewhere and not allowing the player to select a different weapon. I've tried to eliminate as many problems as I could but, again, it's a lot of components interacting with each other so it's likely that I've missed something. Thank you
-
Horror themed fan mission - exploration of seemingly deserted keep in the middle of swamps. Spiders, undead, darkness. ----------------------------------------------------------------------------------------------------------------------------- This is the story about the fate of my family. My uncle, Ralph Mac Roberts, is the baron of a keep nestled deep within the Rahenaen marshes. It was once an important outpost tasked with guarding one of the few Builder roads that cross the marsh, but after the Inventor`s Guild built a system of nearby dams that flooded the whole land, the road closed and there was no longer anything to watch over anymore. The keep itself needed reinforcement against the raising water level and the trade routes become almost impassable, not only for the carriages but for lone couriers as well. There hadn`t been any messages coming from the keep for over a year and my father was about to assemble a caravan so he could go on an expedition to the keep himself. However, in the middle of the night before he was set to leave, a carrier pigeon landed on his windowsill. My father received the letter and read the apologies from my uncle and his family, excusing their long absence. As a way to make reparations for their extended silence, my uncle invited me to the keep to stay there for a fortnight or so. My uncle had instructed me to leave my horse three leagues away from the keep by the nearest charcoal burning hut and hike the remainder of the road on foot, as the trek through the marsh is treacherous for horses. The weather will be awful this time of year, but my father insists that I should go anyways to ensure that our relatives are okay. These plains become dreadfully deserted - to the point where you more expect to meet the dead than the living. And by the way - I think I`m lost. ----------------------------------------------------------------------------------------------------------------------------- Download link: https://1drv.ms/u/s!Aj1DVS465udZgVkXteBbr6cUxdPH Thanks: to the TDM team for great tools, and all the contributors for their assets, to betatesters: Amadeus, Bienie, Boiler's_hiss, Dragofer, Filizitas, Judith, nbohr1more, s.urfer, again to Amadeus for proofreading and text tweaks, and to all the players for their time! Few screenshots: http://forums.thedarkmod.com/topic/10003-so-what-are-you-working-on-right-now/?p=434716 http://forums.thedarkmod.com/topic/10003-so-what-are-you-working-on-right-now/?p=429558 http://forums.thedarkmod.com/topic/19886-fm-marsh-of-rahena-beta-testing/?p=434507 Enjoy! Walk-through !major spoilers! Finding a way across the marsh area: Getting inside: Bed objective: Light sources: Maps: Enemies: Room objective: Hut objective: Sealed objective: Gold: Key: Bodies:
-
It might be best to simply encourage them to come to the forums
-
Greetings. First I would like to say a huge thanks for the continued support of this game and for TDM 2.10, it loads much MUCh faster now. However on Debian Linux I have an issue where the mouse occasionally just warps. It happens both in the game and in the menus, though obviously when it happens in the game it is quite disorienting. Anyone else experience this? I never saw it in 2.09... EDIT: Seems to have gone away when I switched window managers.
-
There's a person messaging the Dark Mod twitter account, saying they can do a Catalan translation of the game. I pointed them in the direction of the Wiki and the forums, but they're saying they want to email someone about it. I'm not really involved in the translation side of things, so I don't have any useful input here. Any ideas?
-
(offtopic btw.) Well it's possible via a custom save-script connected to a trigger-brush but it's a bit difficult to implement currently. I know @joebarninhad such functionality in his last mission, but it was removed because it crashed Linux pc's. That bug is (probably) fixed in 2.13, so maybe now we can see it being implemented. When a well working script is made, maybe it can be integrated into an entity and/or spawnarg (if I understand this correctly).
-
I ran into an error when compiling The Dark Mod on Linux with glibc 2.34. Building CXX object CMakeFiles/TheDarkMod.dir/tests/TestRun.cpp.o In file included from /home/dm/darkmod_src/tests/testing.h:22, from /home/dm/darkmod_src/tests/TestRun.cpp:18: /home/dm/darkmod_src/ThirdParty/artefacts/doctest/include/doctest/doctest.h:3998:47: error: size of array ‘altStackMem’ is not an integral constant-expression 3998 | static char altStackMem[4 * SIGSTKSZ]; | ^ make[2]: *** [CMakeFiles/TheDarkMod.dir/build.make:3071: CMakeFiles/TheDarkMod.dir/tests/TestRun.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/TheDarkMod.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 Updating "ThirdParty/artefacts/doctest/include/doctest/doctest.h" to 2.4.8 fixed it for me. https://github.com/doctest/doctest/blob/v2.4.8/doctest/doctest.h See "Can't compile with glibc master (future 2.34): SIGSTKSZ is no longer a constant" (https://github.com/doctest/doctest/issues/473)
-
So, you essentially replaced the dot by a ring and changed some cvars in addition to that bugfix you mentioned earlier?
-
Hidden Hands: Blood & Metal (Campaign) - 01.09.2024
huntaffer replied to JackFarmer's topic in Fan Missions
Hi JackFarmer Thanks a lot for your great work, I've just finished the last mission and really enjoyed the whole campaign series. The puzzles were so creative and funny , I was able to solve all of them without searching or asking help here, I struggled with many other FMs before, not being a native English speaker . I liked part 4 and 5 the most, but the others were also very good. I think your Hidden hands series with its special humour is one the best advocates of TDM, great job . When I think of the Lost citadel "lottery numbers" I can't stop laughing I played with version 1.0 In the 5th part I encountered more crashes than usual under Linux, mainly when I had to quickload 3 or 4 times . The error was "WARNING:idClipModel::FreeTraceModel: tried to free uncached trace model" sometimes the known "pthread joined failed". I run Debian 12 KDE with Nvidia proprietary driver v535. I have no idea if the game is more stable generally under Windows or Linux with Mesa. cheers -
might actually try the rebar bios mod at some point to see if there are any performance differences, though it requires running a small program to enable it in windows/linux. im also starting to ponder if i should get my hands on a 570x board and a ryzen 5900X3d to keep my 3070 rtx occupied (should be more than enough for that card since my old x99 runs quite ok with it). i can reuse the dram from the x99 since they are way to fast for this board anyway.
-
I am pleased to announce the release of our new fan mission, The Hare in the Snare: Part 1 Mission type: City Missions + Inn/Tavern Description: People are being abducted off the streets and a Watch Captain requires the services of a thief to help him find out why. Download link (v1.0.2-release): https://drive.google.com/file/d/1HYvM_u56wDB16uIlb7qgS_q3P24V69MO/view?usp=sharing Credits: Mapping and original characters: @Frost_Salamander Story, readables, custom models, voices and cinematics: @Kerry000 Menu title track produced and mixed by @JackFarmer with selected gigagooga sound samples Beta testers: @Cambridge Spy @Zerg Rush @Amadeus @Acolytesix @Lzocast @wesp5 @nbohr1more @Kerry000 @ate0ate @Wellingtoncrab @prjames Additional thanks: @Dragofer, @nbohr1moreand @peter_spyfor technical help @Springheel for the modules and tutorials @kingsalfor allowing @Kerry000to abuse his manbeast everyone else on Discord and the TDM forums who offered assistance Requirements and notes: This mission requires TDM 2.09. Earlier versions will probably work but you might see one or two missing models. You may experience some FPS drops in some areas with lower-end hardware. Mid-range and above should be fine. If you have issues, I highly recommend you use shadow maps instead of stencil (settings -> advanced -> shadows implementation). It makes a big difference. For 'Hard' and 'Expert' the light gem sensitivity has been increased by '1' (meaning easier for AI to detect you). Screenshots:
- 100 replies
-
- 19
-
-
-
Nice! @kingsal's Hazard Pay does not crash anymore while saving using a save room in Expert mode under Linux. Just tested.
-
TDM currently uses Scons as the build system to build the execuables from the source code for Linux and Mac. (I guess the Windows side uses whatever MS uses). This has been working more or less for a few years, and one shouldn't "fix" a working system. However, the merging of the D3 source code and the TDM source also brougth along a change to try to use pre-compiled headers. This, however, does somehow not work in the combination of scons, and gcc. Everytime a single line is changed anywhere (in fact, even if 0 lines are changed), the entire source code is recompiled from scratch. Due to the precompiled header, this goes a bit faster than before (16 mins vs 22 mins on my old PC), but it is still annoying having to wait that long, not to mention not being able to use the system during that time. So, it is highly desirable to fix this problem. Here is your chance to fame. Go fix it! Related thoughts: * the minimal invasive solution is prefered - if it can be made with scons, the better! There is no real need to rip out out and replace scons with another build system, unless this brings massive advantages (frankly, the only one I can see is "make it work with precompiled headers"). However, if you do so, prepare to get swear words thrown at because a new build system is likely to bring other, yet unknown problems Nobody will complain, tho, if you make the change to whatever, and it just works, tho Bonus points for: * Creating an automated build system. Something living on the greater internet, syncing SVN every minute, and when detecting a new checkin, re-compiling the source automatically, then publishing the build log on the web, and make the result downloadable.
-
Mission loading screen disables mouse cursor
stgatilov replied to datiswous's topic in TDM Tech Support
I don't think there is any purpose. Windows and Linux have entirely different window/OS integration. They are separate subdirectories with completely different code So there is no wonder that such things are different between Windows and Linux. I think @duzenko spent some time improving the behavior of Windows build. On the other hand, @cabalistic switched Linux build to GLFW. I am afraid of touching this myself because 1) I'm not a Linux user and don't know much about the myriad of desktops and APIs to integrate with them, and 2) I don't want to install Linux natively and this cursor stuff is a bit special inside VM. Maybe it is a simple flag which can be set to GLFW, I don't know. -
the code pieces that needs modifying are these -> /* ================== RB_GLSL_DrawInteraction ================== */ static void RB_GLSL_DrawInteraction( const drawInteraction_t *din ) { /* Half Lambertian constants */ static const float whalf[] = { 0.0f, 0.0f, 0.0f, 0.5f }; static const float wzero[] = { 0.0f, 0.0f, 0.0f, 0.0f }; static const float wone[] = { 0.0f, 0.0f, 0.0f, 1.0f }; // load all the vertex program parameters qglUniform4fv( u_light_origin, 1, din->localLightOrigin.ToFloatPtr() ); qglUniform4fv( u_view_origin, 1, din->localViewOrigin.ToFloatPtr() ); qglUniformMatrix2x4fv( u_diffMatrix, 1, GL_FALSE, RB_GLSL_MakeMatrix( DIFFMATRIX( 0 ), DIFFMATRIX( 1 ) ) ); qglUniformMatrix2x4fv( u_bumpMatrix, 1, GL_FALSE, RB_GLSL_MakeMatrix( BUMPMATRIX( 0 ), BUMPMATRIX( 1 ) ) ); qglUniformMatrix2x4fv( u_specMatrix, 1, GL_FALSE, RB_GLSL_MakeMatrix( SPECMATRIX( 0 ), SPECMATRIX( 1 ) ) ); qglUniformMatrix4fv( u_projMatrix, 1, GL_FALSE, RB_GLSL_MakeMatrix( PROJMATRIX( 0 ), PROJMATRIX( 1 ), wzero, PROJMATRIX( 2 ) ) ); qglUniformMatrix4fv( u_fallMatrix, 1, GL_FALSE, RB_GLSL_MakeMatrix( PROJMATRIX( 3 ), whalf, wzero, wone ) ); /* Lambertian constants */ static const float zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; static const float one[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; static const float negOne[4] = { -1.0f, -1.0f, -1.0f, -1.0f }; switch ( din->vertexColor ) { case SVC_IGNORE: qglUniform4fv( u_color_modulate, 1, zero ); qglUniform4fv( u_color_add, 1, one ); break; case SVC_MODULATE: qglUniform4fv( u_color_modulate, 1, one ); qglUniform4fv( u_color_add, 1, zero ); break; case SVC_INVERSE_MODULATE: qglUniform4fv( u_color_modulate, 1, negOne ); qglUniform4fv( u_color_add, 1, one ); break; } // set the constant colors qglUniform4fv( u_constant_diffuse, 1, din->diffuseColor.ToFloatPtr() ); qglUniform4fv( u_constant_specular, 1, din->specularColor.ToFloatPtr() ); // TODO: shader gamma for GLSL. // set the textures RB_ARB2_BindInteractionTextureSet( din ); // draw it RB_DrawElementsWithCounters( din->surf->geo ); } /* ================== RB_ARB2_DrawInteraction ================== */ static void RB_ARB2_DrawInteraction( const drawInteraction_t *din ) { // load all the vertex program parameters qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_LIGHT_ORIGIN, din->localLightOrigin.ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_VIEW_ORIGIN, din->localViewOrigin.ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_S, din->lightProjection[0].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_T, din->lightProjection[1].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_Q, din->lightProjection[2].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_LIGHT_FALLOFF_S, din->lightProjection[3].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_BUMP_MATRIX_S, din->bumpMatrix[0].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_BUMP_MATRIX_T, din->bumpMatrix[1].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_DIFFUSE_MATRIX_S, din->diffuseMatrix[0].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_DIFFUSE_MATRIX_T, din->diffuseMatrix[1].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_SPECULAR_MATRIX_S, din->specularMatrix[0].ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_SPECULAR_MATRIX_T, din->specularMatrix[1].ToFloatPtr() ); // testing fragment based normal mapping if ( r_testARBProgram.GetBool() ) { qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 2, din->localLightOrigin.ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 3, din->localViewOrigin.ToFloatPtr() ); } static const float zero[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; static const float one[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; static const float negOne[4] = { -1.0f, -1.0f, -1.0f, -1.0f }; switch ( din->vertexColor ) { case SVC_IGNORE: qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_MODULATE, zero ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_ADD, one ); break; case SVC_MODULATE: qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_MODULATE, one ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_ADD, zero ); break; case SVC_INVERSE_MODULATE: qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_MODULATE, negOne ); qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, PP_COLOR_ADD, one ); break; } // set the constant colors qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 0, din->diffuseColor.ToFloatPtr() ); qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 1, din->specularColor.ToFloatPtr() ); // DG: brightness and gamma in shader as program.env[4] if ( r_gammaInShader.GetBool() ) { // program.env[4].xyz are all r_brightness, program.env[4].w is 1.0f / r_gamma float parm[4]; parm[0] = parm[1] = parm[2] = r_brightness.GetFloat(); parm[3] = 1.0f / r_gamma.GetFloat(); // 1.0f / gamma so the shader doesn't have to do this calculation qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, PP_GAMMA_BRIGHTNESS, parm ); } // set the textures RB_ARB2_BindInteractionTextureSet( din ); // draw it RB_DrawElementsWithCounters( din->surf->geo ); } i left in the arb version so you can get an idea of what is going on, also this piece -> /* ================= R_LoadARBProgram ================= */ void R_LoadARBProgram( int progIndex ) { int ofs; int err; char *buffer; char *start = NULL, *end; #if D3_INTEGRATE_SOFTPART_SHADERS if ( progs[progIndex].ident == VPROG_SOFT_PARTICLE || progs[progIndex].ident == FPROG_SOFT_PARTICLE ) { // these shaders are loaded directly from a string common->Printf( "<internal> %s", progs[progIndex].name ); const char *srcstr = ( progs[progIndex].ident == VPROG_SOFT_PARTICLE ) ? softpartVShader : softpartFShader; // copy to stack memory buffer = ( char * )_alloca( strlen( srcstr ) + 1 ); strcpy( buffer, srcstr ); } else #endif // D3_INTEGRATE_SOFTPART_SHADERS { idStr fullPath = "glprogs/"; fullPath += progs[progIndex].name; char *fileBuffer; common->Printf( "%s", fullPath.c_str() ); // load the program even if we don't support it, so // fs_copyfiles can generate cross-platform data dumps fileSystem->ReadFile( fullPath.c_str(), ( void ** )&fileBuffer, NULL ); if ( !fileBuffer ) { common->Printf( ": File not found\n" ); return; } // copy to stack memory and free buffer = ( char * )_alloca( strlen( fileBuffer ) + 1 ); strcpy( buffer, fileBuffer ); fileSystem->FreeFile( fileBuffer ); } if ( !glConfig.isInitialized ) { return; } // // submit the program string at start to GL // if ( progs[progIndex].ident == 0 ) { // allocate a new identifier for this program progs[progIndex].ident = PROG_USER + progIndex; } // vertex and fragment programs can both be present in a single file, so // scan for the proper header to be the start point, and stamp a 0 in after the end if ( progs[progIndex].target == GL_VERTEX_PROGRAM_ARB ) { if ( !glConfig.ARBVertexProgramAvailable ) { common->Printf( ": GL_VERTEX_PROGRAM_ARB not available\n" ); return; } start = strstr( buffer, "!!ARBvp" ); } if ( progs[progIndex].target == GL_FRAGMENT_PROGRAM_ARB ) { if ( !glConfig.ARBFragmentProgramAvailable ) { common->Printf( ": GL_FRAGMENT_PROGRAM_ARB not available\n" ); return; } start = strstr( buffer, "!!ARBfp" ); } if ( !start ) { common->Printf( ": !!ARB not found\n" ); return; } end = strstr( start, "END" ); if ( !end ) { common->Printf( ": END not found\n" ); return; } end[3] = 0; // DG: hack gamma correction into shader. TODO shader gamma for GLSL if ( r_gammaInShader.GetBool() && progs[progIndex].target == GL_FRAGMENT_PROGRAM_ARB && strstr( start, "nodhewm3gammahack" ) == NULL ) { // note that strlen("dhewm3tmpres") == strlen("result.color") const char *tmpres = "TEMP dhewm3tmpres; # injected by dhewm3 for gamma correction\n"; // Note: program.env[21].xyz = r_brightness; program.env[21].w = 1.0/r_gamma // outColor.rgb = pow(dhewm3tmpres.rgb*r_brightness, vec3(1.0/r_gamma)) // outColor.a = dhewm3tmpres.a; const char *extraLines = "# gamma correction in shader, injected by dhewm3\n" // MUL_SAT clamps the result to [0, 1] - it must not be negative because // POW might not work with a negative base (it looks wrong with intel's Linux driver) // and clamping values > 1 to 1 is ok because when writing to result.color // it's clamped anyway and pow(base, exp) is always >= 1 for base >= 1 "MUL_SAT dhewm3tmpres.xyz, program.env[21], dhewm3tmpres;\n" // first multiply with brightness "POW result.color.x, dhewm3tmpres.x, program.env[21].w;\n" // then do pow(dhewm3tmpres.xyz, vec3(1/gamma)) "POW result.color.y, dhewm3tmpres.y, program.env[21].w;\n" // (apparently POW only supports scalars, not whole vectors) "POW result.color.z, dhewm3tmpres.z, program.env[21].w;\n" "MOV result.color.w, dhewm3tmpres.w;\n" // alpha remains unmodified "\nEND\n\n"; // we add this block right at the end, replacing the original "END" string int fullLen = strlen( start ) + strlen( tmpres ) + strlen( extraLines ); char *outStr = ( char * )_alloca( fullLen + 1 ); // add tmpres right after OPTION line (if any) char *insertPos = R_FindArbShaderComment( start, "OPTION" ); if ( insertPos == NULL ) { // no OPTION? then just put it after the first line (usually something like "!!ARBfp1.0\n") insertPos = start; } // but we want the position *after* that line while ( *insertPos != '\0' && *insertPos != '\n' && *insertPos != '\r' ) { ++insertPos; } // skip the newline character(s) as well while ( *insertPos == '\n' || *insertPos == '\r' ) { ++insertPos; } // copy text up to insertPos int curLen = insertPos - start; memcpy( outStr, start, curLen ); // copy tmpres ("TEMP dhewm3tmpres; # ..") memcpy( outStr + curLen, tmpres, strlen( tmpres ) ); curLen += strlen( tmpres ); // copy remaining original shader up to (excluding) "END" int remLen = end - insertPos; memcpy( outStr + curLen, insertPos, remLen ); curLen += remLen; outStr[curLen] = '\0'; // make sure it's NULL-terminated so normal string functions work // replace all existing occurrences of "result.color" with "dhewm3tmpres" for ( char *resCol = strstr( outStr, "result.color" ); resCol != NULL; resCol = strstr( resCol + 13, "result.color" ) ) { memcpy( resCol, "dhewm3tmpres", 12 ); // both strings have the same length. // if this was part of "OUTPUT bla = result.color;", replace // "OUTPUT bla" with "ALIAS bla" (so it becomes "ALIAS bla = dhewm3tmpres;") char *s = resCol - 1; // first skip whitespace before "result.color" while ( s > outStr && ( *s == ' ' || *s == '\t' ) ) { --s; } // if there's no '=' before result.color, this line can't be affected if ( *s != '=' || s <= outStr + 8 ) { continue; // go on with next "result.color" in the for-loop } --s; // we were on '=', so go to the char before and it's time to skip whitespace again while ( s > outStr && ( *s == ' ' || *s == '\t' ) ) { --s; } // now we should be at the end of "bla" (or however the variable/alias is called) if ( s <= outStr + 7 || !R_IsArbIdentifier( *s ) ) { continue; } --s; // skip all the remaining chars that are legal in identifiers while ( s > outStr && R_IsArbIdentifier( *s ) ) { --s; } // there should be at least one space/tab between "OUTPUT" and "bla" if ( s <= outStr + 6 || ( *s != ' ' && *s != '\t' ) ) { continue; } --s; // skip remaining whitespace (if any) while ( s > outStr && ( *s == ' ' || *s == '\t' ) ) { --s; } // now we should be at "OUTPUT" (specifically at its last 'T'), // if this is indeed such a case if ( s <= outStr + 5 || *s != 'T' ) { continue; } s -= 5; // skip to start of "OUTPUT", if this is indeed "OUTPUT" if ( idStr::Cmpn( s, "OUTPUT", 6 ) == 0 ) { // it really is "OUTPUT" => replace "OUTPUT" with "ALIAS " memcpy( s, "ALIAS ", 6 ); } } assert( curLen + strlen( extraLines ) <= fullLen ); // now add extraLines that calculate and set a gamma-corrected result.color // strcat() should be safe because fullLen was calculated taking all parts into account strcat( outStr, extraLines ); start = outStr; } qglBindProgramARB( progs[progIndex].target, progs[progIndex].ident ); qglGetError(); qglProgramStringARB( progs[progIndex].target, GL_PROGRAM_FORMAT_ASCII_ARB, strlen( start ), start ); err = qglGetError(); qglGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, ( GLint * )&ofs ); if ( err == GL_INVALID_OPERATION ) { const GLubyte *str = qglGetString( GL_PROGRAM_ERROR_STRING_ARB ); common->Printf( "\nGL_PROGRAM_ERROR_STRING_ARB: %s\n", str ); if ( ofs < 0 ) { common->Printf( "GL_PROGRAM_ERROR_POSITION_ARB < 0 with error\n" ); } else if ( ofs >= ( int )strlen( start ) ) { common->Printf( "error at end of program\n" ); } else { int printOfs = Max( ofs - 20, 0 ); // DG: print some more context common->Printf( "error at %i:\n%s", ofs, start + printOfs ); } return; } if ( ofs != -1 ) { common->Printf( "\nGL_PROGRAM_ERROR_POSITION_ARB != -1 without error\n" ); return; } common->Printf( "\n" ); } in draw_arb2.cpp and /* ================== RB_SetProgramEnvironment Sets variables that can be used by all vertex programs [SteveL #3877] Note on the use of fragment program environmental variables. Parameters 0 and 1 are set here to allow conversion of screen coordinates to texture coordinates, for use when sampling _currentRender. Those same parameters 0 and 1, plus 2 and 3, are given entirely different meanings in draw_arb2.cpp while light interactions are being drawn. This function is called again before currentRender size is needed by post processing effects are done, so there's no clash. Only parameters 0..3 were in use before #3877 - and in dhewm3 also 4, for gamma in shader. Now I've used a new parameter 22 for the size of _currentDepth. It's needed throughout, including by light interactions, and its size might in theory differ from _currentRender. Parameters 23 and 24 are used by soft particles #3878. Note these can be freely reused by different draw calls. ================== */ void RB_SetProgramEnvironment( bool isPostProcess ) { float parm[4]; int pot; if ( !glConfig.ARBVertexProgramAvailable ) { return; } #if 0 // screen power of two correction factor, one pixel in so we don't get a bilerp // of an uncopied pixel int w = backEnd.viewDef->viewport.x2 - backEnd.viewDef->viewport.x1 + 1; pot = globalImages->currentRenderImage->uploadWidth; if ( w == pot ) { parm[0] = 1.0; } else { parm[0] = ( float )( w - 1 ) / pot; } int h = backEnd.viewDef->viewport.y2 - backEnd.viewDef->viewport.y1 + 1; pot = globalImages->currentRenderImage->uploadHeight; if ( h == pot ) { parm[1] = 1.0; } else { parm[1] = ( float )( h - 1 ) / pot; } parm[2] = 0; parm[3] = 1; qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, 0, parm ); #else // screen power of two correction factor, assuming the copy to _currentRender // also copied an extra row and column for the bilerp int w = backEnd.viewDef->viewport.x2 - backEnd.viewDef->viewport.x1 + 1; pot = globalImages->currentRenderImage->uploadWidth; parm[0] = ( float )w / pot; int h = backEnd.viewDef->viewport.y2 - backEnd.viewDef->viewport.y1 + 1; pot = globalImages->currentRenderImage->uploadHeight; parm[1] = ( float )h / pot; parm[2] = 0; parm[3] = 1; qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, 0, parm ); #endif qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 0, parm ); // window coord to 0.0 to 1.0 conversion parm[0] = 1.0 / w; parm[1] = 1.0 / h; parm[2] = 0; parm[3] = 1; qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, 1, parm ); // DG: brightness and gamma in shader as program.env[4]. TODO: shader gamma for GLSL if ( r_gammaInShader.GetBool() ) { // program.env[4].xyz are all r_brightness, program.env[4].w is 1.0/r_gamma if ( !isPostProcess ) { parm[0] = parm[1] = parm[2] = r_brightness.GetFloat(); parm[3] = 1.0f / r_gamma.GetFloat(); // 1.0f / gamma so the shader doesn't have to do this calculation } else { // don't apply gamma/brightness in postprocess passes to avoid applying them twice // (setting them to 1.0 makes them no-ops) parm[0] = parm[1] = parm[2] = parm[3] = 1.0f; } qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, PP_GAMMA_BRIGHTNESS, parm ); } // #3877: Allow shaders to access depth buffer. // Two useful ratios are packed into this parm: [0] and [1] hold the x,y multipliers you need to map a screen // coordinate (fragment position) to the depth image: those are simply the reciprocal of the depth // image size, which has been rounded up to a power of two. Slots [3] and [4] hold the ratio of the depth image // size to the current render image size. These sizes can differ if the game crops the render viewport temporarily // during post-processing effects. The depth render is smaller during the effect too, but the depth image doesn't // need to be downsized, whereas the current render image does get downsized when it's captured by the game after // the skybox render pass. The ratio is needed to map between the two render images. parm[0] = 1.0f / globalImages->currentDepthImage->uploadWidth; parm[1] = 1.0f / globalImages->currentDepthImage->uploadHeight; parm[2] = static_cast<float>( globalImages->currentRenderImage->uploadWidth ) / globalImages->currentDepthImage->uploadWidth; parm[3] = static_cast<float>( globalImages->currentRenderImage->uploadHeight ) / globalImages->currentDepthImage->uploadHeight; qglProgramEnvParameter4fvARB( GL_FRAGMENT_PROGRAM_ARB, PP_CURDEPTH_RECIPR, parm ); // // set eye position in global space // parm[0] = backEnd.viewDef->renderView.vieworg[0]; parm[1] = backEnd.viewDef->renderView.vieworg[1]; parm[2] = backEnd.viewDef->renderView.vieworg[2]; parm[3] = 1.0; qglProgramEnvParameter4fvARB( GL_VERTEX_PROGRAM_ARB, 1, parm ); } in draw_common.cpp. note the TODO sections. biggest problem right now is probably in R_LoadARBProgram which is not used by the GLSL backend at all since it only handles the interaction shaders atm. it does have its own version of this function but it is lobotomized and only used if for some reason a user wants to use an external shader.it is here in draw_arb2.cpp -> /* ================== GL_GetGLSLFromFile ================== */ static GLchar *GL_GetGLSLFromFile( GLchar *name ) { idStr fullPath = "glprogs130/"; fullPath += name; GLchar *fileBuffer; GLchar *buffer; if ( !glConfig.isInitialized ) { return NULL; } fileSystem->ReadFile( fullPath.c_str(), reinterpret_cast<void **>( &fileBuffer ), NULL ); if ( !fileBuffer ) { common->Printf( "%s: File not found, using internal shaders\n", fullPath.c_str() ); return NULL; } // copy to stack memory (do not use _alloca here!!! it breaks loading the shaders) buffer = reinterpret_cast<GLchar *>( Mem_Alloc( strlen( fileBuffer ) + 1 ) ); strcpy( buffer, fileBuffer ); fileSystem->FreeFile( fileBuffer ); common->Printf( "%s: loaded\n", fullPath.c_str() ); return buffer; } as you can see it is somewhat more empty than the arb shaders version, but would probably suffice for the same thing.
-
Unfortunately, I don’t think this is possible—at least not with the way the mod is currently implemented. All the models and animations are tied to the “unarmed” weapon entity, not the player entity. In order to have the legs and the rest of the body, we would need to add the models and animations to the player entity and modify the source code to allow the body to be visible, kind of like how it's done here. I did initially try this method but realized that the existing model/animations are a bit of a mess and it would be a LOT of work to make it look good. Also, I chose to do it this way to allow the mod to be compatible with everything, since the script and def files for the "unarmed" entity aren’t modified by any FMs (as far as I know—I haven’t tested them all). I assumed that someone may have tweaked the player files for their FM, as those are far more relevant than the "unarmed" files (which are essentially blank in the vanilla game). If I had overwritten them, I’d risk breaking their mission. There has been some discussion in the forums about having full body awareness and there didn't seem to be a lot of interest in it. Plus, it could end up being immersion-breaking. Imagine standing on a small rope and then looking down, only to see your feet just kind of floating in midair.
-
It would be nice to have a bit more universal reaction to game bugs. Currently sometimes in Linux you get a crash, while in Windows it doesn't while there obviously is something going wrong.
- 25 replies
-
Maybe you can upload a linux version to moddb someday?