Commit graph

75 commits

Author SHA1 Message Date
Bart Trzynadlowski 908d979cd7 Flattened out nested if-statements in new engine's fragment shader to improve compatibility with older GPUs (e.g., NVS 300) 2016-04-22 23:46:49 +00:00
Ian Curtis 58d187e59a parse viewports in normal order 2016-04-19 22:05:12 +00:00
Ian Curtis df9fefd064 walk siblings before children, fixes some of the transparency drawing issues in ocean hunter 2016-04-18 22:25:05 +00:00
Ian Curtis 057ee94210 simplify 2016-04-18 14:06:10 +00:00
Ian Curtis a5301efed6 avoid cast warning 2016-04-17 00:02:16 +00:00
Ian Curtis c4dc96ef71 simplify list code 2016-04-17 00:00:51 +00:00
Bart Trzynadlowski 34d4d8981d Fixed 8-bit texture decoding in legacy 3D engine. Contour mode/alpha still needs to be made consistent (as much as possible) with new engine. 2016-04-15 04:26:42 +00:00
Ian Curtis f52cb3c491 tweak frustum planes 2016-04-08 23:29:31 +00:00
Bart Trzynadlowski 22907b033f Fixes for non-Windows builds: Makefile updated and fixed header files in Vec.cpp 2016-04-05 04:30:52 +00:00
Ian Curtis 5f68544641 revert viewport code 2016-04-04 10:50:05 +00:00
Ian Curtis ecea4cad56 change tex format 4 2016-04-04 10:21:34 +00:00
Bart Trzynadlowski 38d5d14157 Clamping diffuse+ambient light intensity to 1.0 (legacy engine) 2016-04-04 04:32:10 +00:00
Bart Trzynadlowski faf5f9cf48 Added a comment about viewports 2016-04-04 04:31:26 +00:00
Bart Trzynadlowski 6d9426759b Fixed texture enable bit (fixes Star Wars light sabers and Sega Rally 2 cones) and added a hack for (and more comments about) color modulation. Scud Race, Sega Rally 2, LA Machineguns, etc. look correct now, but Fighting Vipers 2 shadows are no longer dark enough. Other bugs may exist. 2016-04-04 03:50:24 +00:00
Bart Trzynadlowski 1d4f5c871d Fixed Types.h include 2016-04-04 03:43:55 +00:00
Ian Curtis d155fbd6e4 rgb values were swapped for paletted colours 2016-04-03 23:21:50 +00:00
Ian Curtis 3bc2794b0a Use the correct texture enable bit 2016-04-03 16:10:40 +00:00
Bart Trzynadlowski 3c8352f4ca Added a comment: observation of Star Wars and Scud Race color modulation issues. 2016-04-03 04:09:06 +00:00
Ian Curtis 688af26846 Possible work around for slightly incorrect viewport positions in ECA and harley 2016-04-02 22:13:59 +00:00
Ian Curtis c7412828d4 Use proper texture wrapping mode for 2d. Stops garbage down the top and left sides. Should really use NPOT texture. 2016-04-02 12:23:46 +00:00
Ian Curtis 7e7847bc83 Allow asymmetric projection matrices. Fixes a bunch of missing effects and bad camera angles in harley. 2016-03-31 09:27:42 +00:00
Ian Curtis aee89390ba add LOD table data. Maybe we can get clipping planes out of these 2016-03-28 20:11:46 +00:00
Ian Curtis e79b241a49 properly mark dynamic meshes as such 2016-03-28 19:58:36 +00:00
Ian Curtis e1278f4451 allow 8 bit mono textures to be contour textures, fixes a bunch of missing transparency in harley la riders 2016-03-27 08:39:40 +00:00
Ian Curtis ffaed8ae32 clear the rom mesh buffer 2016-03-26 22:48:51 +00:00
Ian Curtis 4992e59673 Cache rom models, for better performance. 2016-03-26 22:44:26 +00:00
Ian Curtis 8488f22ac5 2016-03-24 13:26:28 +00:00
Ian Curtis 0327db246f WIP 2016-03-24 13:17:17 +00:00
Ian Curtis 23172c9aec fix for bad matrix with NaN 2016-03-23 01:05:02 +00:00
Ian Curtis f031e5d095 finish front/back face culling code based on matrix determinant. Optimised opengl to avoid redundant state changes. 2016-03-22 23:39:59 +00:00
Ian Curtis 8ea5978093 fix parenthesis error 2016-03-22 21:59:51 +00:00
Ian Curtis e7eb912eaa add maths functions 2016-03-22 13:47:28 +00:00
Ian Curtis 93f6b01e0b Update project to vs 2013. Clean compile warnings 2016-03-22 12:30:23 +00:00
Ian Curtis ce99c47f8a Remove double copy of shaders 2016-03-22 11:40:24 +00:00
Bart Trzynadlowski 3627213577 Fixed compiler warnings, whitespace, and moved local variable declarations to site of assignment 2016-03-22 03:43:31 +00:00
Bart Trzynadlowski 3afe3cf1a7 Moved 2016-03-21 23:27:30 +00:00
Bart Trzynadlowski d61b01ab6f Removing legacy 3D engine files that were already moved to Graphics/Legacy3D 2016-03-21 23:12:17 +00:00
Bart Trzynadlowski 34301e97e1 Adding new 3D engine by Ian Curtis. Old engine moved to Graphics/Legacy3D/. 2016-03-21 04:10:14 +00:00
Bart Trzynadlowski f1e93bcd8f - Fixed Win32 GCC Makefile.
- Reverted Nik's polygon palette index change in Models.cpp. Subtracting 1 was breaking Scud Race.
- Added an explicit typecast in Inputs.cpp, which GCC requires for some reason.
2012-07-16 02:27:55 +00:00
Nik Henson 183dca563d Committing various small updates that have been hanging around in my source tree for a while now:
- Added 'crosshairs' command line and config option.
- Added 'vsync' command line and config option (so far only tested on NVidia cards on Windows 7 - other graphics drivers, O/Ss or driver settings may simply chose to ignore this).
- Added fullscreen toggle within game using Alt+Enter key combination.
- Added framework for lamp outputs and 'outputs' command line and config option.  So far only the lamps for driving games are hooked up in the emulator (others to be added later).
- Added an initial outputs implementation for Windows that sends MAMEHooker compatible messages (-outputs=win to enable)
- Fixed fps calculation in Main.cpp that was producing incorrect results and so giving the impression that frame throttling wasn't working properly when in fact it was.
- Fixed palette indexed colours as the index was always off by one, causing incorrect colours in various games, eg drivers' suits and flashing Start sign in Daytona 2.
- Altered caching of models so that models with palette indexed colours use the dynamic cache rather than the static one.  This is so that changes in palette indexed colours appear on screen, eg the flashing Start sign on the advanced course of Daytona 2 (although currently the START message itself is not visible due to other problems with texture decoding).
- Fixed small bug in TileGen.cpp which meant both palettes were being completely recomputed pretty much with every frame.  This was a significant performance hit, particularly as palette recomputation is currently being done in SyncSnapshots (it should be moved out of here at some point, although for now it's no big deal).
- Made sure all OpenGL objects and resources are deleted in Render2D/3D destructors, in particular the deleting of the VBO buffer in DestroyModelCache.
- Made sure that GLSL uniforms are always checked to see if they are bound before using them in order to stop unecessary (but harmless) GL errors.
- Altered the default texture sheet handling to use a single large GL texture holding multiple Model3 texture sheets rather than multiple GL textures as before (if required, the old behaviour can still be selected with the mulisheet fragment shader).  I believe this fixes the disappearing crosshairs/corrupt GL state problem which the multisheet fragment shader seemed to be triggering somehow.
- Fixed a bug in debugger which meant memory watches were not triggering properly
2012-07-15 21:04:46 +00:00
Bart Trzynadlowski 93b71c8429 Applied Nik's fix for cyclical scene graphs. Improves Harley Davidson, Ski Champ, Emergency Call Ambulance, and Ocean Hunter. 2012-03-31 19:41:55 +00:00
Bart Trzynadlowski 1bce444668 Brought in the near clipping plane for Step 1.5+. Objects close to camera are no longer cut-off (e.g., driver arms and steering wheels in cockpit views). Note: This change should probably be applied to Step 1.0 as well in the future. For now, I am leaving the old distance because Step 1.0 coordinates need closer investigation. Bringing in the near clipping plane extends the view frustum depth and will worsen Z-buffer accuracy. Be on the lookout for Z-fighting that did not previously exist. 2012-02-28 04:34:32 +00:00
Bart Trzynadlowski 69610ef8dd Added a clear() method to VBORef and removed unsafe memset() clear. 2012-02-25 06:36:04 +00:00
Nik Henson 3b41239cfb This update fixes (hopefully) the last of the texture upload lags that were affecting some games, in particular Daytona 2 and Spikeout.
To achieve this UploadTextures no longer clears the model cache when called.  Instead the cache is kept in-tact (which should help improve cache hits) and all textures referenced by models being rendered are (re-)decoded with every frame.
To help with tracking all the unique texture references contained in a model a new class TextureRefs has been added.
2012-02-23 23:20:21 +00:00
Bart Trzynadlowski 16e4fcab06 Forgot to update to-do list in previous revision. Added a comment to mark CRender2D::WriteVRAM() as deprecated. 2012-02-23 00:12:46 +00:00
Bart Trzynadlowski fcf1d955a9 Previous "optimization" contained a mistake and made things worse. Removed unnecessary clear of the bottom layer buffer. Now, if there is no bottom layer, it will not be displayed at all and glClear(GL_COLOR_BUFFER_BIT) is used instead. 2012-02-22 01:34:42 +00:00
Bart Trzynadlowski c085be59af Further optimization/simplification of the 2D renderer's main loop. 2012-02-20 04:09:11 +00:00
Bart Trzynadlowski 453df4f5f5 - Finished cleaning up and optimizing the 2D renderer.
- Fixed up color offset register support for new 2D rendering system. Now maintains 2 computed palettes for layers A/A' and B/B'.
- Fixed a minor bug in InitPalette(); VRAM was not being typecast properly.
- Fixed specular lighting bug that occurred on some OpenGL drivers because integers were not being interpreted as floats in the vertex shader.
- Began to update copyright date in some files.
- Graphics modules now use the C++-style names for C standard library headers (e.g., stdio.h -> cstdio) consistent with the rest of Supermodel.
2012-02-20 03:45:48 +00:00
Bart Trzynadlowski 0257f1f9e8 Contour processing (discarding of pixels when alpha==0) enabled for A4L4 texture formats. Improves smoke and fire in Daytona 2. 2012-02-17 07:45:50 +00:00
Bart Trzynadlowski 79d24d403f - NOTE: In this revision (possibly earlier), I've started to notice some intermittent geometry glitches in Spikeout and slowdown while playing certain characters.
- Added multi-texture fragment shader to repo.
- Added a multiTexture option (enabled by default) to use multi-texturing to decode textures.
- Added some comments regarding timing to the PowerPC execution loop.
2012-02-14 03:28:52 +00:00