[Patch] 2D-3D Layer Alignment (part 1)

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

[Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 11:35 am

Another really strange thing about Model3 is how 3D layer and 2D are aligned. 3D is offset by 2px in both right and down direction.
It surely isn't the only odd thing about this piece of hardware and I think you couldn't spot it in the arcade because on CRT monitors (and even first generation standard definition LCD, with analog inputs) there's always a little overscan applied.

By the way, I've included this patch that:
- Fixes 3D with 2D screen alignment (checked in Daytona2, Harley was already fixed. There could be other games affected, testing is needed)
- Adjusts, consequently, the Crosshairs overlay position in Lost World
- Reworks/simplify the logic by which the widescreen resolution is created (no user visible changes)
- Reworks/simplify the logic by which screen bottom is cleared (no user visible changes)

A couple of screenshots to show the changes:

Before:
daytona2_1.jpeg
Supermodel (wrong alignment)
daytona2_1.jpeg (233.98 KiB) Viewed 5775 times


After:
daytona2_1a.jpeg
Supermodel (right alignment)
daytona2_1a.jpeg (231.76 KiB) Viewed 5775 times


Continues...
Attachments
diff.zip
(1.94 KiB) Downloaded 237 times
Last edited by HarryTuttle on Tue Mar 14, 2017 12:23 pm, edited 2 times in total.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

[Patch] 2D-3D Layer Alignment (part 2)

Postby HarryTuttle » Tue Mar 14, 2017 11:38 am

Another couple of examples:

Before:
daytona2_2.jpeg
Supermodel (wrong alignment)
daytona2_2.jpeg (238.88 KiB) Viewed 5775 times


After:
daytona2_2a.jpeg
Supermodel (right alignment)
daytona2_2a.jpeg (237.18 KiB) Viewed 5775 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 12:03 pm

Here's a page from the "C.R.T. Test" (under the test (F2) menu) present in many Model 3 games, with a 3px wide black area around the checkerboard.

Could it be a hint that you must put that black area outside the monitor visible area (overscan)?

daytona2_3.png
daytona2_3.png (11.56 KiB) Viewed 5769 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby Ian » Tue Mar 14, 2017 12:33 pm

I bumped into this issue with harley and eca I think
the +2 was really a dirty fix. I tried all sorts of rounding modes but none seem to work

I had a dig again into the SDK (since I didn't have it when I worked on those methods)

This is the complete code for the method that sets those values

Code: Select all
void __thiscall PRO_Viewport::SetDisplayExtents(PRO_Viewport *this, float up_left_i, float up_left_j, float size_i, float size_j)
{
  PRO_Viewport *v5; // esi@1
  PRO_Device *v6; // ecx@1
  double v7; // st7@10
  double v8; // st7@16
  float v10; // ST18_4@22
  unsigned __int8 v11; // c0@21
  unsigned __int8 v12; // c3@21
  double v13; // st7@22
  float v15; // ST18_4@28
  unsigned __int8 v16; // c0@27
  unsigned __int8 v17; // c3@27
  double v18; // st7@28
  signed int v19; // eax@35
  double v20; // st7@39
  double v21; // st7@39
  bool v22; // zf@39
  bool v23; // sf@39
  double v24; // st7@43
  signed __int64 v25; // rax@44
  double v26; // st7@46
  signed __int64 v27; // rax@47
  double v28; // st7@49
  int v29; // eax@49
  float v30; // [sp+8h] [bp-20h]@39
  float v31; // [sp+Ch] [bp-1Ch]@1
  float v32; // [sp+10h] [bp-18h]@1
  float v33; // [sp+14h] [bp-14h]@1
  float v34; // [sp+18h] [bp-10h]@1
  __int32 v35; // [sp+1Ch] [bp-Ch]@1
  __int32 v36; // [sp+20h] [bp-8h]@1
  float v37; // [sp+24h] [bp-4h]@39
  float v38; // [sp+2Ch] [bp+4h]@33
  float v39; // [sp+30h] [bp+8h]@33
  float v40; // [sp+34h] [bp+Ch]@33
  float v41; // [sp+38h] [bp+10h]@33

  v31 = up_left_i;
  v5 = this;
  v33 = size_i + up_left_i;
  v32 = up_left_j;
  v6 = (PRO_Device *)*((_DWORD *)this + 9);
  v34 = size_j + up_left_j;
  PRO_Device::GetDisplaySize(v6, &v35, &v36);
  if ( SLODWORD(size_i) < 0x38D1B717 )
    size_i = 0.000099999997;
  if ( SLODWORD(size_j) < 0x38D1B717 )
    size_j = 0.000099999997;
  if ( SLODWORD(v31) > 0x3F800000
    || LODWORD(v33) > 0x80000000
    || SLODWORD(v32) > 0x3F800000
    || LODWORD(v34) > 0x80000000 )
  {
    v38 = 1.0;
    v39 = 1.0;
    v19 = 0x38D1B717;
    v40 = 0.000099999997;
LABEL_38:
    v41 = *(float *)&v19;
    goto LABEL_39;
  }
  if ( LODWORD(up_left_i) <= 0x80000000 )
  {
    *((_DWORD *)v5 + 79) = 0;
  }
  else
  {
    v7 = up_left_i;
    if ( _adjust_fdiv )
      _adj_fdiv_m32(LODWORD(size_i));
    else
      v7 = v7 / size_i;
    *((float *)v5 + 79) = -v7;
  }
  if ( LODWORD(up_left_j) <= 0x80000000 )
  {
    *((_DWORD *)v5 + 77) = 0;
  }
  else
  {
    v8 = up_left_j;
    if ( _adjust_fdiv )
      _adj_fdiv_m32(LODWORD(size_j));
    else
      v8 = v8 / size_j;
    *((float *)v5 + 77) = -v8;
  }
  if ( v11 | v12 )
  {
    *((_DWORD *)v5 + 80) = 0;
  }
  else
  {
    v10 = size_i + up_left_i;
    v13 = v10 - 1.0;
    if ( _adjust_fdiv )
      _adj_fdiv_m32(LODWORD(size_i));
    else
      v13 = v13 / size_i;
    *((float *)v5 + 80) = v13;
  }
  if ( v16 | v17 )
  {
    *((_DWORD *)v5 + 78) = 0;
  }
  else
  {
    v15 = size_j + up_left_j;
    v18 = v15 - 1.0;
    if ( _adjust_fdiv )
      _adj_fdiv_m32(LODWORD(size_j));
    else
      v18 = v18 / size_j;
    *((float *)v5 + 78) = v18;
  }
  PRO_Viewport::ClipBox(v5, &v31, &v33, &v32, &v34);
  v38 = v31;
  v39 = v32;
  v40 = v33 - v31;
  v41 = v34 - v32;
  if ( SLODWORD(v40) > 0x3F800000 )
    v40 = 1.0;
  v19 = 0x3F800000;
  if ( SLODWORD(v41) > 0x3F800000 )
    goto LABEL_38;
LABEL_39:
  v20 = (double)v35;
  v37 = v20;
  *((float *)v5 + 47) = v20 * v40;
  v21 = (double)v36;
  v22 = *((_DWORD *)v5 + 47) == 0;
  v23 = *((_DWORD *)v5 + 47) < 0;
  v30 = v21;
  *((float *)v5 + 48) = v21 * v41;
  if ( v23 || v22 )
    *((_DWORD *)v5 + 47) = 0x3F800000;
  if ( *((_DWORD *)v5 + 48) <= 0 )
    *((_DWORD *)v5 + 48) = 0x3F800000;
  *((float *)v5 + 49) = v38;
  *((float *)v5 + 50) = v39;
  *((float *)v5 + 51) = v40;
  *((float *)v5 + 52) = v41;
  v24 = *((float *)v5 + 47);
  if ( v40 + v38 < 1.0 )
  {
    v25 = (signed __int64)(v24 * 4.0);
  }
  else
  {
    *((float *)v5 + 47) = v24 + 3.0;
    LOWORD(v25) = (unsigned __int64)(signed __int64)(*((float *)v5 + 47) * 4.0) - 1;
  }
  *((_WORD *)v5 + 38) = v25;
  v26 = *((float *)v5 + 48);
  if ( v41 + v39 < 1.0 )
  {
    v27 = (signed __int64)(v26 * 4.0);
  }
  else
  {
    *((float *)v5 + 48) = v26 + 3.0;
    LOWORD(v27) = (unsigned __int64)(signed __int64)(*((float *)v5 + 48) * 4.0) - 1;
  }
  v28 = v38 * v37;
  *((_WORD *)v5 + 39) = v27;
  *((_WORD *)v5 + 36) = (signed __int64)(v28 * 16.0);
  *((_WORD *)v5 + 37) = (signed __int64)(v39 * v30 * 16.0);
  v29 = *((_DWORD *)v5 + 14);
  if ( v29 & 0x800000 )
    *((_WORD *)v5 + 36) = (unsigned __int64)(signed __int64)(v28 * 16.0) + 7728;
  *((_DWORD *)v5 + 14) = v29 | 0x80;
  PRO_Pingpong_Data_Block::NotifyUpdate(v5);
}


Probably want to convert those hex values to floats to make it more readable.

It seems to be doing this

Code: Select all
  if ( v41 + v39 < 1.0 )
  {
    v27 = (signed __int64)(v26 * 4.0);
  }
  else
  {
    *((float *)v5 + 48) = v26 + 3.0;
    LOWORD(v27) = (unsigned __int64)(signed __int64)(*((float *)v5 + 48) * 4.0) - 1;
  }
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 1:52 pm

when i saw:
Code: Select all
void __thiscall PRO_Viewport::SetDisplayExtents(PRO_Viewport *this, float up_left_i, float up_left_j, float size_i, float size_j)


I had a feeling (more a brain fart...) that it might have something to do with viewport node 0x1c:
Code: Select all
0x1c:   xxxxxxxx xxxxxxxx -------- -------- "lj"
        -------- -------- xxxxxxxx xxxxxxxx "li"


Where "lj" and "li" could have been respectively "up_left_j" and "up_left_i". But it seems those are always set to zero.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 2:59 pm

We should ask to someone who owns the arcade pcb to shrink the displayed image in his monitor and check if there's this 2px ugly offset. For Daytona 2 should be easy as there's almost always that blue color of the sky bitmap beneath.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby Ian » Tue Mar 14, 2017 3:05 pm

One thing to check would be
What do these values look like as floats? we are casting to int
Not sure why they chose that particular format, you don't really need a fractional component when specifying viewport offsets
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 3:09 pm

This, incidentally, is what I was doing right now, here are some values from Harley (I've isolated viewpriority = 3)...

Code: Select all
VP: 3, X:  16.0000, Y: 112.3125, Width: 1023.75, Height: 247.5
VP: 3, X:   4.0000, Y:   4.0000, Width: 487.75, Height: 376.00
VP: 3, X:   4.0000, Y:   4.0000, Width: 487.75, Height: 376.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.0000, Y:   2.0000, Width: 491.75, Height: 380.00
VP: 3, X:   2.0000, Y:   2.0000, Width: 491.75, Height: 380.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.2500, Width: 1023.75, Height: 247.5
VP: 3, X:   4.0000, Y:   4.0000, Width: 487.75, Height: 376.00
VP: 3, X:   4.0000, Y:   4.0000, Width: 487.75, Height: 376.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.0000, Y:   2.0000, Width: 491.75, Height: 380.00
VP: 3, X:   2.0000, Y:   2.0000, Width: 491.75, Height: 380.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.1250, Width: 1023.75, Height: 247.7
VP: 3, X:   4.1250, Y:   5.2500, Width: 483.25, Height: 374.25
VP: 3, X:   4.1250, Y:   5.2500, Width: 483.25, Height: 374.25
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.1250, Y:   3.2500, Width: 487.25, Height: 378.25
VP: 3, X:   2.1250, Y:   3.2500, Width: 487.25, Height: 378.25
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0625, Width:  10.75, Height: 247.75
VP: 3, X:   4.2500, Y:   6.5000, Width: 479.00, Height: 372.75
VP: 3, X:   4.2500, Y:   6.5000, Width: 479.00, Height: 372.75
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.2500, Y:   4.5000, Width: 483.00, Height: 376.75
VP: 3, X:   2.2500, Y:   4.5000, Width: 483.00, Height: 376.75
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  22.00, Height: 248.00
VP: 3, X:   4.3750, Y:   7.7500, Width: 474.50, Height: 371.25
VP: 3, X:   4.3750, Y:   7.7500, Width: 474.50, Height: 371.25
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.3750, Y:   5.7500, Width: 478.50, Height: 375.25
VP: 3, X:   2.3750, Y:   5.7500, Width: 478.50, Height: 375.25
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  33.25, Height: 248.00
VP: 3, X:   4.5000, Y:   9.0625, Width: 470.25, Height: 369.50
VP: 3, X:   4.5000, Y:   9.0625, Width: 470.25, Height: 369.50
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.5000, Y:   7.0625, Width: 474.25, Height: 373.50
VP: 3, X:   2.5000, Y:   7.0625, Width: 474.25, Height: 373.50
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  44.50, Height: 248.00
VP: 3, X:   4.6250, Y:  10.3125, Width: 466.00, Height: 368.00
VP: 3, X:   4.6250, Y:  10.3125, Width: 466.00, Height: 368.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.6250, Y:   8.3125, Width: 470.00, Height: 372.00
VP: 3, X:   2.6250, Y:   8.3125, Width: 470.00, Height: 372.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  55.50, Height: 248.00
VP: 3, X:   4.7500, Y:  11.5625, Width: 461.50, Height: 366.50
VP: 3, X:   4.7500, Y:  11.5625, Width: 461.50, Height: 366.50
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.7500, Y:   9.5625, Width: 465.50, Height: 370.50
VP: 3, X:   2.7500, Y:   9.5625, Width: 465.50, Height: 370.50
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  66.75, Height: 248.00
VP: 3, X:   4.8750, Y:  12.8125, Width: 457.25, Height: 365.00
VP: 3, X:   4.8750, Y:  12.8125, Width: 457.25, Height: 365.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   2.8750, Y:  10.8125, Width: 461.25, Height: 369.00
VP: 3, X:   2.8750, Y:  10.8125, Width: 461.25, Height: 369.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  78.00, Height: 248.00
VP: 3, X:   5.0625, Y:  14.1250, Width: 453.00, Height: 363.25
VP: 3, X:   5.0625, Y:  14.1250, Width: 453.00, Height: 363.25
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.0625, Y:  12.1250, Width: 457.00, Height: 367.25
VP: 3, X:   3.0625, Y:  12.1250, Width: 457.00, Height: 367.25
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width:  89.25, Height: 248.00
VP: 3, X:   5.1875, Y:  15.3750, Width: 448.50, Height: 361.75
VP: 3, X:   5.1875, Y:  15.3750, Width: 448.50, Height: 361.75
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.1875, Y:  13.3750, Width: 452.50, Height: 365.75
VP: 3, X:   3.1875, Y:  13.3750, Width: 452.50, Height: 365.75
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 100.50, Height: 248.00
VP: 3, X:   5.3125, Y:  16.6250, Width: 444.25, Height: 360.25
VP: 3, X:   5.3125, Y:  16.6250, Width: 444.25, Height: 360.25
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.3125, Y:  14.6250, Width: 448.25, Height: 364.25
VP: 3, X:   3.3125, Y:  14.6250, Width: 448.25, Height: 364.25
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 111.50, Height: 248.00
VP: 3, X:   5.4375, Y:  17.8750, Width: 440.00, Height: 358.75
VP: 3, X:   5.4375, Y:  17.8750, Width: 440.00, Height: 358.75
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.4375, Y:  15.8750, Width: 444.00, Height: 362.75
VP: 3, X:   3.4375, Y:  15.8750, Width: 444.00, Height: 362.75
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 122.75, Height: 248.00
VP: 3, X:   5.5625, Y:  19.1875, Width: 435.50, Height: 357.00
VP: 3, X:   5.5625, Y:  19.1875, Width: 435.50, Height: 357.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.5625, Y:  17.1875, Width: 439.50, Height: 361.00
VP: 3, X:   3.5625, Y:  17.1875, Width: 439.50, Height: 361.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 134.00, Height: 248.00
VP: 3, X:   5.6875, Y:  20.4375, Width: 431.25, Height: 355.50
VP: 3, X:   5.6875, Y:  20.4375, Width: 431.25, Height: 355.50
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.6875, Y:  18.4375, Width: 435.25, Height: 359.50
VP: 3, X:   3.6875, Y:  18.4375, Width: 435.25, Height: 359.50
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 145.25, Height: 248.00
VP: 3, X:   5.8125, Y:  21.6875, Width: 427.00, Height: 354.00
VP: 3, X:   5.8125, Y:  21.6875, Width: 427.00, Height: 354.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.8125, Y:  19.6875, Width: 431.00, Height: 358.00
VP: 3, X:   3.8125, Y:  19.6875, Width: 431.00, Height: 358.00
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 156.50, Height: 248.00
VP: 3, X:   5.9375, Y:  22.9375, Width: 422.50, Height: 352.50
VP: 3, X:   5.9375, Y:  22.9375, Width: 422.50, Height: 352.50
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   3.9375, Y:  20.9375, Width: 426.50, Height: 356.50
VP: 3, X:   3.9375, Y:  20.9375, Width: 426.50, Height: 356.50
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 167.50, Height: 248.00
VP: 3, X:   6.1250, Y:  24.2500, Width: 418.25, Height: 350.75
VP: 3, X:   6.1250, Y:  24.2500, Width: 418.25, Height: 350.75
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   4.1250, Y:  22.2500, Width: 422.25, Height: 354.75
VP: 3, X:   4.1250, Y:  22.2500, Width: 422.25, Height: 354.75
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 178.75, Height: 248.00
VP: 3, X:   6.2500, Y:  25.5000, Width: 414.00, Height: 349.25
VP: 3, X:   6.2500, Y:  25.5000, Width: 414.00, Height: 349.25
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   4.2500, Y:  23.5000, Width: 418.00, Height: 353.25
VP: 3, X:   4.2500, Y:  23.5000, Width: 418.00, Height: 353.25
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 190.00, Height: 248.00
VP: 3, X:   6.3750, Y:  26.7500, Width: 409.50, Height: 347.75
VP: 3, X:   6.3750, Y:  26.7500, Width: 409.50, Height: 347.75
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   4.3750, Y:  24.7500, Width: 413.50, Height: 351.75
VP: 3, X:   4.3750, Y:  24.7500, Width: 413.50, Height: 351.75
VP: 3, X: 357.0000, Y: 238.0000, Width: 129.75, Height: 160.00
VP: 3, X:  16.0000, Y: 112.0000, Width: 201.25, Height: 248.00
VP: 3, X:   6.5000, Y:  28.0625, Width: 405.25, Height: 346.00
VP: 3, X:   6.5000, Y:  28.0625, Width: 405.25, Height: 346.00
VP: 3, X:   0.0000, Y:   0.0000, Width: 495.75, Height: 384.00
VP: 3, X:   4.5000, Y:  26.0625, Width: 409.25, Height: 350.00
VP: 3, X:   4.5000, Y:  26.0625, Width: 409.25, Height: 350.00


That's the first tutorial sequence
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby Ian » Tue Mar 14, 2017 3:18 pm

Last brain dump ...

Was looking at the viewport values for vf3. When the game boots it starts off as

0.000000 0.000000 496.000000 384.000000
0.000000 0.000000 496.000000 384.000000
0.000000 0.000000 496.000000 384.000000
0.000000 0.000000 496.000000 384.000000
0.000000 0.000000 495.750000 384.000000
0.000000 0.000000 495.750000 384.000000
0.000000 0.000000 495.750000 384.000000
0.000000 0.000000 495.750000 384.000000


I wonder if the maths work if we assume a fractional component? Instead of rounding up. The real3d specifies things in terms of a % of the viewport size ..
Probably should have pointed out, width starts at 496, then drops to 495.75
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] 2D-3D Layer Alignment (part 1)

Postby HarryTuttle » Tue Mar 14, 2017 3:46 pm

Just tried, but no-go... :(

When creating viewports (glViewport) OpenGL assumes integers anyway... so i think they're rounded at last.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Next

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron