Commit graph

115 commits

Author SHA1 Message Date
Ian Curtis 5b9741bd5d Support high priority polygons. They are treated as a separate overlay plane by the h/w. Fixes some missing fx in harley. 2017-02-20 17:22:32 +00:00
Ian Curtis 2ae2010ee4 Add high priority poly function. Used by harley. 2017-02-18 23:58:08 +00:00
Ian Curtis 4a116190b5 When the translator map?? bit is enabled the colour format seems to be 4-5bit. Max observed value is 16. Scaling these values up seems to produce the correct colours in harley and dirt devils. 2017-02-16 17:20:42 +00:00
Ian Curtis 7407d03036 Put a check in there, in case near values come out really close to zero. Fixes a slight corner case in lemans24. A check probably should have been there originally :) 2017-02-08 16:14:50 +00:00
Ian Curtis 24cbeed526 Dynamically calculate near/far frustum planes for each viewport priority layer by clipping the overlapping meshes with the 4 frustum planes. A bit brute forcy, but the results are great. 2017-02-07 14:05:03 +00:00
Ian Curtis 144125a62e mark the nodes without valid distances set 2017-02-05 15:36:05 +00:00
Ian Curtis c82dc55485 cosmetics 2016-12-22 22:11:19 +00:00
Ian Curtis 72dd0dbf98 only need to cull against 4 clipping planes 2016-12-22 22:09:13 +00:00
Ian Curtis 20a9514aa2 For scroll fog set the viewport to the entire area, allows fog to work in widescreen mode 2016-12-15 19:27:08 +00:00
Ian Curtis ca7046729e properly cache un-normalised texture coordinates, fixes a texturing regression in Daytona 2016-12-15 12:10:52 +00:00
Ian Curtis f355e2d062 fix microtexture colours 2016-12-15 00:45:32 +00:00
Ian Curtis 89e75a9803 Only check scroll fog value from the first viewport from each priority layer. Seems to fix problems with background fogging. 2016-12-14 19:57:05 +00:00
Ian Curtis 707e945db9 delete unused files 2016-12-09 14:15:11 +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 da8b63b44b The model3 shares vertices between polygons. But it also seems to do this for polygons with different textures. This means the texture coordinate for potentially different sizes textures is shared. Currently this was broken leading to some corrupted looking textures. The fix is to simply cache the old texture coordinates, and recalculate the normalised coordinates in the new texture coordinate space. 2016-12-06 14:39:46 +00:00
Ian Curtis 10a5d2c0e1 refactor 2016-12-06 12:25:34 +00:00
Ian Curtis eece2d75b4 tweak scroll fog logic 2016-12-04 22:37:49 +00:00
Ian Curtis a310e8e5cf minor optimisations 2016-11-28 17:32:25 +00:00
Ian Curtis abc8c24b69 Only check the geometry for culling with valid node distances. We will need this later. 2016-11-27 19:30:46 +00:00
Ian Curtis fe60d115d2 Revert changes .. if we clip against the real3d clipping planes, our wide screen hack won't work anymore. 2016-11-26 01:19:51 +00:00
Ian Curtis 665fa90425 Get clipping planes directly from the viewport data. Also no need to clip against a far plane 2016-11-26 01:12:08 +00:00
Ian Curtis 54c405709f Need to walk back in memory and check the previous texture tiles to see if they overlap with the current textures being invalidated. If they overlap they must be cleared too. Algorithm is a bit brute forcy and more expensive than I'd like but it fixes the bad textures in Spikeout. 2016-11-22 20:30:10 +00:00
Ian Curtis 84ae8f035c Skip processing the mipmap section of memory. The real3d doesn't create mipmaps down to 1x1 that is needed to do mipmapping properly on modern hardware anyway. 2016-11-21 09:04:56 +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
Ian Curtis 2f49012786 change scroll fog logic to parse the lower priority viewports first 2016-10-09 18:10:57 +00:00
Ian Curtis f0a15febd1 implement scroll fog, fixes a tonne of missing fx 2016-10-09 16:34:12 +00:00
Ian Curtis ef11990d19 Parse out scrollfog value used for blending over the 2d background. 2016-10-08 15:41:16 +00:00
Ian Curtis 33e795de9b Fix scenes with missing fog in ocean hunter. The game was passing negative fog densities. The sign seems to be ignored by the model 3. 2016-10-08 15:15:25 +00:00
Ian Curtis 33cf6c89d1 our scratch mem must match correct max texture size 2016-10-08 11:59:25 +00:00
Ian Curtis c472d90fb9 Fix the sky in advanced stage in Dirt Devils. It uses a massive (for 1998 :p) 1024x256 texture. 2016-10-06 20:10:45 +00:00
Ian Curtis c3581c9fe8 Support multiple microTextures, fixes crazy texturing in sega ski champ. I'm assuming microtextures are always located on the other memory bank to the base texture. This logic seems to work for all our games anyway. 2016-10-06 01:37:29 +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 732bff2769 disable spot light if the extent is zero 2016-06-29 20:53:19 +00:00
Ian Curtis efa7776871 parse some unimplemented spot light values from viewport 2016-06-27 17:35:27 +00:00
Ian Curtis d058a29ac8 stencil translucent non textured polys 2016-06-19 23:33:06 +00:00
Ian Curtis 85c4d85562 refactor 2016-06-19 21:43:09 +00:00
Ian Curtis c2b1db11f8 Cull geometry based on the culling distances in the nodes. Should give some sort of speedup on lower end pcs where the CPU is predominantly the bottle neck. 2016-06-16 20:05:29 +00:00
Ian Curtis d799c63b1a cache bound texture 2016-06-10 11:29:20 +00:00
Ian Curtis 48a79a8f14 cleaning 2016-06-10 10:18:47 +00:00
Ian Curtis 8440bc7f03 support negative exponent 2016-06-03 09:33:46 +00:00
Ian Curtis 5081ee99dc Add code to convert the 16bit float format used by the hardware back into float 754 format. 16bit floats are used for the culling radiuses in the nodes. 2016-06-03 00:01:34 +00:00
Ian Curtis 9bc1fbf0cb remove dead code 2016-06-02 21:26:50 +00:00
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