• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 2 3 4 5 ... 117 Next »

[UNOFFICIAL] Ishiiruka-Dolphin Custom Version
View New Posts | View Today's Posts

Pages (806): « Previous 1 ... 311 312 313 314 315 ... 806 Next »
Jump to page 
Thread Rating:
  • 33 Vote(s) - 4.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
[UNOFFICIAL] Ishiiruka-Dolphin Custom Version
10-04-2015, 11:03 PM
#3,121
Tino Offline
Above and Beyond
*******
Posts: 2,276
Threads: 1
Joined: Oct 2013
@masterotaku: if you give more detail on the values you tweak i can see if a native modification framework can be added internally to make thos changes more user friendly.
@Ramoth: interesting will take a look.
Find
Reply
10-04-2015, 11:55 PM (This post was last modified: 10-05-2015, 12:02 AM by masterotaku.)
#3,122
masterotaku Offline
Picky 3D user
****
Posts: 552
Threads: 7
Joined: Aug 2013
(10-04-2015, 11:03 PM)Tino Wrote: @masterotaku: if you give more detail on the values you tweak i can see if a native modification framework can be added internally to make thos changes more user friendly.

OK. Here's the content of a vertex shader that controls some shadows in Zelda Majora's Mask, called "36825a742c3b0f39-vs_replace.txt":

Code:
//Zelda MM: shadow behind maks in walls, Skulltulas house.
cbuffer _Globals : register(b0)
{
 float4 cproj[4] : packoffset(c0);
 float4 cmtrl[4] : packoffset(c4);
 float4 clights[40] : packoffset(c8);
 float4 ctexmtx[24] : packoffset(c48);
 float4 ctrmtx[64] : packoffset(c72);
 float4 cnmtx[32] : packoffset(c136);
 float4 cpostmtx[64] : packoffset(c168);
 float4 cDepth : packoffset(c232);
 float4 cPLOffset[13] : packoffset(c233);
}

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
 float4 v0 : COLOR0,
 float2 v1 : TEXCOORD0,
 float4 v2 : BLENDINDICES0,
 float4 v3 : POSITION0,
 out float4 o0 : SV_Position0,
 out float4 o1 : COLOR0,
 out float4 o2 : COLOR1,
 out float4 o3 : TEXCOORD0,
 out float4 o4 : TEXCOORD1)
{
 float4 r0,r1;
 uint4 bitmask, uiDest;
 float4 fDest;

 float4 iniparams = IniParams.Load(0);
 
 r0.x = 255 * v2.x;
 r0.x = (int)r0.x;
 r0.yz = (int2)r0.xx + int2(1,2);
 r1.x = dot(ctrmtx[r0.x].xyzw, v3.xyzw);
 r1.y = dot(ctrmtx[r0.y].xyzw, v3.xyzw);
 r1.z = dot(ctrmtx[r0.z].xyzw, v3.xyzw);
 r1.w = 1;
 r0.x = dot(cproj[0].xyzw, r1.xyzw)*iniparams.x;
 r0.y = dot(cproj[1].xyzw, r1.xyzw)*iniparams.y;
 r0.z = dot(cproj[3].xyzw, r1.xyzw);
 r0.w = dot(cproj[2].xyzw, r1.xyzw);
 o3.xy = r1.xy;
 o4.w = r1.z;
 o0.xy = r0.zz * cDepth.zw + r0.xy;
 r0.x = cDepth.y * r0.w;
 r0.y = cDepth.x + -1;
 r0.x = r0.y * r0.z + r0.x;
 o0.z = -r0.x;
 o0.w = r0.z;
 o3.zw = r0.wz;
 o1.xyzw = v0.xyzw;
 o2.xyzw = v0.xyzw;
 o4.xyz = float3(0,0,0);
 return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20789
//
//   using 3Dmigoto v1.2.1 on Thu Sep 03 21:58:09 2015
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 cproj[4];                   // Offset:    0 Size:    64
//   float4 cmtrl[4];                   // Offset:   64 Size:    64 [unused]
//   float4 clights[40];                // Offset:  128 Size:   640 [unused]
//   float4 ctexmtx[24];                // Offset:  768 Size:   384 [unused]
//   float4 ctrmtx[64];                 // Offset: 1152 Size:  1024
//   float4 cnmtx[32];                  // Offset: 2176 Size:   512 [unused]
//   float4 cpostmtx[64];               // Offset: 2688 Size:  1024 [unused]
//   float4 cDepth;                     // Offset: 3712 Size:    16
//   float4 cPLOffset[13];              // Offset: 3728 Size:   208 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float      
// BLENDINDICES             0   xyzw        2     NONE   float   x  
// POSITION                 0   xyzw        3     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[233], dynamicIndexed
dcl_input v0.xyzw
dcl_input v2.x
dcl_input v3.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_temps 2
mul r0.x, v2.x, l(255.000000)
ftoi r0.x, r0.x
iadd r0.yz, r0.xxxx, l(0, 1, 2, 0)
dp4 r1.x, cb0[r0.x + 72].xyzw, v3.xyzw
dp4 r1.y, cb0[r0.y + 72].xyzw, v3.xyzw
dp4 r1.z, cb0[r0.z + 72].xyzw, v3.xyzw
mov r1.w, l(1.000000)
dp4 r0.x, cb0[0].xyzw, r1.xyzw
dp4 r0.y, cb0[1].xyzw, r1.xyzw
dp4 r0.z, cb0[3].xyzw, r1.xyzw
dp4 r0.w, cb0[2].xyzw, r1.xyzw
mov o3.xy, r1.xyxx
mov o4.w, r1.z
mad o0.xy, r0.zzzz, cb0[232].zwzz, r0.xyxx
mul r0.x, r0.w, cb0[232].y
add r0.y, l(-1.000000), cb0[232].x
mad r0.x, r0.y, r0.z, r0.x
mov o0.z, -r0.x
mov o0.w, r0.z
mov o3.zw, r0.wwwz
mov o1.xyzw, v0.xyzw
mov o2.xyzw, v0.xyzw
mov o4.xyz, l(0,0,0,0)
ret
// Approximately 24 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

The ASM code at the bottom doesn't need to be touched. Only the HLSL part.

The important (and almost only) lines that I modified for the aspect ratio correction are these:
Code:
r0.x = dot(cproj[0].xyzw, r1.xyzw)*iniparams.x;
r0.y = dot(cproj[1].xyzw, r1.xyzw)*iniparams.y;

"iniparams.x" and "iniparams.y" are variables that I defined in the "d3dx.ini" file that comes with 3Dmigoto. I use a variable so I can change its value in real time with a hotkey, for aspect ratio changes in real time. However, that makes it work only with 3D Vision.

If I put the value manually, like "r0.x = dot(cproj[0].xyzw, r1.xyzw)*0.75;" (correction from 4:3 to 16:9. Lower values for wider aspect ratios), it works for all users even if they don't have 3D Vision.

The thing is that all vertex shaders that I modified for aspect ratio mods needed exactly the same changes. The "r0.x = dot(cproj[0].xyzw, r1.xyzw);r0.y = dot(cproj[1].xyzw, r1.xyzw);r0.z = dot(cproj[3].xyzw, r1.xyzw);r0.w = dot(cproj[2].xyzw, r1.xyzw);" lines are always there. So if I had access to the source of the projection, I would be able to change all shaders at the same time.

Ideally, it would be like an improved widescreen hack that works with every game and leaves the HUD and menu elements with the correct aspect ratio. If it were done that way, I don't know if I would still need to make exceptions to some shaders (in some cases, some shaders needed to apply to the entire screen and not be corrected. Exceptions that do need 3D Vision to work because they use variables).
CPU: Intel Core i5 4670k @ 4.4GHz
GPU: GAINWARD GeForce GTX 1080 Phoenix "GLH"
RAM: G.SKILL Ripjaws X DDR3 16GB 1600MHz CL7
OS: Windows 7 Ultimate x64
Find
Reply
10-05-2015, 11:38 AM (This post was last modified: 10-05-2015, 11:57 AM by rlaugh0095.)
#3,123
rlaugh0095 Offline
God of Conquest
****
Posts: 519
Threads: 28
Joined: Oct 2013
Hey Tino, I found another game with weird depth access Geist . So, while your in a cutscene, ssao/SSGi works perfectly fine as it should, but while in gameplay, it only shadows a weird line in the middle of the screen and not the environment. o.o

EDIT: It got much weirder. I'll post a video in a second.
Find
Reply
10-05-2015, 12:12 PM (This post was last modified: 10-05-2015, 12:12 PM by Ramoth.)
#3,124
Ramoth Offline
Member
***
Posts: 141
Threads: 0
Joined: Jul 2014
More universal widescreen hack from PCSXR.
https://github.com/mirror/pcsxr/commit/9a63e315195a0dcd669d2df1c62142eaf740de7a
https://github.com/twinaphex/beetle-psx-libretro/commit/ae8dd1de3e293177eec84ad2e1970e7b37278a03
https://github.com/twinaphex/beetle-psx-libretro/commit/1cf16b357b7ac76a6dd81944ff8a2742fe4de177
https://github.com/twinaphex/beetle-psx-libretro/commit/116bc38466861f33c8dd3c229b140a898ad0f346
https://github.com/mirror/pcsxr/commit/3f5662407bc39d8913a4a24927cb953e3d57b56c
https://github.com/mirror/pcsxr/commit/704ab8f7cc436c00c151e5608429737acb2e69ac
Find
Reply
10-05-2015, 12:28 PM
#3,125
rlaugh0095 Offline
God of Conquest
****
Posts: 519
Threads: 28
Joined: Oct 2013
lol look at this XD
https://www.youtube.com/watch?v=SW04PgI60SU&feature=youtu.be
Find
Reply
10-05-2015, 10:36 PM
#3,126
Tino Offline
Above and Beyond
*******
Posts: 2,276
Threads: 1
Joined: Oct 2013
@rlaugh0095: one of the post processing shaders is called Depth please select that shader and send a screenshot of the output
Find
Reply
10-06-2015, 02:39 AM
#3,127
CowlScatman Offline
Texture Maker
***
Posts: 134
Threads: 1
Joined: May 2015
Tino ive got a question. would the changes made to this version of the emulator cause TAS to desync? Cause i want to make TAS but play it back using ishiiruka so that i can have that glorious quality.
Find
Reply
10-06-2015, 02:52 AM
#3,128
Tino Offline
Above and Beyond
*******
Posts: 2,276
Threads: 1
Joined: Oct 2013
@CowlScatman: no idea never tested, you will help me if you test and let me kenow if you have any issues
Find
Reply
10-06-2015, 03:23 AM
#3,129
CowlScatman Offline
Texture Maker
***
Posts: 134
Threads: 1
Joined: May 2015
(10-06-2015, 02:52 AM)Tino Wrote: @CowlScatman: no idea never tested, you will help me if you test and let me kenow if you have any issues

i maid a quick TAS this morning using ishiiruka and when i tried to play it back it just gave me a buzzing sound. Im gonna try it without the shaders enabled.
Find
Reply
10-06-2015, 03:25 AM
#3,130
CowlScatman Offline
Texture Maker
***
Posts: 134
Threads: 1
Joined: May 2015
Okay so the emulator itself just doesnt want to play back TAS input apparently. The game screen just turns white and buzzes as soon as i click it.
Find
Reply
« Next Oldest | Next Newest »
Pages (806): « Previous 1 ... 311 312 313 314 315 ... 806 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode