TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 5 of 5

Thread: 16-bit Rendering with NewDark

  1. #1
    Member
    Registered: Nov 2001
    Location: Sunny Finland

    16-bit Rendering with NewDark

    So why is there no 16-bit rendering option in NewDark? I don't know, but here's how to enable it.

    Using your favorite hex editor, make the following change to the game binary (thief.exe):

    Code:
    Search for the following bytes, probably at offset 1f8c72:
    
    83ee 2053 518b 0de0 ff98 00f7 de1b f651 83e6 fd83 c674
    
    Replace with:
    
    9090 9053 518b 0de0 ff98 0090 9090 9051 9090 9090 9090
    And cam_ext.cfg:
    Code:
    d3d_disp_enable_hdr 23
    Then start the game and enjoy 16-bit banding like it's 1998.

    With the hex edit, the value of the d3d_disp_enable_hdr configuration variable is directly used as the render target format. The value 23 for d3d_disp_enable_hdr is D3DFMT_R5G6B5, from https://docs.microsoft.com/en-us/win...t3d9/d3dformat. D3DFMT_X1R5G5B5 (24) also works. Some other formats, such as D3DFMT_L8 theoretically should work, but don't. I don't know why.

    The hex edit modifies the code below. The first call here is clearly a call to a function to read the configuration variable, which is apparently returned in ESI. Then there's some weird gymnastics performed on it before it's passed on to the CreateRenderTarget() call at the end. The hex edit simply NOPs out all the operations on ESI, so that the value of the configuration variable is used as-is as the render target format.

    Code:
    00D9983A | 68 94CDE900              | push thief.E9CD94                       | E9CD94:"d3d_disp_enable_hdr"
    00D9983F | 8D4C24 14                | lea ecx,dword ptr ss:[esp+14]           |
    00D99843 | BA 01000000              | mov edx,1                               |
    00D99848 | C74424 14 10000000       | mov dword ptr ss:[esp+14],10            |
    00D99850 | E8 DBBF0600              | call <thief.sub_E05830>                 |
    00D99855 | 8B7424 14                | mov esi,dword ptr ss:[esp+14]           |
    00D99859 | 8B0D E4FF1201            | mov ecx,dword ptr ds:[112FFE4]          |
    00D9985F | A1 5C911701              | mov eax,dword ptr ds:[117915C]          |
    00D99864 | 8B10                     | mov edx,dword ptr ds:[eax]              |
    00D99866 | 8B52 70                  | mov edx,dword ptr ds:[edx+70]           |
    00D99869 | 83C4 04                  | add esp,4                               |
    00D9986C | 53                       | push ebx                                |
    00D9986D | 68 60911701              | push thief.1179160                      |
    00D99872 | 83EE 20                  | sub esi,20                              |
    00D99875 | 53                       | push ebx                                |
    00D99876 | 51                       | push ecx                                |
    00D99877 | 8B0D E0FF1201            | mov ecx,dword ptr ds:[112FFE0]          |
    00D9987D | F7DE                     | neg esi                                 |
    00D9987F | 1BF6                     | sbb esi,esi                             |
    00D99881 | 51                       | push ecx                                |
    00D99882 | 83E6 FD                  | and esi,FFFFFFFD                        |
    00D99885 | 83C6 74                  | add esi,74                              |
    00D99888 | 56                       | push esi                                |
    00D99889 | 55                       | push ebp                                |
    00D9988A | 57                       | push edi                                |
    00D9988B | 50                       | push eax                                |
    00D9988C | FFD2                     | call edx                                | edx:public: virtual long __stdcall CBaseDevice::CreateRenderTarget(unsigned int,unsigned int,enum _D3DFORMAT,enum _D3DMULTISAMPLE_TYPE,unsigned long,int,struct IDirect3DSurface9 * *,void * *)

  2. #2
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    Quote Originally Posted by jermi View Post
    So why is there no 16-bit rendering option in NewDark?
    Your screenshot illustrates exactly why: Because modern video cards don't do it correctly. 16-bit render modes used to be dithered, but they aren't anymore.

    I believe NewDark comes with a sample shader that reproduces the old 16-bit dither look. I haven't tried it myself.

  3. #3
    Member
    Registered: Jan 2004
    Cards all used different methods - 16-bit looked better on a Voodoo 5 than a TNT, for example (and better than this).

    I can appreciate some nostalgia for the old software mode, but I can't say I have any desire to revisit this.

  4. #4
    Member
    Registered: Nov 2001
    Location: Sunny Finland
    TDP did not use dithering. TMA and SS2 did.

  5. #5
    New Member
    Registered: Sep 2017
    Thank you so much. So good to see it in NewDark. It really alters the atmosphere. It would be more great with dithering.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •