diff --git a/Editor/CameraWindow.cpp b/Editor/CameraWindow.cpp index 0b2268a13..a064ddfba 100644 --- a/Editor/CameraWindow.cpp +++ b/Editor/CameraWindow.cpp @@ -73,7 +73,7 @@ CameraWindow::CameraWindow(wiGUI* gui) :GUI(gui) - cameraWindow->Translate(XMFLOAT3(30, 30, 0)); + cameraWindow->Translate(XMFLOAT3(760, 500, 0)); cameraWindow->SetVisible(false); } diff --git a/Editor/OceanWindow.cpp b/Editor/OceanWindow.cpp index 87d236fa7..9f6dd15b2 100644 --- a/Editor/OceanWindow.cpp +++ b/Editor/OceanWindow.cpp @@ -27,7 +27,7 @@ OceanWindow::OceanWindow(wiGUI* gui) :GUI(gui) - oceanWindow->Translate(XMFLOAT3(30, 30, 0)); + oceanWindow->Translate(XMFLOAT3(800, 50, 0)); oceanWindow->SetVisible(false); } diff --git a/WickedEngine/fft_512x512_c2c_CS.hlsl b/WickedEngine/fft_512x512_c2c_CS.hlsl index 26286a559..338bb5de4 100644 --- a/WickedEngine/fft_512x512_c2c_CS.hlsl +++ b/WickedEngine/fft_512x512_c2c_CS.hlsl @@ -6,7 +6,7 @@ #define COHERENCY_GRANULARITY 128 - + void FT2(inout float2 a, inout float2 b) { float t; @@ -101,20 +101,20 @@ void main(uint3 thread_id : SV_DispatchThreadID) float2 D[8]; uint i; - uint imod = thread_id & (istride - 1); - uint iaddr = ((thread_id - imod) << 3) + imod; + uint imod = thread_id.x & (istride - 1); + uint iaddr = ((thread_id.x - imod) << 3) + imod; for (i = 0; i < 8; i++) D[i] = g_SrcData[iaddr + i * istride]; // Math FFT_forward_8(D); - uint p = thread_id & (istride - pstride); + uint p = thread_id.x & (istride - pstride); float phase = phase_base * (float)p; TWIDDLE_8(D, phase); // Store the result - uint omod = thread_id & (ostride - 1); - uint oaddr = ((thread_id - omod) << 3) + omod; + uint omod = thread_id.x & (ostride - 1); + uint oaddr = ((thread_id.x - omod) << 3) + omod; g_DstData[oaddr + 0 * ostride] = D[0]; g_DstData[oaddr + 1 * ostride] = D[4]; g_DstData[oaddr + 2 * ostride] = D[2]; @@ -136,7 +136,7 @@ void main(uint3 thread_id : SV_DispatchThreadID) // Fetch 8 complex numbers uint i; float2 D[8]; - uint iaddr = thread_id << 3; + uint iaddr = thread_id.x << 3; for (i = 0; i < 8; i++) D[i] = g_SrcData[iaddr + i]; @@ -144,8 +144,8 @@ void main(uint3 thread_id : SV_DispatchThreadID) FFT_forward_8(D); // Store the result - uint omod = thread_id & (ostride - 1); - uint oaddr = ((thread_id - omod) << 3) + omod; + uint omod = thread_id.x & (ostride - 1); + uint oaddr = ((thread_id.x - omod) << 3) + omod; g_DstData[oaddr + 0 * ostride] = D[0]; g_DstData[oaddr + 1 * ostride] = D[4]; g_DstData[oaddr + 2 * ostride] = D[2]; diff --git a/WickedEngine/wiGraphicsDevice_DX11.cpp b/WickedEngine/wiGraphicsDevice_DX11.cpp index 961185cb9..110a7842d 100644 --- a/WickedEngine/wiGraphicsDevice_DX11.cpp +++ b/WickedEngine/wiGraphicsDevice_DX11.cpp @@ -1405,7 +1405,7 @@ GraphicsDevice_DX11::GraphicsDevice_DX11(wiWindowRegistration::window_type windo } UINT createDeviceFlags = 0; - createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; + //createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; D3D_DRIVER_TYPE driverTypes[] = { diff --git a/WickedEngine/wiOcean.cpp b/WickedEngine/wiOcean.cpp index 5ce5d3e61..578323d4c 100644 --- a/WickedEngine/wiOcean.cpp +++ b/WickedEngine/wiOcean.cpp @@ -679,14 +679,14 @@ void wiOcean::initRenderResource() RasterizerStateDesc ras_desc; ras_desc.FillMode = FILL_SOLID; ras_desc.CullMode = CULL_NONE; - ras_desc.FrontCounterClockwise = FALSE; + ras_desc.FrontCounterClockwise = false; ras_desc.DepthBias = 0; ras_desc.SlopeScaledDepthBias = 0.0f; ras_desc.DepthBiasClamp = 0.0f; - ras_desc.DepthClipEnable = TRUE; - ras_desc.ScissorEnable = FALSE; - ras_desc.MultisampleEnable = TRUE; - ras_desc.AntialiasedLineEnable = FALSE; + ras_desc.DepthClipEnable = true; + ras_desc.ScissorEnable = false; + ras_desc.MultisampleEnable = true; + ras_desc.AntialiasedLineEnable = false; g_pRSState_Solid = new RasterizerState; device->CreateRasterizerState(&ras_desc, g_pRSState_Solid); @@ -698,16 +698,18 @@ void wiOcean::initRenderResource() DepthStencilStateDesc depth_desc; memset(&depth_desc, 0, sizeof(DepthStencilStateDesc)); - depth_desc.DepthEnable = FALSE; - depth_desc.StencilEnable = FALSE; + depth_desc.DepthEnable = true; + depth_desc.DepthWriteMask = DEPTH_WRITE_MASK_ALL; + depth_desc.DepthFunc = COMPARISON_GREATER; + depth_desc.StencilEnable = false; g_pDSState_Disable = new DepthStencilState; device->CreateDepthStencilState(&depth_desc, g_pDSState_Disable); BlendStateDesc blend_desc; memset(&blend_desc, 0, sizeof(BlendStateDesc)); - blend_desc.AlphaToCoverageEnable = FALSE; - blend_desc.IndependentBlendEnable = FALSE; - blend_desc.RenderTarget[0].BlendEnable = TRUE; + blend_desc.AlphaToCoverageEnable = false; + blend_desc.IndependentBlendEnable = false; + blend_desc.RenderTarget[0].BlendEnable = true; blend_desc.RenderTarget[0].SrcBlend = BLEND_SRC_ALPHA; blend_desc.RenderTarget[0].DestBlend = BLEND_INV_SRC_ALPHA; blend_desc.RenderTarget[0].BlendOp = BLEND_OP_ADD; @@ -1439,6 +1441,7 @@ void wiOcean::Render(const Camera* camera, float time) // State blocks device->BindRasterizerState(wire ? g_pRSState_Wireframe : g_pRSState_Solid, threadID); + device->BindDepthStencilState(g_pDSState_Disable, 0, threadID); // Constants device->BindConstantBufferVS(g_pShadingCB, CB_GETBINDSLOT(Ocean_Rendering_ShadingCB), threadID); diff --git a/WickedEngine/wiOcean.h b/WickedEngine/wiOcean.h index e18ea18d5..e90c0177a 100644 --- a/WickedEngine/wiOcean.h +++ b/WickedEngine/wiOcean.h @@ -48,14 +48,14 @@ struct wiOceanParameter wiOceanParameter() { - choppy_scale = 1; dmap_dim = 512; - patch_length = 1000; - time_scale = 1; - wave_amplitude = 1.0f; - wind_dependency = 0.5f; - wind_dir = XMFLOAT2(1, 1); - wind_speed = 100; + patch_length = 2000.0f; + time_scale = 0.8f; + wave_amplitude = 0.35f; + wind_dir = XMFLOAT2(0.8f, 0.6f); + wind_speed = 600.0f; + wind_dependency = 0.07f; + choppy_scale = 1.3f; } };