Commit graph

73 commits

Author SHA1 Message Date
Ian Curtis ff8e9d6aad Check for overflow. Fixes some fade effects 2016-05-30 23:10:56 +00:00
Ian Curtis 36074d9fd5 Y texture offsets are just 5 bits. Texture coordinate wrap around happens in the same texture sheet, not into the next one. Fixes various texturing bugs in sega rally. 2016-05-30 13:25:00 +00:00
Bart Trzynadlowski 2ee0d9018e New engine: modf -> std::modf (fixes compilation on gcc) 2016-05-28 20:54:25 +00:00
Bart Trzynadlowski 5c1a240565 New engine: expanded color indices to 12 bits from 11. Added PolygonHeader::ColorIndex and SensorColorIndex methods. 2016-05-28 20:49:10 +00:00
Bart Trzynadlowski e4a5c341dd Updated polygon header descriptions 2016-05-28 20:33:10 +00:00
Ian Curtis ce03c13847 Optimise non smooth texture repeat to only effect texture boundaries, rather than poly boundaries. Fixes a few ugly artefacts 2016-05-28 13:21:35 +00:00
Ian Curtis 661f19be19 fix transparency values, values are from 0-32, not 0-16 where the top bit disables 2016-05-27 22:20:57 +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 c5ce2b9679 fix alpha testing for texture format 7 2016-05-22 19:17:15 +00:00
Ian Curtis 65d6342947 remove dead code 2016-05-21 16:26:00 +00:00
Ian Curtis fd3eb49369 support 4 bit textures 2016-05-21 15:50:54 +00:00
Ian Curtis e108b56664 correctly mask pointers 2016-05-19 22:23:50 +00:00
Ian Curtis a79fd2786a optimise hash table access for better performance 2016-05-19 19:04:44 +00:00
Ian Curtis ff8d311dcc support colour table pointer 2016-05-18 23:06:41 +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 9e279a0c1f Non luminous polygons seem to be effected by the lightModifier also. API seems to have no restriction in this regard, neither does the SDK. The ocean hunter requires this for some of the 2d stuff. Light modifier values only seem to exist between 0-16, which is strange for 5 bits of precision. Possibly top bit disables the effect and lower 4 bits are the value. This clearly differs from the SDK, but without this the values come out clearly wrong. 2016-05-16 10:49:00 +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 c4b5b185c6 Disable light modifier on fog, seems not to work .. values don't make sense. Maybe the model3 doesn't use these. 2016-05-13 19:26:10 +00:00
Ian Curtis c8f8cd1655 remove dead code 2016-05-13 08:40:53 +00:00
Ian Curtis e295ad6868 double up polys for two sided polys, fixes some diffuse lighting problems 2016-05-13 08:39:48 +00:00
Bart Trzynadlowski ddf3d5213d FLT_MAX -> std::numeric_limits<float>::max() 2016-05-10 03:08:36 +00:00
Ian Curtis 34c81eabee update header documentation 2016-05-09 16:53:12 +00:00
Ian Curtis 43add90d2f Fix bad texture seems 2016-05-09 16:26:34 +00:00
Ian Curtis 69a44a5d5f add texture helper functions 2016-05-07 18:57:06 +00:00
Ian Curtis 242cddac2d remove pointless loop 2016-05-07 15:45:02 +00:00
Ian Curtis ded3168060 Split face colour from per vertex poly colour. Fixes colour bleeding between connected polys in harley. 2016-05-07 15:28:04 +00:00
Ian Curtis 05e1e4de37 update poly header class 2016-05-06 15:00:12 +00:00
Bart Trzynadlowski fee1cfb126 Fixed compilation on gcc (gotos cannot cross variable declarations) 2016-05-05 22:01:59 +00:00
Ian Curtis da4bab5f9b Flat shaded polys can't share vertex normals with adjacent connected polys. Fixes some bad lighting in Harley on pavements 2016-05-05 08:06:06 +00:00
Ian Curtis b2da849d90 support flat shading 2016-05-05 00:01:17 +00:00
Ian Curtis 3693a51cbb Make sure texture is bound to correct texture unit, stop flashing micro textures in daytona 2016-05-04 16:30:15 +00:00
Ian Curtis b0569007ef set correct microtexture wrap mode 2016-05-04 10:30:58 +00:00
Ian Curtis c545b9fd85 preliminary microtexture 2016-05-04 00:35:07 +00:00
Ian Curtis 396fba7d24 skip viewports marked as disabled, might stop parsing some bad data 2016-05-03 21:17:37 +00:00
Ian Curtis c459772f8e wrap invalid texture sizes, seems to fix bad textures in srally2 (skid marks) 2016-05-01 19:52:02 +00:00
Ian Curtis 7ec7906c0f Turn off lighting if fixed shading (or no normals) flag is present. Fixes some of the lighting weirdness in scud 2016-04-30 20:32:44 +00:00
Ian Curtis 23a5839d46 Daytona seems to use 3 bits for texture transparency, will figure it out later but for now this works 2016-04-30 09:02:38 +00:00
Ian Curtis 30ca1792bb Fix fixed shading maths 2016-04-30 08:58:13 +00:00
Ian Curtis c499e6640c fixed shading code 2016-04-29 23:03:46 +00:00
Ian Curtis 09e27e3082 color flag 2016-04-27 16:42:31 +00:00
Ian Curtis 8f6ab2fcf9 simplify 2016-04-27 08:13:22 +00:00
Ian Curtis 3e8439c09c fix model normals, add code for fixed shading, as of yet flag to turn it on is unknown 2016-04-26 09:06:48 +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 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