Skip to content

Commit

Permalink
Merge pull request #135 from SaiyansKing/master
Browse files Browse the repository at this point in the history
Fix hooking zCActiveSndAutoCalcObstruction, change from RGBA to BGRA, add Fog Range option, fixed memory leak
  • Loading branch information
kirides authored Jul 5, 2023
2 parents 8a15974 + b417b0a commit b34c5ed
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 85 deletions.
1 change: 1 addition & 0 deletions D3D11Engine/BaseAntTweakBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ XRESULT BaseAntTweakBar::Init() {
TwAddVarRW( Bar_General, "Draw ParticleEffects", TW_TYPE_BOOLCPP, &Engine::GAPI->GetRendererState().RendererSettings.DrawParticleEffects, nullptr );
//TwAddVarRW(Bar_General, "Draw Sky", TW_TYPE_BOOLCPP, &Engine::GAPI->GetRendererState().RendererSettings.DrawSky, nullptr);
TwAddVarRW( Bar_General, "Draw Fog", TW_TYPE_BOOLCPP, &Engine::GAPI->GetRendererState().RendererSettings.DrawFog, nullptr );
TwAddVarRW( Bar_General, "Fog Range", TwDefineEnumFromString( "FogRangeEnum", "3, 4, 5, 6, 7, 8, 9, 10" ), &Engine::GAPI->GetRendererState().RendererSettings.FogRange, nullptr );
#if ENABLE_TESSELATION > 0
TwAddVarRW( Bar_General, "Tesselation", TW_TYPE_BOOLCPP, &Engine::GAPI->GetRendererState().RendererSettings.EnableTesselation, nullptr );
#endif
Expand Down
2 changes: 1 addition & 1 deletion D3D11Engine/BaseGraphicsEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class BaseGraphicsEngine {
virtual INT2 GetBackbufferResolution() { return GetResolution(); }

/** Returns the data of the backbuffer */
virtual void GetBackbufferData( byte** data, int& pixelsize ) {}
virtual void GetBackbufferData( byte** data, INT2& buffersize, int& pixelsize ) {}

/** Draws a fullscreenquad, copying the given texture to the viewport */
virtual void DrawQuad( INT2 position, INT2 size ) {}
Expand Down
50 changes: 24 additions & 26 deletions D3D11Engine/D3D11GraphicsEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ XRESULT D3D11GraphicsEngine::Init() {
// Create dummy rendertarget for shadowcubes
DummyShadowCubemapTexture = std::make_unique<RenderToTextureBuffer>(
GetDevice(), POINTLIGHT_SHADOWMAP_SIZE, POINTLIGHT_SHADOWMAP_SIZE,
DXGI_FORMAT_R8G8B8A8_UNORM, nullptr, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_B8G8R8A8_UNORM, nullptr, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, 1, 6 );

SteamOverlay::Init();
Expand Down Expand Up @@ -706,7 +706,7 @@ XRESULT D3D11GraphicsEngine::OnResize( INT2 newSize ) {
LogInfo() << "SwapChain: DXGI_FEATURE_PRESENT_ALLOW_TEARING = " << (m_flipWithTearing ? "Enabled" : "Disabled");
}

LogInfo() << "Creating new swapchain! (Format: DXGI_FORMAT_R8G8B8A8_UNORM)";
LogInfo() << "Creating new swapchain! (Format: DXGI_FORMAT_B8G8R8A8_UNORM)";

if ( m_swapchainflip ) {
scd.BufferCount = 2;
Expand Down Expand Up @@ -761,7 +761,7 @@ XRESULT D3D11GraphicsEngine::OnResize( INT2 newSize ) {
// Need to init AntTweakBar now that we have a working swapchain
XLE( Engine::AntTweakBar->Init() );
} else {
LogInfo() << "Resizing swapchain (Format: DXGI_FORMAT_R8G8B8A8_UNORM)";
LogInfo() << "Resizing swapchain (Format: DXGI_FORMAT_B8G8R8A8_UNORM)";
if ( dxgi_1_5 ) {
//if (FAILED(SwapChain4->SetSourceSize(bbres.x, bbres.y))) { //crashes when scd.Scaling = DXGI_SCALING_STRETCH is not set;
if ( FAILED( SwapChain4->ResizeBuffers( 0, bbres.x, bbres.y, DXGI_FORMAT_B8G8R8A8_UNORM, scflags ) ) ) {
Expand Down Expand Up @@ -870,7 +870,7 @@ XRESULT D3D11GraphicsEngine::OnResize( INT2 newSize ) {
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_R16G16B16A16_FLOAT );

GBuffer0_Diffuse = std::make_unique<RenderToTextureBuffer>(
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_R8G8B8A8_UNORM );
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_B8G8R8A8_UNORM );

HDRBackBuffer = std::make_unique<RenderToTextureBuffer>( GetDevice().Get(), Resolution.x, Resolution.y,
(Engine::GAPI->GetRendererState().RendererSettings.CompressBackBuffer ? DXGI_FORMAT_R11G11B10_FLOAT : DXGI_FORMAT_R16G16B16A16_FLOAT) );
Expand Down Expand Up @@ -1129,14 +1129,14 @@ XRESULT D3D11GraphicsEngine::FetchDisplayModeListDXGI() {
}

UINT numModes = 0;
hr = output->GetDisplayModeList1( DXGI_FORMAT_R8G8B8A8_UNORM, 0, &numModes, nullptr );
hr = output->GetDisplayModeList1( DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, nullptr );
if ( FAILED( hr ) || numModes == 0 ) {
CachedDisplayModes.emplace_back( Resolution.x, Resolution.y );
return XR_FAILED;
}

std::unique_ptr<DXGI_MODE_DESC1[]> displayModes = std::make_unique<DXGI_MODE_DESC1[]>( numModes );
hr = output->GetDisplayModeList1( DXGI_FORMAT_R8G8B8A8_UNORM, 0, &numModes, displayModes.get() );
hr = output->GetDisplayModeList1( DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, displayModes.get() );
if ( FAILED( hr ) ) {
CachedDisplayModes.emplace_back( Resolution.x, Resolution.y );
return XR_FAILED;
Expand Down Expand Up @@ -1899,8 +1899,9 @@ XRESULT D3D11GraphicsEngine::DrawSkeletalMesh( SkeletalVobInfo* vi,
if ( zCMaterial* mat = itm.first ) {
zCTexture* tex;
if ( ActivePS && (tex = mat->GetAniTexture()) != nullptr ) {
if ( !BindTextureNRFX( tex, (RenderingStage != DES_GHOST) ) )
if ( !BindTextureNRFX( tex, (RenderingStage != DES_GHOST) ) ) {
continue;
}
}
}

Expand Down Expand Up @@ -5474,9 +5475,9 @@ void D3D11GraphicsEngine::OnUIEvent( EUIEvent uiEvent ) {
}

/** Returns the data of the backbuffer */
void D3D11GraphicsEngine::GetBackbufferData( byte** data, int& pixelsize ) {
constexpr int width = 256;
byte* d = new byte[width * width * 4];
void D3D11GraphicsEngine::GetBackbufferData( byte** data, INT2& buffersize, int& pixelsize ) {
buffersize = Resolution;
byte* d = new byte[Resolution.x * Resolution.y * 4];

// Copy HDR scene to backbuffer
SetDefaultStates();
Expand All @@ -5494,24 +5495,19 @@ void D3D11GraphicsEngine::GetBackbufferData( byte** data, int& pixelsize ) {
ActivePS->GetConstantBuffer()[0]->BindToPixelShader( 0 );

HRESULT hr;

// Buffer for scaling down the image
auto rt = std::make_unique<RenderToTextureBuffer>(
GetDevice().Get(), width, width, DXGI_FORMAT_R8G8B8A8_UNORM );

// Downscale to 256x256
PfxRenderer->CopyTextureToRTV( HDRBackBuffer->GetShaderResView(), rt->GetRenderTargetView(), INT2( width, width ),
GetDevice().Get(), buffersize.x, buffersize.y, DXGI_FORMAT_B8G8R8A8_UNORM );
PfxRenderer->CopyTextureToRTV( HDRBackBuffer->GetShaderResView(), rt->GetRenderTargetView(), INT2( buffersize.x, buffersize.y ),
true );
GetContext()->Flush();

D3D11_TEXTURE2D_DESC texDesc;
texDesc.ArraySize = 1;
texDesc.BindFlags = 0;
texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texDesc.Width = width; // Gothic transforms the backbufferdata for
// savegamethumbs to 256x256-pictures anyways
texDesc.Height = width;
texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
texDesc.Width = buffersize.x;
texDesc.Height = buffersize.y;
texDesc.MipLevels = 1;
texDesc.MiscFlags = 0;
texDesc.SampleDesc.Count = 1;
Expand All @@ -5532,13 +5528,15 @@ void D3D11GraphicsEngine::GetBackbufferData( byte** data, int& pixelsize ) {
if ( SUCCEEDED( GetContext()->Map( texture.Get(), 0, D3D11_MAP_READ, 0, &res ) ) ) {
unsigned char* dstData = reinterpret_cast<unsigned char*>(res.pData);
unsigned char* srcData = reinterpret_cast<unsigned char*>(d);
UINT length = width * 4;
UINT length = buffersize.x * 4;
if ( length == res.RowPitch ) {
memcpy( srcData, dstData, length * width );
memcpy( srcData, dstData, length * buffersize.y );
} else {
if ( length > res.RowPitch )
if ( length > res.RowPitch ) {
length = res.RowPitch;
for ( int row = 0; row < width; ++row ) {
}

for ( int row = 0; row < buffersize.y; ++row ) {
memcpy( srcData, dstData, length );
srcData += length;
dstData += res.RowPitch;
Expand Down Expand Up @@ -6267,7 +6265,7 @@ void D3D11GraphicsEngine::SaveScreenshot() {

// Buffer for scaling down the image
auto rt = std::make_unique<RenderToTextureBuffer>(
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_R8G8B8A8_UNORM );
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_B8G8R8A8_UNORM );

// Downscale to 256x256
PfxRenderer->CopyTextureToRTV( HDRBackBuffer->GetShaderResView(), rt->GetRenderTargetView() );
Expand All @@ -6276,7 +6274,7 @@ void D3D11GraphicsEngine::SaveScreenshot() {
texDesc.ArraySize = 1;
texDesc.BindFlags = 0;
texDesc.CPUAccessFlags = 0;
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
texDesc.Width = Resolution.x; // must be same as backbuffer
texDesc.Height = Resolution.y; // must be same as backbuffer
texDesc.MipLevels = 1;
Expand Down
2 changes: 1 addition & 1 deletion D3D11Engine/D3D11GraphicsEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class D3D11GraphicsEngine : public D3D11GraphicsEngineBase {
INT2 GetBackbufferResolution();

/** Returns the data of the backbuffer */
void GetBackbufferData( byte** data, int& pixelsize );
void GetBackbufferData( byte** data, INT2& buffersize, int& pixelsize );

/** Returns the line renderer object */
BaseLineRenderer* GetLineRenderer();
Expand Down
2 changes: 1 addition & 1 deletion D3D11Engine/D3D11PFX_HeightFog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ XRESULT D3D11PFX_HeightFog::Render( RenderToTextureBuffer* fxbuffer ) {

float fnear = 15000.0f;
float ffar = 60000.0f;
float secScale = Engine::GAPI->GetRendererState().RendererSettings.SectionDrawRadius;
float secScale = std::min<float>( Engine::GAPI->GetRendererState().RendererSettings.SectionDrawRadius, Engine::GAPI->GetRendererState().RendererSettings.FogRange + 3 );

cb.HF_WeightZNear = std::max( 0.0f, WORLD_SECTION_SIZE * ((secScale - 0.5f) * 0.7f) - (ffar - fnear) ); // Keep distance from original fog but scale the near-fog up to section draw distance
cb.HF_WeightZFar = WORLD_SECTION_SIZE * ((secScale - 0.5f) * 0.8f);
Expand Down
4 changes: 2 additions & 2 deletions D3D11Engine/D3D11PFX_SMAA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ void D3D11PFX_SMAA::OnResize( const INT2& size ) {
HRESULT hr = S_OK;

// Create Edges- and Blend-Textures
EdgesTex = new RenderToTextureBuffer( engine->GetDevice().Get(), size.x, size.y, DXGI_FORMAT_R8G8B8A8_UNORM, &hr );
EdgesTex = new RenderToTextureBuffer( engine->GetDevice().Get(), size.x, size.y, DXGI_FORMAT_B8G8R8A8_UNORM, &hr );
LE( hr );

BlendTex = new RenderToTextureBuffer( engine->GetDevice().Get(), size.x, size.y, DXGI_FORMAT_R8G8B8A8_UNORM, &hr );
BlendTex = new RenderToTextureBuffer( engine->GetDevice().Get(), size.x, size.y, DXGI_FORMAT_B8G8R8A8_UNORM, &hr );
LE( hr );

std::vector<D3D_SHADER_MACRO> Makros;
Expand Down
8 changes: 4 additions & 4 deletions D3D11Engine/D3D11Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ UINT D3D11Texture::GetRowPitchBytes( int mip ) {
if ( TextureFormat == DXGI_FORMAT_BC1_UNORM || TextureFormat == DXGI_FORMAT_BC2_UNORM ||
TextureFormat == DXGI_FORMAT_BC3_UNORM ) {
return Toolbox::GetDDSRowPitchSize( px, TextureFormat == DXGI_FORMAT_BC1_UNORM );
} else { // Use R8G8B8A8
} else { // Use B8G8R8A8
return px * 4;
}
}
Expand All @@ -160,7 +160,7 @@ UINT D3D11Texture::GetSizeInBytes( int mip ) {
if ( TextureFormat == DXGI_FORMAT_BC1_UNORM || TextureFormat == DXGI_FORMAT_BC2_UNORM ||
TextureFormat == DXGI_FORMAT_BC3_UNORM ) {
return Toolbox::GetDDSStorageRequirements( px, py, TextureFormat == DXGI_FORMAT_BC1_UNORM );
} else { // Use R8G8B8A8
} else { // Use B8G8R8A8
return px * py * 4;
}
}
Expand Down Expand Up @@ -195,7 +195,7 @@ XRESULT D3D11Texture::CreateThumbnail() {

// Create texture
CD3D11_TEXTURE2D_DESC textureDesc(
DXGI_FORMAT_R8G8B8A8_UNORM,
DXGI_FORMAT_B8G8R8A8_UNORM,
256,
256,
1,
Expand Down Expand Up @@ -241,7 +241,7 @@ XRESULT D3D11Texture::GenerateMipMaps() {
D3D11GraphicsEngineBase* engine = reinterpret_cast<D3D11GraphicsEngineBase*>(Engine::GraphicsEngine);

std::unique_ptr<RenderToTextureBuffer> b = std::make_unique<RenderToTextureBuffer>( engine->GetDevice().Get(), TextureSize.x, TextureSize.y,
DXGI_FORMAT_R8G8B8A8_UNORM, nullptr, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, MipMapCount );
DXGI_FORMAT_B8G8R8A8_UNORM, nullptr, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, MipMapCount );

// Copy the main image
engine->GetContext()->CopySubresourceRegion( b->GetTexture().Get(), 0, 0, 0, 0, Texture.Get(), 0, nullptr );
Expand Down
2 changes: 1 addition & 1 deletion D3D11Engine/D3D11Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class D3D11Texture {

/** Layec out for DXGI */
enum ETextureFormat {
TF_R8G8B8A8 = DXGI_FORMAT_R8G8B8A8_UNORM,
TF_B8G8R8A8 = DXGI_FORMAT_B8G8R8A8_UNORM,
TF_DXT1 = DXGI_FORMAT_BC1_UNORM,
TF_DXT3 = DXGI_FORMAT_BC2_UNORM,
TF_DXT5 = DXGI_FORMAT_BC3_UNORM
Expand Down
12 changes: 6 additions & 6 deletions D3D11Engine/D3D7/Conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static void Convert565to8888(unsigned char* dst, unsigned char* src, UINT realDa
unsigned char greenComponent = ((pixel_data >> 5) & 63) << 2;
unsigned char blueComponent = ((pixel_data >> 11) & 31) << 3;

dst[4 * i + 2] = redComponent;
dst[4 * i + 2] = blueComponent;
dst[4 * i + 1] = greenComponent;
dst[4 * i + 0] = blueComponent;
dst[4 * i + 0] = redComponent;
dst[4 * i + 3] = 255;
}
}
Expand All @@ -53,9 +53,9 @@ static void Convert1555to8888(unsigned char* dst, unsigned char* src, UINT realD
unsigned char blueComponent = ((pixel_data >> 10) & 31) << 3;
unsigned char alphaComponent = (pixel_data >> 15) * 0xFF;

dst[4 * i + 2] = redComponent;
dst[4 * i + 2] = blueComponent;
dst[4 * i + 1] = greenComponent;
dst[4 * i + 0] = blueComponent;
dst[4 * i + 0] = redComponent;
dst[4 * i + 3] = alphaComponent;
}
}
Expand All @@ -73,9 +73,9 @@ static void Convert4444to8888(unsigned char* dst, unsigned char* src, UINT realD
unsigned char blueComponent = ((pixel_data >> 8) & 15) << 4;
unsigned char alphaComponent = ((pixel_data >> 12) & 15) << 4;

dst[4 * i + 2] = redComponent;
dst[4 * i + 2] = blueComponent;
dst[4 * i + 1] = greenComponent;
dst[4 * i + 0] = blueComponent;
dst[4 * i + 0] = redComponent;
dst[4 * i + 3] = alphaComponent;
}
}
Expand Down
2 changes: 1 addition & 1 deletion D3D11Engine/D3D7/MyDirectDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class MyDirectDraw : public IDirectDraw7 {
break;
}
} else {
fmt = DXGI_FORMAT_R8G8B8A8_UNORM;
fmt = DXGI_FORMAT_B8G8R8A8_UNORM;
bpp = 32;
}

Expand Down
19 changes: 10 additions & 9 deletions D3D11Engine/D3D7/MyDirectDrawSurface7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,23 @@ HRESULT MyDirectDrawSurface7::Lock( LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurf
{
// Assume 32-bit
byte* data;
INT2 buffersize;
int pixelSize;
reinterpret_cast<D3D11GraphicsEngineBase*>(Engine::GraphicsEngine)->ResetPresentPending();
Engine::GraphicsEngine->OnStartWorldRendering();
Engine::GraphicsEngine->GetBackbufferData( &data, pixelSize );
Engine::GraphicsEngine->GetBackbufferData( &data, buffersize, pixelSize );
reinterpret_cast<D3D11GraphicsEngineBase*>(Engine::GraphicsEngine)->ResetPresentPending();

lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount = 32;
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0x000000FF;
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask = 0x00FF0000;
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x0000FF00;
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x00FF0000;
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x000000FF;
lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask = 0x00000000;

// Gothic transforms this into a 256x256 texture anyways
lpDDSurfaceDesc->lPitch = 256 * pixelSize;
lpDDSurfaceDesc->dwWidth = 256;
lpDDSurfaceDesc->dwHeight = 256;
lpDDSurfaceDesc->lPitch = buffersize.x * pixelSize;
lpDDSurfaceDesc->dwWidth = buffersize.x;
lpDDSurfaceDesc->dwHeight = buffersize.y;
lpDDSurfaceDesc->lpSurface = data;

LockedData = data;
Expand Down Expand Up @@ -535,15 +536,15 @@ HRESULT MyDirectDrawSurface7::SetSurfaceDesc( LPDDSURFACEDESC2 lpDDSurfaceDesc,
int bpp = redBits + greenBits + blueBits + alphaBits;

// Find out format
D3D11Texture::ETextureFormat format = D3D11Texture::ETextureFormat::TF_R8G8B8A8;
D3D11Texture::ETextureFormat format = D3D11Texture::ETextureFormat::TF_B8G8R8A8;
switch ( bpp ) {
case 16:
format = D3D11Texture::ETextureFormat::TF_R8G8B8A8;
format = D3D11Texture::ETextureFormat::TF_B8G8R8A8;
break;

case 24:
case 32:
format = D3D11Texture::ETextureFormat::TF_R8G8B8A8;
format = D3D11Texture::ETextureFormat::TF_B8G8R8A8;
break;

case 0:
Expand Down
2 changes: 2 additions & 0 deletions D3D11Engine/DLLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ int WINAPI hooked_WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR l
// Remove automatic volume change of sounds regarding whether the camera is indoor or outdoor
// TODO: Implement!
if ( !GMPModeActive ) {
DetourTransactionBegin();
DetourAttach( &reinterpret_cast<PVOID&>(HookedFunctions::OriginalFunctions.original_zCActiveSndAutoCalcObstruction), HookedFunctionInfo::hooked_zCActiveSndAutoCalcObstruction );
DetourTransactionCommit();
}
return originalWinMain( hInstance, hPrevInstance, lpCmdLine, nShowCmd );
}
Expand Down
4 changes: 2 additions & 2 deletions D3D11Engine/GOcean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void GOcean::CreateFresnelMap( Microsoft::WRL::ComPtr<ID3D11Device1> pd3dDevice
tex_desc.Width = FRESNEL_TEX_SIZE;
tex_desc.MipLevels = 1;
tex_desc.ArraySize = 1;
tex_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
tex_desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
tex_desc.Usage = D3D11_USAGE_IMMUTABLE;
tex_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
tex_desc.CPUAccessFlags = 0;
Expand All @@ -154,7 +154,7 @@ void GOcean::CreateFresnelMap( Microsoft::WRL::ComPtr<ID3D11Device1> pd3dDevice

// Create shader resource
D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc = {};
srv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
srv_desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1D;
srv_desc.Texture1D.MipLevels = 1;
srv_desc.Texture1D.MostDetailedMip = 0;
Expand Down
Loading

0 comments on commit b34c5ed

Please # to comment.