general updates

This commit is contained in:
turanszkij
2018-02-06 17:11:11 +00:00
parent ce268b93d8
commit fad539605c
10 changed files with 35 additions and 10 deletions
-3
View File
@@ -134,8 +134,5 @@ struct ShaderEntityType
#define GENERATEMIPCHAIN_2D_BLOCK_SIZE 16
#define GENERATEMIPCHAIN_3D_BLOCK_SIZE 8
// Skinning compute params:
#define SKINNING_COMPUTE_THREADCOUNT 128
#endif
+10
View File
@@ -0,0 +1,10 @@
#ifndef _SHADERINTEROP_SKINNING_H_
#define _SHADERINTEROP_SKINNING_H_
#include "ShaderInterop.h"
// Skinning compute params:
#define SKINNING_COMPUTE_THREADCOUNT 128
#endif // _SHADERINTEROP_SKINNING_H_
@@ -240,6 +240,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_EmittedParticle.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_FFTGenerator.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_Ocean.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_Skinning.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)TiledDeferredRenderableComponent.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)TiledForwardRenderableComponent.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)TiledForwardRenderableComponent_BindLua.h" />
@@ -1143,6 +1143,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)wiOBJLoader.h">
<Filter>ENGINE\Helpers</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_Skinning.h">
<Filter>ENGINE\Graphics\GPUMapping</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)LUA\lapi.c">
+1 -1
View File
@@ -1,5 +1,5 @@
#include "ResourceMapping.h"
#include "ShaderInterop.h"
#include "ShaderInterop_Skinning.h"
// This will make use of LDS to preload bones into local memory:
// #define USE_LDS
+1 -1
View File
@@ -967,7 +967,7 @@ struct WorldInfo{
ambient = XMFLOAT3(0.2f, 0.2f, 0.2f);
fogSEH = XMFLOAT3(100, 1000, 0);
water = XMFLOAT4(0, 0, 0, 0);
cloudiness = 0.53f;
cloudiness = 0.0f;
cloudScale = 0.0003f;
cloudSpeed = 0.1f;
}
+12 -3
View File
@@ -27,6 +27,7 @@
#include "wiProfiler.h"
#include "wiOcean.h"
#include "ShaderInterop_CloudGenerator.h"
#include "ShaderInterop_Skinning.h"
#include <algorithm>
@@ -62,6 +63,7 @@ bool wiRenderer::TRANSPARENTSHADOWSENABLED = true;
bool wiRenderer::wireRender = false, wiRenderer::debugSpheres = false, wiRenderer::debugBoneLines = false, wiRenderer::debugPartitionTree = false, wiRenderer::debugEmitters = false, wiRenderer::freezeCullingCamera = false
, wiRenderer::debugEnvProbes = false, wiRenderer::debugForceFields = false, wiRenderer::gridHelper = false, wiRenderer::voxelHelper = false, wiRenderer::requestReflectionRendering = false, wiRenderer::advancedLightCulling = true
, wiRenderer::advancedRefractions = false;
bool wiRenderer::ldsSkinningEnabled = true;
float wiRenderer::SPECULARAA = 0.0f;
float wiRenderer::renderTime = 0, wiRenderer::renderTime_Prev = 0, wiRenderer::deltaTime = 0;
XMFLOAT2 wiRenderer::temporalAAJitter = XMFLOAT2(0, 0), wiRenderer::temporalAAJitterPrev = XMFLOAT2(0, 0);
@@ -3374,7 +3376,7 @@ void wiRenderer::UpdateRenderData(GRAPHICSTHREAD threadID)
CSTYPES targetCS = CSTYPE_SKINNING_LDS;
if (armature->boneCollection.size() > SKINNING_COMPUTE_THREADCOUNT)
if (!GetLDSSkinningEnabled() || armature->boneCollection.size() > SKINNING_COMPUTE_THREADCOUNT)
{
// If we have more bones that can fit into LDS, we switch to a skinning shader which loads from device memory:
targetCS = CSTYPE_SKINNING;
@@ -3453,7 +3455,7 @@ void wiRenderer::UpdateRenderData(GRAPHICSTHREAD threadID)
}
// Generate cloud layer:
if(enviroMap == nullptr) // generate only when sky is dynamic
if(enviroMap == nullptr && GetScene().worldInfo.cloudiness > 0) // generate only when sky is dynamic
{
if (textures[TEXTYPE_2D_CLOUDS] == nullptr)
{
@@ -5386,7 +5388,14 @@ void wiRenderer::DrawSky(GRAPHICSTHREAD threadID)
else
{
GetDevice()->BindGraphicsPSO(PSO_sky[SKYRENDERING_DYNAMIC], threadID);
GetDevice()->BindResource(PS, textures[TEXTYPE_2D_CLOUDS], TEXSLOT_ONDEMAND0, threadID);
if (GetScene().worldInfo.cloudiness > 0)
{
GetDevice()->BindResource(PS, textures[TEXTYPE_2D_CLOUDS], TEXSLOT_ONDEMAND0, threadID);
}
else
{
GetDevice()->BindResource(PS, wiTextureHelper::getInstance()->getBlack(), TEXSLOT_ONDEMAND0, threadID);
}
}
GetDevice()->Draw(240, 0, threadID);
+3
View File
@@ -248,6 +248,7 @@ protected:
static bool wireRender, debugSpheres, debugBoneLines, debugPartitionTree, debugEnvProbes, debugEmitters, debugForceFields, gridHelper, voxelHelper, advancedLightCulling, advancedRefractions;
static bool ldsSkinningEnabled;
static bool requestReflectionRendering;
@@ -352,6 +353,8 @@ public:
static bool GetAdvancedLightCulling() { return advancedLightCulling; }
static void SetOcclusionCullingEnabled(bool enabled); // also inits query pool!
static bool GetOcclusionCullingEnabled() { return occlusionCulling; }
static void SetLDSSkinningEnabled(bool enabled) { ldsSkinningEnabled = enabled; }
static bool GetLDSSkinningEnabled() { return ldsSkinningEnabled; }
static void SetTemporalAAEnabled(bool enabled) { temporalAA = enabled; }
static bool GetTemporalAAEnabled() { return temporalAA; }
static void SetTemporalAADebugEnabled(bool enabled) { temporalAADEBUG = enabled; }
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 15;
// minor bug fixes, alterations, refactors, updates
const int revision = 1;
const int revision = 2;
long GetVersion()
+3 -1
View File
@@ -405,7 +405,7 @@ void wiLabel::Render(wiGUI* gui)
scissorRect.right = (LONG)(translation.x + scale.x);
scissorRect.top = (LONG)(translation.y);
wiRenderer::GetDevice()->SetScissorRects(1, &scissorRect, gui->GetGraphicsThread());
wiFont(text, wiFontProps((int)translation.x, (int)translation.y, -1, WIFALIGN_LEFT, WIFALIGN_TOP, 2, 1,
wiFont(text, wiFontProps((int)translation.x + 2, (int)translation.y + 2, -1, WIFALIGN_LEFT, WIFALIGN_TOP, 2, 1,
textColor, textShadowColor)).Draw(gui->GetGraphicsThread());
}
@@ -1037,6 +1037,8 @@ void wiComboBox::Update(wiGUI* gui, float dt )
if (hovered >= 0)
{
SetSelected(hovered);
gui->DeactivateWidget(this);
combostate = COMBOSTATE_INACTIVE;
}
}
}