hook up merc2 to fog intensity, flip some min/max fogs (#1403)

* hook up merc2 to fog intensity, flip some min/max fogs

* zero initialize let stats
This commit is contained in:
water111 2022-06-01 19:07:28 -04:00 committed by GitHub
parent e3051f90ae
commit ec9c7a55ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View file

@ -51,17 +51,17 @@ struct ObjectFileData {
* Stats structure for let rewriting.
*/
struct LetRewriteStats {
int dotimes;
int countdown;
int abs;
int abs2;
int unused;
int ja;
int case_no_else;
int case_with_else;
int set_vector;
int set_vector2;
int send_event;
int dotimes = 0;
int countdown = 0;
int abs = 0;
int abs2 = 0;
int unused = 0;
int ja = 0;
int case_no_else = 0;
int case_with_else = 0;
int set_vector = 0;
int set_vector2 = 0;
int send_event = 0;
int total() const {
return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else +

View file

@ -46,7 +46,7 @@ void main() {
// vu.Q = gen.fog.x() / gen.vtx_p0.w();
float Q = fog_constants.x / transformed.w;
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.z, fog_constants.y);
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
// itof12.xyz vf18, vf22 texture int to float
// vu.vf18.itof12(Mask::xyz, vu.vf22);

View file

@ -30,5 +30,5 @@ void main() {
discard;
}
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog, 0, 1));
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}

View file

@ -96,7 +96,7 @@ void main() {
float Q = fog_constants.x / transformed[3];
fog = (255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.z, fog_constants.y))/255.0;
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
transformed.xyz *= Q;
transformed.xyz += hvdf_offset.xyz;