trace from actor center
This commit is contained in:
parent
b862adb747
commit
91fb87e95e
10 changed files with 52 additions and 10 deletions
|
|
@ -141,6 +141,7 @@ protected:
|
|||
uint8_t mWireframe : 2;
|
||||
uint8_t mShadeVertex : 1;
|
||||
uint8_t mLightNoNormals : 1;
|
||||
uint8_t mUseSpriteCenter : 1;
|
||||
|
||||
FVector4 mWireframeColor;
|
||||
FVector4 uObjectColor;
|
||||
|
|
@ -185,6 +186,7 @@ public:
|
|||
|
||||
void Reset()
|
||||
{
|
||||
mUseSpriteCenter = 0;
|
||||
mLightNoNormals = 0;
|
||||
mShadeVertex = 0;
|
||||
mWireframe = 0;
|
||||
|
|
@ -279,6 +281,11 @@ public:
|
|||
mLightNoNormals = value;
|
||||
}
|
||||
|
||||
void SetUseSpriteCenter(bool value)
|
||||
{
|
||||
mUseSpriteCenter = value;
|
||||
}
|
||||
|
||||
void SetWireframeColor(FVector4 color)
|
||||
{
|
||||
mWireframeColor = color;
|
||||
|
|
@ -294,6 +301,11 @@ public:
|
|||
mSurfaceUniforms.uVertexNormal = { x, y, z, 0.f };
|
||||
}
|
||||
|
||||
void SetActorCenter(float x, float y, float z)
|
||||
{
|
||||
mSurfaceUniforms.uActorCenter = { x, y, z };
|
||||
}
|
||||
|
||||
void SetColor(float r, float g, float b, float a = 1.f, int desat = 0)
|
||||
{
|
||||
mSurfaceUniforms.uVertexColor = { r, g, b, a };
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ struct SurfaceUniforms
|
|||
float uAlphaThreshold;
|
||||
int uTextureIndex;
|
||||
float uDepthFadeThreshold;
|
||||
float padding3;
|
||||
float padding1;
|
||||
FVector3 uActorCenter;
|
||||
float padding2;
|
||||
};
|
||||
|
||||
struct SurfaceLightUniforms
|
||||
|
|
|
|||
|
|
@ -423,6 +423,7 @@ void VkShaderManager::BuildDefinesBlock(FString &definesBlock, const char *defin
|
|||
|
||||
if (key.ShadeVertex) definesBlock << "#define SHADE_VERTEX\n";
|
||||
if (key.LightNoNormals) definesBlock << "#define LIGHT_NONORMALS\n";
|
||||
if (key.UseSpriteCenter) definesBlock << "#define USE_SPRITE_CENTER\n";
|
||||
|
||||
definesBlock << ((key.Simple2D) ? "#define uFogEnabled -3\n" : "#define uFogEnabled 0\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@ public:
|
|||
uint64_t ShadowmapFilter : 4; // SHADOWMAP_FILTER
|
||||
uint64_t ShadeVertex : 1; // SHADE_VERTEX
|
||||
uint64_t LightNoNormals : 1; // LIGHT_NONORMALS
|
||||
uint64_t Unused : 28;
|
||||
uint64_t UseSpriteCenter : 1; // USE_SPRITE_CENTER
|
||||
uint64_t Unused : 27;
|
||||
};
|
||||
uint64_t AsQWORD = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -331,6 +331,7 @@ void VkRenderState::ApplyRenderPass(int dt)
|
|||
|
||||
pipelineKey.ShaderKey.ShadeVertex = mShadeVertex;
|
||||
pipelineKey.ShaderKey.LightNoNormals = mLightNoNormals;
|
||||
pipelineKey.ShaderKey.UseSpriteCenter = mUseSpriteCenter;
|
||||
|
||||
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadows == 1;
|
||||
pipelineKey.ShaderKey.UseRaytrace = gl_light_shadows >= 2;
|
||||
|
|
@ -1082,6 +1083,8 @@ void VkRenderState::ApplyLevelMeshPipeline(VulkanCommandBuffer* cmdbuffer, VkPip
|
|||
}
|
||||
|
||||
pipelineKey.ShaderKey.ShadeVertex = mShadeVertex;
|
||||
pipelineKey.ShaderKey.LightNoNormals = mLightNoNormals;
|
||||
pipelineKey.ShaderKey.UseSpriteCenter = mUseSpriteCenter;
|
||||
|
||||
// Global state that don't require rebuilding the mesh
|
||||
pipelineKey.ShaderKey.NoFragmentShader = noFragmentShader;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue