Commit graph

30 commits

Author SHA1 Message Date
Ian Curtis 5709ee2659 Sometime ago I managed to work out that specular on the model3 is not real specular, and really is just an extension of diffuse lighting. But attempts were derailed by corner cases and the fact we were not handling the normals correctly. Anyway Harry managed to successfully come up with an algorithm, and coefficients that give an almost perfect match to specular on the model3, based soley on observations from video footage! He also worked out that the lighting on hardware 1.5 onwards appears to be unclamped (ie greater than 1). This quite radically changes the brightness of some of the games, but much better matches the original hardware. 2017-08-09 16:56:56 +00:00
Ian Curtis 1d338877fc cosmetic 2017-08-03 11:05:04 +00:00
Ian Curtis 3fc28159eb Add the unclamped light model we know exists to the shaders. 2017-08-03 10:41:18 +00:00
Ian Curtis 9aa3f13777 We were force normalising the result of matrix * normal, which looked correct in most cases. But this didn't preserve the scaling of the matrix, or the scaling of the model normals which resulted in many over bright areas. On it's own this generally worked, but games like Star Wars looked quite broken. Harry correctly figured out if you scale these normals by the scaling value that is sometimes present in the culling nodes the lighting looks correct. Still more work to do to correctly figure out the model3's lighting model. 2017-07-29 16:30:30 +00:00
Ian Curtis a9b49c1676 Implement unclamped light model based upon Harry's findings. Unknown how this is turned on/off. 2017-07-22 17:15:14 +00:00
Ian Curtis 2335f3173b Use c++11 raw string literals 2017-07-08 10:55:14 +00:00
Ian Curtis 3efb055344 Clamp the ambient light to a max of 0.75. LA Machine guns seems to use an ambient value of 1, which is full bright for everything. But for some reason the hardware seems to treat this as ~ 0.75. This fixes various missing shading in the game. This doesn't seem to have any negative effects on other games I have tested. Clamping in the shader as we might need the full range of values for fixed shading. 2017-06-29 19:05:30 +00:00
Ian Curtis ec3872d108 convert sun angle coordinate system outside of the shader 2017-06-25 19:50:02 +00:00
Ian Curtis 101e43213e cosmetic 2017-04-05 19:32:01 +00:00
Ian Curtis edfb521a9b Daytona seems to use this completely undocumented feature of the real3d pro-1000, the ability to invert texture colours. This patch fixes the colours on the cars, and the signs which should flash by alternating their colours. 2017-04-05 17:57:38 +00:00
Ian Curtis f0e00c5dc7 Rewrite the spot light code, and implement the missing fog logic. (HarryTuttle) 2017-04-02 21:03:59 +00:00
Ian Curtis 69eac95846 Replace glsl 3 function. Apparently this doesn't work on OS X. 2017-03-28 20:24:44 +00:00
Bart Trzynadlowski f34e25dfc7 Massive internal change: removed CConfig object and replaced it with a hierarchical config object system (Util::Config::Node). Games are now defined in an XML file. Hopefully I didn't break too many things :/ 2017-03-27 03:19:15 +00:00
Ian Curtis b19ceb0b6a Texture coordinates seem to be scaled relative to the fixed texture size of 256. Thanks to HarryTurtle for figuring this crazy logic out. The road in scud matches the arcade now almost perfectly. 2017-03-13 00:59:35 +00:00
Ian Curtis 2c23268d88 Support microtexture relative scale. The exact scaling values are not known, but a 2x difference between each level seems highly likely. We know from visual inspection from scud that the first level is exactly 4. The SDK has a function that accepts a float input for scale and does this. lod = (1/scale) + 0.5. If lod>3 lod = 3. So this is our best guess. 2016-12-09 14:13:46 +00:00
Ian Curtis 483ba2f398 Fix the shading in scud. When lighting is disabled the fixed shading intensities appear to be offset values added to the colour value. 2016-11-11 17:50:27 +00:00
Bart Trzynadlowski 458684eb22 Fixed new 3D engine's fragment shader to work on some older GPUs by reducing the number of discard statements to one 2016-08-24 22:21:18 +00:00
Ian Curtis 2086b1c9af Stencil layered polys, fixes shadow z fighting in some of the games. Other games maybe using stipple alpha (yuck), not sure yet. 2016-05-27 19:30:40 +00:00
Ian Curtis 3f9936d664 don't clamp after spot light code, looks much closer to h/w 2016-05-26 09:06:09 +00:00
Ian Curtis 89c987fae1 basic spotlight code 2016-05-26 00:08:12 +00:00
Ian Curtis 7e3c097a31 remove debug code 2016-05-16 17:26:53 +00:00
Ian Curtis 828fd8ebb4 Fog start is apparently the fog value at the viewport (0,0,0) I guess like an ambient value. Default value is negative 2016-05-16 17:10:04 +00:00
Ian Curtis 62eafacfc3 adjust (hopefully correct) fog equation 2016-05-16 10:44:16 +00:00
Ian Curtis bc08276d60 preliminary specular 2016-05-15 16:24:49 +00:00
Ian Curtis c545b9fd85 preliminary microtexture 2016-05-04 00:35:07 +00:00
Ian Curtis 8f6ab2fcf9 simplify 2016-04-27 08:13:22 +00:00
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 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
Bart Trzynadlowski 34301e97e1 Adding new 3D engine by Ian Curtis. Old engine moved to Graphics/Legacy3D/. 2016-03-21 04:10:14 +00:00