Skip to content

Instantly share code, notes, and snippets.

@drdaxxy
Last active March 14, 2023 21:11
Show Gist options
  • Save drdaxxy/77b1ff884ecba47dc705768999e6e01d to your computer and use it in GitHub Desktop.
Save drdaxxy/77b1ff884ecba47dc705768999e6e01d to your computer and use it in GitHub Desktop.
FOR PLAYERS: Use this instead (press Ctrl+Shift+Backspace in game for the option): http://steamcommunity.com/app/524220/discussions/0/135512104777399045
/*
* If you're an end user (i.e. you don't know what to do with this file):
* You'll probably want to download Kaldaien's mod, which includes these changes.
*
* http://steamcommunity.com/app/524220/discussions/0/135512104777399045
*
*/
HRESULT __stdcall CreateBufferHook(void *This, D3D11_BUFFER_DESC *pDesc,
D3D11_SUBRESOURCE_DATA *pInitialData,
ID3D11Buffer **ppBuffer) {
if (pDesc != NULL && pDesc->StructureByteStride == 96 &&
pDesc->ByteWidth == 96 * 128) {
pDesc->ByteWidth = 96 * 16;
}
return CreateBufferOriginal(This, pDesc, pInitialData, ppBuffer);
}
HRESULT __stdcall CreateShaderResourceViewHook(
void *This, ID3D11Resource *pResource,
D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
ID3D11ShaderResourceView **ppSRView) {
if (pDesc != NULL && pDesc->ViewDimension == D3D_SRV_DIMENSION_BUFFEREX &&
pDesc->BufferEx.NumElements == 128) {
ID3D11Buffer *pBuf;
HRESULT res =
pResource->QueryInterface(__uuidof(ID3D11Buffer), (void **)&pBuf);
if (SUCCEEDED(res)) {
D3D11_BUFFER_DESC bufferDesc;
pBuf->GetDesc(&bufferDesc);
if (bufferDesc.ByteWidth == 96 * 16) {
pDesc->BufferEx.NumElements = 16;
}
}
}
return CreateShaderResourceViewOriginal(This, pResource, pDesc, ppSRView);
}
@earthgta2010
Copy link

How can i use ??

@drdaxxy
Copy link
Author

drdaxxy commented Mar 25, 2017

@earthgta2010 you don't use this, you use Kaldaien's mod, which includes this: http://steamcommunity.com/app/524220/discussions/0/135512104777399045

Press Ctrl+Shift+Backspace in game to change the global illumination quality setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment