Commit Graph

25 Commits

Author SHA1 Message Date
Antonio Abbatangelo 080022833d nv2a: Cache shaders to disk 2022-09-10 12:52:51 -07:00
Erik Abair 8d274e5f9a nv2a: Match inv_w qualifier to attribute qualifier
Calculates both interpolated and flat shaded inv_w so that the appropriate
value may be used when undoing the perspective divide in the pixel shader.
2022-07-13 16:16:38 -07:00
Erik Abair ae1a140ecb nv2a: Fix missing flat qualifier for inv_w param
`vtx_inv_w` should also be flat, since interpolating it causes incorrect values
for the flat shaded colors.

Fixes #1179

[Test](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/shade_model_tests.cpp)
[HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Shade_model)
2022-07-13 16:16:38 -07:00
Erik Abair 6f878ede01 nv2a: Do not force oFog to 1.0
This code was added ~7 years ago in
[this commit](97be3f5986)

From what I can see from the [HW test results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Fog_coord_vec4)
the behavior on nv2a is more subtle than the cited `NV_vertex_program`
documentation.

In practice the register more or less retains its value until it is explicitly
modified.[The test](4cff2b2ebe/src/tests/fog_tests.cpp (L432))
renders something with an explicitly set oFog.x, then renders again with a
shader that does not modify oFog.x but references it in the pixel shader. The
value carries over rather than being forced to 1.0.

Interestingly, this test is apparently not hermetic; running the other
vec4_coord test (that explictly set various components of oFog) lead to unusual
behavior where the fogging effect is not uniform across all vertices, despite
never being set. Even more interestingly, re-running the test once it's in this
state will often produce variations as to which vertices are apparently using
a stale/incorrect fog value.
2022-07-05 19:12:03 -07:00
mborgerson db389b1508 nv2a: Fix missing emit_vertex param 2022-06-25 22:56:11 -07:00
Matt Borgerson 83e16c996d nv2a: Store shading mode in CONTROL_3 2022-06-25 21:11:30 -07:00
Erik Abair 4132845336 nv2a: Implement SET_SHADE_MODEL 2022-06-25 20:39:55 -07:00
Matt Borgerson be8b612186 nv2a: Set C numeric locale before shader gen 2022-06-25 15:34:26 -07:00
Erik Abair f54b207812 nv2a: Handle invalid w in fixed function pipeline 2022-06-24 22:44:19 -07:00
Erik Abair cc21fbea78 nv2a: Stop passing ShaderState by value 2022-06-22 15:59:49 -07:00
Erik Abair 4cff9c27f3 nv2a: Fix swapped R and Q texgen planes 2022-03-16 20:36:41 -07:00
RageXbox 8919bae311
nv2a: Remove assertion in append_skinning_code 2022-02-10 22:31:22 -07:00
Erik Abair 517e4b3414 nv2a: Implement SET_MATERIAL_ALPHA and diffuse color src
This adds support for the material alpha command and updates the fixed function
shader to respect the diffuse source parameter (which was already piped through
but not utilized).
2022-02-05 15:22:03 -07:00
Erik Abair b3f56db428 nv2a: Match HW behavior when dealing with infinite fog coord 2022-01-18 18:13:54 -07:00
Matt Borgerson 5778854dbd nv2a: Scale point sprites by surface scaling factor 2021-07-20 10:37:07 -07:00
Matt Borgerson 5562a484e1 nv2a: Support integer scaling of surface dimensions 2021-07-20 10:37:07 -07:00
Matt Borgerson 203c76f89c nv2a: Handle point sprites, scaling 2021-07-10 02:42:15 -07:00
Matt Borgerson dbc73bbd82 nv2a: Derive rho, phi, theta from spot direction 2021-05-18 10:18:45 -07:00
Matt Borgerson 74f724715d nv2a: Fixup qstring to mstring 2021-05-18 10:18:45 -07:00
Wilhelm Kovatch e2e3572301 nv2a: implement FFP LIGHT_SPOT 2021-05-18 10:17:19 -07:00
Matt Borgerson ee18e7bf35 nv2a: Add custom mutable string object (QString is now immutable) 2021-04-18 23:41:28 -07:00
Matt Borgerson 0214f88f91 nv2a: Move vertex decompression to shader 2021-03-16 16:00:42 -07:00
Matt Borgerson 6e564854fc xemu: Update copyright 2021-03-03 03:48:11 -07:00
Matt Borgerson 3c6596975d nv2a: Implement dot texture modes and dotmapping 2020-10-28 15:59:20 -07:00
Matt Borgerson a3fc742bbe nv2a: Remove nv2a_ prefix on files in nv2a dir 2020-10-18 00:55:08 -07:00