Commit Graph

  • f2cea2847d Allow console test scene to control the base game that is being used Nico de Poel 2021-07-20 22:02:00 +0200
  • da4bce4958 Added a mock FMOD project to produce the stub static libraries that we need to link against. UniQuake native library now compiles for PS4, and with a few tweaks to the Unity code it now actually runs on a PS4 devkit as well! Only thing not working is sound effects in FMOD. Since we're not using the full set of FMOD libraries yet, I'm not worrying too much about that one at the moment. Nico de Poel 2021-07-20 21:36:04 +0200
  • dfb083a800 Added a small shim library to allow access to the PS4 kernel's dynamic library functions, which are used to dynamically linking and unlink against the native engine library. I'm not sure if there isn't an easier way to do this, but this works for now. Nico de Poel 2021-07-20 17:43:17 +0200
  • bd28bcac6b Updated Unity project to allow building for PS4 and running on real hardware. The engine plugin isn't there yet, so it won't do much, but it starts and FMOD works. Nico de Poel 2021-07-20 17:08:27 +0200
  • e485caa605 First modifications to make the engine code compile for PS4 (Orbis SDK). All the code compiles, but we're missing the FMOD linker libraries at the moment. Nico de Poel 2021-07-20 15:47:21 +0200
  • 604cc15eaf Replaced the OpenGL headers in portable mode with bog standard ones taken from the Mesa3D project. This removes the last dependencies on SDL code and will help in the pursuit of true portability. Nico de Poel 2021-07-20 14:07:20 +0200
  • cd7423ae34 Use ref when passing structs by pointer through P/Invoke. This fixes positions and angles not being updated correctly in 32-bit builds. This was not a problem in 64-bit mode (probably because an entire vec3_t fits into a single register and the call is optimized as such) but it is in 32-bit mode. Nico de Poel 2021-07-20 12:23:10 +0200
  • c89755e853 Fixed compilation error in 32-bit portable mode, because the multi-texture stub functions aren't actually function pointers as was previously declared. Nico de Poel 2021-07-20 11:42:26 +0200
  • 722c79ab8b Simplified call to create world material, which is just one method now that takes surface flags. The implementation will figure out which template material to use. Nico de Poel 2021-07-19 20:44:52 +0200
  • d73d86ce11 Keep hold of surface flag when converting brush model surfaces, and use this to identify liquid surfaces during material creation. Liquids now have their own material with the option to apply alpha blending depending on the type of liquid. Also includes some first bits of particle systems. Not actually used yet. Nico de Poel 2021-07-19 18:36:41 +0200
  • 59a64473b0 Marshal only one polygon per brush model surface for conversion into a Unity mesh. Any subsequent polygons are pre-tessellated versions meant for the water warping effect, which we won't need as this will be handled by GPU tessellation. Fixed garbled water surface caused by having two polygon meshes overlapping. Nico de Poel 2021-07-19 16:02:56 +0200
  • 0899855b51 Updated project to Unity 2020.3.14 and fixed some minor issues after upgrade Nico de Poel 2021-07-18 19:24:43 +0200
  • b3175ebb3b Reworked visual style setup, reducing entity materials to just one material for both alias models and brush models, and turning material creation into a separate step. This makes it more obvious when new materials are created, and allows for more potential customization in sub-classes. Nico de Poel 2021-07-18 19:04:39 +0200
  • c5cefca10d Minor fixes for compatibility issues with QRally: - Handle null frame names when matching with animation regex - Default to skin 0 when the provided skin number is out of range - Convert polygon vertices directly to Unity coordinate positions Nico de Poel 2021-07-18 13:26:15 +0200
  • a8defed5de Allow game and viewmodel layers to be specified at the level of each UniQuake instance. This will allow multiple instances of the game to run side-by-side with each their own rendering layers. Nico de Poel 2021-07-18 00:24:15 +0200
  • 4adc71eca8 Added layer masks to separate game and view model, and added a secondary overlay camera to render the view model separately after the main pass. Fixes gun view model clipping into walls. Nico de Poel 2021-07-18 00:13:55 +0200
  • 95a89be509 Set and remove view entity model; this makes the weapon model appear correctly in first-person view Nico de Poel 2021-07-17 16:43:32 +0200
  • a479d7246b Reworked coordinate and rotation conversion from Quake to Unity. It still feels weird, but entity models are now seemingly oriented correctly, and some strange edge cases with entities rotating in the wrong direction have been cleared up. Nico de Poel 2021-07-17 16:36:27 +0200
  • c9271a7772 Cache brush surface texture numbers instead of re-marshaling them on each access. Fixes textures getting mixed up on brush model entities after map switch. Nico de Poel 2021-07-16 15:44:55 +0200
  • 4b5b30a81b Detect fixed poses and completely disable animation blending in that case. Fixes entities sometimes reappearing in the wrong pose (e.g. a dead enemy) when lerping is enabled. Nico de Poel 2021-07-15 17:44:28 +0200
  • cd03b692fd Set skin before setting initial entity model. Fixes wrong skin on some objects that don't receive a later skin update message. Nico de Poel 2021-07-15 17:27:14 +0200
  • 3c2ca26a99 Properly destroy brush model child game objects when clearing an entity's model. Fixes explosive barrels not disappearing when blown up. Nico de Poel 2021-07-15 15:59:28 +0200
  • fab7f6503f Allow entity skin number to be passed and apply the corresponding textures to the entity material Nico de Poel 2021-07-15 15:48:55 +0200
  • c12ff0c503 Organize alias model textures into skins and animation frames Nico de Poel 2021-07-15 14:24:25 +0200
  • 0073dddfb1 Enable _EMISSION keyword on materials included in the standard visual style. Fixes fullbright emissive textures not appearing correctly in standalone builds. Nico de Poel 2021-07-14 20:10:49 +0200
  • 67980400ef Apply full bright textures to brush models. This is really starting to look a lot like Quake now! Nico de Poel 2021-07-14 14:56:34 +0200
  • fdaee3321f Start on organization of textures into texture sets, and implemented a basic test for alias model entities, which are now properly textured including fullbright (emissive) textures. Nico de Poel 2021-07-14 13:58:03 +0200
  • 2e35a148b8 Use visual style reference to set up world and entity renderers and textures. With this we can clear out a LOT of debug code that was kept around for reference. Nico de Poel 2021-07-14 11:13:47 +0200
  • e4903ca391 Made a start on scriptable visual styles, which encompasses material templates, mesh renderer configuration and texture assignment. The default implementation is based on the GLQuake look, but everything can be overridden to create completely new visual styles. Nico de Poel 2021-07-14 10:46:15 +0200
  • a52b497ccb Reworked entity renderer assignment: both MeshRenderer and SkinnedMeshRenderer are created at the same time on init, and are enabled/disabled on demand. Also: destroy overridden textures, and disable lerping on alias model animator by default. Nico de Poel 2021-07-14 10:44:00 +0200
  • a2b8d32c00 Implemented automatic animating of group frame alias models, using the existing AliasModelAnimator component. Nico de Poel 2021-07-12 15:25:03 +0200
  • 39daacceff Added support for static entities. In the context of UniQuake, these are just like regular entities, but they are only assigned a model and transform once at map load. Nico de Poel 2021-07-12 15:19:30 +0200
  • 5390483b0b Upload non-world brush models and allow them to be assigned to entities. It's not terribly pretty but it (mostly) works. There still seems to be an issue with texture assignment on subsequent map loads. Nico de Poel 2021-07-12 15:12:37 +0200
  • 883bc26026 Keep mesh data for alias models in CPU RAM (i.e. read/write) because apparently that's necessary to make them visible on skinned mesh renderers in standalone builds. Nico de Poel 2021-07-12 13:04:54 +0200
  • c14faf2666 Dynamically create either MeshRenderer/MeshFilter or SkinnedMeshRenderer based on whether the model being assigned is animated or not. Gets rid of warnings on un-animated SkinnedMeshRenderers, and removes unnecessary components on brush model entities. Nico de Poel 2021-07-12 12:48:23 +0200
  • 0dc5c1a14b Create world submodel game objects and link them to entities, allowing doors and buttons and such to work properly. Also don't bother linking the view entity to a model. Nico de Poel 2021-07-12 12:15:06 +0200
  • 9345b0d15c Allow GameModule to directly access entities. Removes some pointless indirection and boilerplate code in GameState. Nico de Poel 2021-07-10 14:51:29 +0200
  • 66c62001d0 Squashed a bunch of bugs in the alias model animation system and integrated transform/animation updates into the alias model lerping system. Entities are now correctly animated, yay! Nico de Poel 2021-07-10 14:05:00 +0200
  • 1a1c219bf6 Removed frame number stuff from SetEntityModel since it's not producing the correct values. Correctly detect non-world brush models and sprites, although they're not implemented yet. Nico de Poel 2021-07-09 14:37:20 +0200
  • e6fd7b83ae First bits of entity logic: assign alias models, update transform and animation, remove entity. Still lots of problems to solve, but it's starting to do something. Nico de Poel 2021-07-09 12:56:16 +0200
  • 453664031c Moved creation of game objects for the world to GameState, which is where the bridge between Quake's game logic and Unity's game objects will happen. Also includes destruction of said game objects, so that the world is properly destroyed and recreated on map change. Nico de Poel 2021-07-08 16:44:25 +0200
  • 2c6f5bed1c Destroy game assets when the game is shut down. We can still inspect assets in-editor by using the Pause function. Nico de Poel 2021-07-08 16:33:04 +0200
  • a886f3d993 First steps in reorganizing the project, so that assets and game state are managed separately from the interop modules. This will allow for a clearer picture of where gameplay-related interactions should take place, and how entities and such should be linked to their associated assets. Nico de Poel 2021-07-05 15:37:52 +0200
  • 45bfa16950 Use emissive property on default material to simulate fullbright pixels, instead of adding a second unlit material Nico de Poel 2021-06-25 15:50:47 +0200
  • f944b7d4ff Moved some files around Nico de Poel 2021-06-25 15:49:32 +0200
  • 3de63008b7 Further cleaned up BrushModel code and moved creation of debug game objects into RenderModule, where the models can be linked to their textures now as well. The result: properly textured maps are being rendered! Nico de Poel 2021-05-12 23:30:01 +0200
  • 331aa4bccc Some cleanup and organization: - Removed a bunch of dead testing code - Provide a camera to the UniQuake script which the render module can then manipulate - Removed unused fields from QModel, which also fixes yet another text decoding issue in Zerstörer (the ö appears in the map's entity data) - Shut down Quake engine OnApplicationQuit, which allows clean shutdown using the Play button in the Unity editor - Use QTexture pointer as key for grouping surfaces, which removes the need for a bunch of redundant data marshaling - Added disposal function for brush models Nico de Poel 2021-05-11 22:52:46 +0200
  • 15e3faa753 Added callback function to allow Quake to send the view parameters to Unity, and apply them to the main camera. This makes actual movement through the map in Unity possible. Nico de Poel 2021-05-10 20:52:07 +0200
  • ebfce9863b Allow additional arguments to be passed from debug UI, giving me a few more testing options Nico de Poel 2021-05-10 12:37:14 +0200
  • 32897138b5 Build a single giant mesh for every texture-lightmap group of surfaces. Greatly improves rendering performance. Nico de Poel 2021-05-10 11:52:29 +0200
  • 5598ceeeed Group surfaces based on texture and lightmap, while keeping them grouped inside each brush submodel Nico de Poel 2021-05-10 11:36:20 +0200
  • 8fcbac51a4 Fixed some minor issues related to Unity update Nico de Poel 2021-05-10 00:15:19 +0200
  • bb51a24080 Updated project to Unity 2020.3.7 Nico de Poel 2021-05-09 23:58:49 +0200
  • e753e1cc34 Recreate the BSP tree structure through a GameObject hierarchy. This gives a bit more insight into the structure of the map data. Nico de Poel 2021-05-09 17:46:45 +0200
  • a615495c25 Recursively traverse the BSP tree and create surface meshes per node Nico de Poel 2021-05-09 17:18:51 +0200
  • 11c3b2d826 Defined structs for BSP SubModels and Nodes, which will allow for a more systematic conversion to Unity meshes. Also moved more marshalling code into the data classes, which seems like a more natural place. Nico de Poel 2021-05-09 14:54:51 +0200
  • 211c64a879 "Fixed" coordinate conversion from Quake to Unity, by swizzling Y and Z coordinates during vector conversion. There seems to be a lot of confusion and disagreement about Quake's coordinate system, but this setup is simple and looks correct both in-game and in-editor, and the world isn't mirrored anymore either. Nico de Poel 2021-05-09 11:39:11 +0200
  • 9ce90431f4 Reapplied model origin offset, which now actually makes sense Nico de Poel 2021-04-25 19:53:19 +0200
  • 403e7d0eb4 Added struct definitions and marshaling code to obtain texture numbers for brush model surfaces Nico de Poel 2021-04-25 19:45:53 +0200
  • 05731a8e09 Removed redundant division in QTriVertex conversion, and scaled up the rest of the test scene to match. Fixes scale of imported alias models when compared to the world brush model. Nico de Poel 2021-04-25 19:44:33 +0200
  • 89f3600608 Reconstruct brush model data based on glpoly_t data generated by GLQuake. We can now successfully display BSP maps in Unity! Nico de Poel 2021-04-25 17:11:29 +0200
  • 3988db5f8e Defined a bunch more data for brush models and initial marshaling of model data Nico de Poel 2021-04-25 15:49:34 +0200
  • 9dc4eb17d0 Added URP Unlit shader to shader variants collection Nico de Poel 2021-04-23 12:25:04 +0200
  • e0302d2389 Added more cruft to the ignore list Nico de Poel 2021-04-23 12:20:24 +0200
  • a052c43342 Renamed stub_vidgl to vid_uniquake because it contains more than just some stubs (and will get more things added in the future) Nico de Poel 2021-04-23 12:19:19 +0200
  • 02a8e6b844 Fixed non-smoothed animations not actually landing on the key frames Nico de Poel 2021-04-23 12:03:37 +0200
  • eaaac619b3 Change the Z-position of models in the test scene every time a RenderModule is instantiated, so that subsequent runs of Quake don't cause all of the uploaded models to overlap Nico de Poel 2021-04-23 11:46:25 +0200
  • 4a7155bb1b Fixed marshaling of multi-dimensional arrays of QGLTextures, and add a second unlit material layer with additive blending for models that use fullbright textures Nico de Poel 2021-04-23 01:07:02 +0200
  • e8e04b666d Allow run-time switching between lerped animations and keyframe-only animation, and made the playback speed configurable Nico de Poel 2021-04-23 01:05:17 +0200
  • 3da2d4ba59 Made a few tweaks to make texture uploading work properly in headless mode Nico de Poel 2021-04-22 16:30:35 +0200
  • e70d363998 Implemented uploading of skin texture data to Unity, and linking loaded alias models to their primary skin texture Nico de Poel 2021-04-22 16:08:21 +0200
  • 10e54f10ca Added a separate code path for converting frame group animations, and renamed some variables to use the correct frame/pose terminology Nico de Poel 2021-04-22 10:33:02 +0200
  • ba691ce326 Fixed vid and modestate not being visible in SDL+OpenGL builds Nico de Poel 2021-04-22 10:13:09 +0200
  • 428eebb941 Pass along alias frame type and correctly count the total number of poses in a model, so that the correct number of pose vertices are marshaled and we can identify models that use group frame animations instead of typical single frames. Quake's model formats are weird. Nico de Poel 2021-04-22 10:12:34 +0200
  • 0978e0490e - Added the option to shut down a UniQuake instance from outside of Quake itself. Useful for when Quake is running headless. - Added shader variant collection to allow use of the URP simple lit shader in a standalone build Nico de Poel 2021-04-21 18:07:50 +0200
  • 3361ea2114 Added some missing lines and made a few tweaks to allow Quake to run headless without crashing Nico de Poel 2021-04-21 18:01:19 +0200
  • a2e16eaf89 Fixed division by zero caused by uninitialized vid struct Nico de Poel 2021-04-21 17:35:44 +0200
  • d271f9b7e2 Stubbed out the remaining OpenGL calls, disabled everything SDL, ifdef'ed out OpenGL 2.0-related code, and added a new stub for remaining VID_ and GL_ calls. Portable configuration compiles now, though it still crashes at run-time. Nico de Poel 2021-04-21 17:28:27 +0200
  • 47f6de732d Merge branch 'master' into stubs Nico de Poel 2021-04-21 16:48:12 +0200
  • 2fc928907b Added empty implementation of input module for UniQuake, to take over duties from SDL Nico de Poel 2021-04-21 16:47:25 +0200
  • 00c397868b Merge branch 'master' into stubs Nico de Poel 2021-04-21 16:03:59 +0200
  • 2e53e62ef8 Removed Windows-specific IPX and TCP/IP LAN drivers from the project and replaced them with a UniQuake net implementation that doesn't actually have any LAN drivers, i.e. only local loopback connections will work. Nico de Poel 2021-04-21 15:28:37 +0200
  • 56bc6c7ba6 Added empty stub implementations of OpenGL calls used by Quake, as an alternative way of removing the dependencies on SDL & OpenGL Nico de Poel 2021-04-21 15:12:44 +0200
  • c2f105a604 Fixed a rather embarrassing pointer error, which by sheer luck just happened to not cause any issues Nico de Poel 2021-04-21 14:11:41 +0200
  • 96d2a1fe7b First setup to upload brush models (specifically: the world model) from Quake to Unity. Updated the QWorld class to include the fields added by QuakeSpasm. Nico de Poel 2021-04-19 12:17:06 +0200
  • dec2be66c6 Keep track of already duplicated vertices and reuse those for triangles that need them. Fixes vertex counts being way too high because seam vertices would get duplicated multiple times. Nico de Poel 2021-04-18 12:17:33 +0200
  • a19d9b546e Added disposal code for alias models Nico de Poel 2021-04-18 01:04:00 +0200
  • 08c16f71a1 Moved importing and conversion of mesh data into AliasModel class. Also: - Do not create blend shapes if a model does not have any animations - Handle cases when mesh does not have any blend shapes Nico de Poel 2021-04-18 00:46:37 +0200
  • 4d974bf6cd Solved the UV correcting problem for backside triangles by pre-processing the model input data, whereby vertices on the seam are duplicated and adjusted. The rest of the mesh conversion process then remains as it was. Nico de Poel 2021-04-18 00:22:31 +0200
  • ab880f9cfb Added a custom marshaler to decode screen texts received from Quake, which uses single-byte characters and a non-standard character set. Fixes string conversion errors and a fatal exception whenever the "ö" character is printed in the Zerstörer mod. Nico de Poel 2021-04-17 19:32:14 +0200
  • e8a3313d88 Some cleanup Nico de Poel 2021-04-17 13:46:45 +0200
  • 4138290723 Further mesh research: create an individual mesh for each animation sequence, with a single blend shape animation per mesh. Added an AliasModel class to manage meshes and find the correct animations. With this we can smoothly animate looped animation cycles. Nico de Poel 2021-04-17 12:33:29 +0200
  • 61a845338e Further mesh conversion research: animation frames are now converted into blend shape animations, which can be played back either with or without smoothing. Nico de Poel 2021-04-16 20:17:22 +0200
  • 834ff9a794 First test converting models from Quake into Unity meshes, including normals and UVs. It's still far from perfect (back side UVs are not handled at all yet) but it's a good demonstration of what will be possible. Nico de Poel 2021-04-16 17:25:37 +0200
  • ccaf57ec02 Added some legal text and fixed FMOD callbacks for 32-bit compiles Nico de Poel 2021-04-16 11:41:30 +0200
  • 7f358f5188 Added back in acknowledgements. Seems fair. Nico de Poel 2021-04-15 17:19:40 +0200
  • 99b09dc854 Moved some global variables around for portability Nico de Poel 2021-04-15 16:48:47 +0200
  • 75b9427296 Fixed compatibility issues with Scourge Done Slick: - Implement Sys_DoubleTime with a clock function that keeps running and doesn't update only once per frame. Fixes infinite loop in Host_ShutdownServer. - Readded missing "play" and "playvol" console commands. - Ignore console messages that contain only whitespace. Nico de Poel 2021-04-15 13:27:18 +0200
  • bf4a09cfd7 FMOD will copy the sound buffer into its own memory when FMOD_CREATESAMPLE is used, so we don't need to keep the loaded sound files in Hunk memory anymore. Nico de Poel 2021-04-14 23:25:58 +0200
  • d2184af9b1 Resolved compiler errors related to disabling SDL. Now we've just got a ton of linker errors to deal with... Nico de Poel 2021-04-14 21:12:12 +0200