From 8b51e47b19603b10128ce19aaa88f53535de7375 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 14 Mar 2025 18:51:21 +1100 Subject: [PATCH] Wii U: More work on fog --- misc/wiiu/assembler.sh | 4 ++ misc/wiiu/ps_textured_lin.psh | 2 +- misc/wiiu/textured_exp.gsh | Bin 0 -> 1788 bytes misc/wiiu/textured_lin.gsh | Bin 0 -> 1788 bytes src/Graphics_WiiU.c | 102 +++++++++++++++++++++++----------- 5 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 misc/wiiu/textured_exp.gsh create mode 100644 misc/wiiu/textured_lin.gsh diff --git a/misc/wiiu/assembler.sh b/misc/wiiu/assembler.sh index 7041ca621..abf20d5b9 100755 --- a/misc/wiiu/assembler.sh +++ b/misc/wiiu/assembler.sh @@ -7,5 +7,9 @@ assemble() } assemble coloured_none.gsh vs_coloured.vsh ps_coloured_none.psh + assemble textured_none.gsh vs_textured.vsh ps_textured_none.psh +assemble textured_lin.gsh vs_textured.vsh ps_textured_lin.psh +assemble textured_exp.gsh vs_textured.vsh ps_textured_exp.psh + assemble textured_ofst.gsh vs_textured_offset.vsh ps_textured_none.psh diff --git a/misc/wiiu/ps_textured_lin.psh b/misc/wiiu/ps_textured_lin.psh index cf1ac1a12..7f8c28d1b 100644 --- a/misc/wiiu/ps_textured_lin.psh +++ b/misc/wiiu/ps_textured_lin.psh @@ -35,7 +35,7 @@ y: ADD R1.y, PV1.x, -C0.x w: ADD R0.w, PV1.y, -C0.z t: RCP_e ____, PS1 - 3 z: MULADD R127.z, -PS2, C1.x, 1.0f CLAMP + 3 z: MULADD R127.z, -PS2, C1.y, 1.0f CLAMP 4 x: MULADD R2.x, R1.y, PV3.z, C0.x y: MULADD R2.y, R1.x, PV3.z, C0.y z: MULADD R2.z, R0.w, PV3.z, C0.z diff --git a/misc/wiiu/textured_exp.gsh b/misc/wiiu/textured_exp.gsh new file mode 100644 index 0000000000000000000000000000000000000000..4d31c65c5016e6e37fca42946720e29c3304686f GIT binary patch literal 1788 zcmd^1gh5XWck&Q1&ou>@t1R+bA2BoIpJ;sik)A`&efhad?^NzURUvIIzHi6R9> z3O~R-2u12tDe?raQc_YNo8PSOz_BbuLkbvacIH2`dpkQH_h74cM?@UF04p58Kk4qq zqxS#@o6jgjJ)NkwYEx;A5* zh9UlB+VDI5xT`(<*I}PiOBc2e;7ipx@F(=kC06if^hSw;-Tkh-+I!l~-iXQP*^Za* z_StZf${F!2a%K%q;3x3Qj}#O4jmbB3z&@i@_F6nfb@aiUn%By_R6W4fyy5JG+$=hU z$U$8O5-T#lsz=DkUGwgLaM8p`sKXUa3JGh&TVM?v!^hx$xIE0X?PMhQ+l7oG{B5VB zMf~leKU%^s=5L9L`CAT*zZHY=x6(QJuakePQ8k-3GXV*%Fw#n+Q}wy<#IINYFf(MN zhZA{j4XiiMSth{dt33D1OV6%?YzF+h$~m$AwK*_bRN8J=d$zLed)ZF*8Z7Ad_g;v+ z-RwQweYU-6HtzodpB{JR4F1j?&6&CAlyl*T$?i9*p?Bugg@2}hr~ijp5F$sp^Kz-M z5D)5Z;NgF;=z1tsXm*&*V_Yq-47RnDM C$IV9o literal 0 HcmV?d00001 diff --git a/misc/wiiu/textured_lin.gsh b/misc/wiiu/textured_lin.gsh new file mode 100644 index 0000000000000000000000000000000000000000..f9ce2bc555fc766893eebee013db283499211120 GIT binary patch literal 1788 zcmd^@t1R+bA2BoIpJ;uL~#L?l`|4nY!-lAOh#$Pz?4OB5+6 zQuqPxK~khnl_F2zDkUWaviZ&W4jjuuG^Bu$=4QV6c5i2QcJ}dB_koBwbPiQCK!3{W z#*>c#hZ<)R;+~IP`)XA9Hcv+*mC+xF&0*L#4FB^|t~~->wORr<&^lX43`~ihCAu;d zn}i{Jdou7l|FolB_}i#IQ#&qVpTO73dEn3Z*9)xRFZi_r2fO#t(oFP1yI46+{Z`zrdx?yvQM#iAm1zZ|obZa++S(zjs2f3){X zuniformVars[1].offset, 4, &texOffset); -} - -static void UpdatePS(void) { - cur_PS = gfx_format == VERTEX_FORMAT_TEXTURED ? texture_PS : colour_PS; - GX2SetPixelShader(cur_PS); -} - void Gfx_SetVertexFormat(VertexFormat fmt) { if (fmt == gfx_format) return; gfx_format = fmt; @@ -419,10 +457,8 @@ void Gfx_LoadMatrix(MatrixType type, const struct Matrix* matrix) { if (type == MATRIX_VIEW) _view = *matrix; if (type == MATRIX_PROJ) _proj = *matrix; - // TODO dirty uniform Matrix_Mul(&_mvp, &_view, &_proj); - if (!cur_VS) return; - GX2SetVertexUniformReg(cur_VS->uniformVars[0].offset, 16, &_mvp); + GX2SetVertexUniformReg(VS_UNI_OFFSET_MVP, VS_UNI_COUNT_MVP, &_mvp); } void Gfx_LoadMVP(const struct Matrix* view, const struct Matrix* proj, struct Matrix* mvp) { @@ -434,7 +470,9 @@ void Gfx_LoadMVP(const struct Matrix* view, const struct Matrix* proj, struct Ma void Gfx_EnableTextureOffset(float x, float y) { texOffset.x = x; texOffset.y = y; + UpdateVS(); + GX2SetVertexUniformReg(VS_UNI_OFFSET_OFST, VS_UNI_COUNT_OFST, &texOffset); } void Gfx_DisableTextureOffset(void) {