Ian Curtis
|
50d1f95648
|
Changed fixed shaded logic for step 1.5 hw based upon Harry's findings
|
2017-08-25 22:40:39 +00:00 |
|
Ian Curtis
|
b21ed49512
|
cosmetic
|
2017-08-21 23:00:29 +00:00 |
|
Ian Curtis
|
cd5978773a
|
Harry made some important discoveries with regards to fixed shading on the model 3 (per vertex poly brightness values). Firstly values are allowed to be negative, and they are used as a drop in replacement in the standard lighting equation for the normal dot light vector. This quite radically changes the brightness in LA Machine guns, but now correctly matches the arcade.
|
2017-08-19 20:06:31 +00:00 |
|
Ian Curtis
|
0efd4dac39
|
Finish fixed shading for 2.0 hardware. I'm pretty sure it actually works identically to step 1.5 hardware. The oddball is LA machine guns where the viewport ambient doesn't seem to effect the brightness. But the ambient works differently in this game because it uses the unclamped light model. Still need to investigate if the diffuse factor effects fixed shading.
|
2017-08-15 23:21:57 +00:00 |
|
Ian Curtis
|
b1cc9a615d
|
With fixed shading, when lighting is disabled, fixed shading appears to be a flat shaded version based upon the poly colour, instead of per vertex attributes.
|
2017-08-15 20:50:36 +00:00 |
|
Ian Curtis
|
2422caadc6
|
Pad struct and align on 4 byte boundary.
|
2017-08-15 20:45:08 +00:00 |
|
Ian Curtis
|
eac76f0908
|
simplify
|
2017-08-14 23:30:34 +00:00 |
|
Ian Curtis
|
81188bee07
|
fixed shading doesn't effect the alpha channel
|
2017-08-14 16:10:26 +00:00 |
|
Ian Curtis
|
c12e4c3215
|
Fixed shading (per vertex poly colours) on step 1.5 hardware have the viewport ambient value added to them. This fixes various shading on scud. To do this had to switch the maths to the vertex shader.
|
2017-08-14 09:14:06 +00:00 |
|
Ian Curtis
|
8f622714a7
|
Fix attribute locations. glBindAttribLocation must be called linking
|
2017-08-11 11:59:41 +00:00 |
|
Bart Trzynadlowski
|
a315627401
|
Added support for loading shaders from files for new engine and tile renderer. Changed help text to reflect new engine being default.
|
2017-08-11 00:41:10 +00:00 |
|
Ian Curtis
|
d7403afda6
|
use generic vertex attributes
|
2017-08-10 15:43:03 +00:00 |
|
Ian Curtis
|
57d0a513fd
|
Technically matrix casts are only allowed in glsl 1.2 and later
|
2017-08-09 23:25:01 +00:00 |
|
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
|
b1bd877b82
|
Ski champ for some reason is passing denormalised numbers for the modelscale. This is causing a NaN in our shader killing the lighting for these models, so we simply skip these, since they are essentially zero anyway. Thanks to Harry for finding this bug :)
|
2017-08-01 23:48:53 +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
|
9e9a549283
|
remove WIP code
|
2017-06-25 20:09:45 +00:00 |
|
Ian Curtis
|
ec3872d108
|
convert sun angle coordinate system outside of the shader
|
2017-06-25 19:50:02 +00:00 |
|
Ian Curtis
|
97781108e8
|
A second go at fixing the fixed lighting in star wars .. Fixed shading is per vertex poly colours. For some reason in star wars they are treated as unsigned values instead of signed, like in every other game. These polys are all marked with specular enabled, where as in the rest of the games they are missing this flag. That's the only difference I can find.
|
2017-06-21 17:04:53 +00:00 |
|
Ian Curtis
|
1532168af7
|
fix double offset
|
2017-06-20 21:44:58 +00:00 |
|
Ian Curtis
|
b00315b072
|
Revert previous fixed shading changes. Implement new logic for fixed shading on step 1.5 hardware based upon Harry's findings.
|
2017-06-20 20:13:42 +00:00 |
|
Ian Curtis
|
bb3c538808
|
remove debug code
|
2017-06-20 19:46:06 +00:00 |
|
Ian Curtis
|
260daa1b91
|
Fix the fix shading in star wars. Fixed shading still needs some work for mag truck and dirt devils to match the arcade.
|
2017-06-17 16:05:54 +00:00 |
|
Ian Curtis
|
73a7d2760d
|
cosmetic
|
2017-06-07 23:16:22 +00:00 |
|
Ian Curtis
|
1193069709
|
Tweak scroll fog logic again .. should fix missing 2d fogging in Spikeout.
|
2017-06-07 23:14:01 +00:00 |
|
Ian Curtis
|
45741b24d2
|
rewrite scroll fog logic
|
2017-05-06 16:47:31 +00:00 |
|
Ian Curtis
|
80004b0dad
|
Remove debug code
|
2017-04-25 00:31:39 +00:00 |
|
Ian Curtis
|
7694e4eb0c
|
minor culling node optimisations
|
2017-04-25 00:10:55 +00:00 |
|
Ian Curtis
|
ff936c588b
|
don't need cast, conversion is implicit
|
2017-04-20 19:46:40 +00:00 |
|
Ian Curtis
|
912bb0e7cf
|
better state handling
|
2017-04-20 19:43:41 +00:00 |
|
Ian Curtis
|
9b226ed478
|
parse out some culling node values
|
2017-04-17 10:40:07 +00:00 |
|
Ian Curtis
|
3c78571615
|
There are 2 bits in the polyheader labelled discard. When both are set ie in sega rally, the polygons are totally discarded. Scud seems to set bit 1 which seems halve the opacity.
|
2017-04-15 19:00:46 +00:00 |
|
Ian Curtis
|
21836c088c
|
The real3d has a flag that allows the hw to skip polygons so that they aren't rendered. Sega rally2 uses this for the dust effects. Triangles or quads that have this flag are junk, and look like random corruption if you try to draw them. We assumed polys that shared vertices with these bad polygons were also bad. It turns out the last few shared vertices in these polys were in fact valid, and thus the entire quad/triangle strip should be drawn and not discarded.
|
2017-04-14 23:41:11 +00:00 |
|
Ian Curtis
|
fc50bdee98
|
light parameters must be clamped (HarryTuttle)
|
2017-04-14 00:08:17 +00:00 |
|
Ian Curtis
|
391aafd4c1
|
Virtua fighter has a few massive polys that shouldn't be visible. It looks like these polys have a bad matrix, but the node distances are all zero. This means the bounding box that encapsulates them is of size zero. Skipping over these entirely seems to fix the issue.
|
2017-04-12 15:47:57 +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
|
ff624afb4d
|
The mipmap data in some games seems to being sent behind the base textures, and when the base textures are bound and created the mipmap chain is not yet valid in memory. To fix this, we invalidate the base textures, when the mipmap chain is updated.
|
2017-03-25 00:06:24 +00:00 |
|
Ian Curtis
|
06c1cdcf94
|
Just use 1 hash map for the textures, instead of 1 for each format. Should greatly speed up texture invalidation. TODO invalidate texture mipmaps .. the h/w actually seems to stream the mipmap data separate from the base textures in some cases.
|
2017-03-24 20:54:12 +00:00 |
|
Ian Curtis
|
98d56ff011
|
cosmetic
|
2017-03-24 17:43:07 +00:00 |
|
Ian Curtis
|
82ac030dff
|
calculate the correct number of mipmap textures
|
2017-03-24 16:51:52 +00:00 |
|
Ian Curtis
|
17f878421b
|
Originally to do mipmapping, I just used the base texture and then let the h/w automatically generate the mipmap chain. I wasn't sure the real3d api even exposed to the programmer the ability to directly set the mipmap data. Anyway, as pointed out by HarryTuttle scud actually uses darker mipmaps for an effect on the water. This patch uses the uses the actual mipmap data from the real3d memory. Only tested scud, so hopefully I didn't cause any cataclysmic errors :)
|
2017-03-24 13:38:20 +00:00 |
|