Minor fixes
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current materials shader version.
|
/// Current materials shader version.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
#define MATERIAL_GRAPH_VERSION 163
|
#define MATERIAL_GRAPH_VERSION 164
|
||||||
|
|
||||||
class Material;
|
class Material;
|
||||||
class GPUShader;
|
class GPUShader;
|
||||||
|
|||||||
@@ -59,12 +59,6 @@ struct RenderLightData
|
|||||||
float ShadowsUpdateRate;
|
float ShadowsUpdateRate;
|
||||||
float ShadowsUpdateRateAtDistance;
|
float ShadowsUpdateRateAtDistance;
|
||||||
|
|
||||||
RenderLightData()
|
|
||||||
{
|
|
||||||
Platform::MemoryClear(this, sizeof(RenderLightData));
|
|
||||||
}
|
|
||||||
|
|
||||||
POD_COPYABLE(RenderLightData);
|
|
||||||
bool CanRenderShadow(const RenderView& view) const;
|
bool CanRenderShadow(const RenderView& view) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -80,9 +74,12 @@ struct RenderDirectionalLightData : RenderLightData
|
|||||||
|
|
||||||
RenderDirectionalLightData()
|
RenderDirectionalLightData()
|
||||||
{
|
{
|
||||||
|
Platform::MemoryClear(this, sizeof(RenderDirectionalLightData));
|
||||||
IsDirectionalLight = 1;
|
IsDirectionalLight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POD_COPYABLE(RenderDirectionalLightData);
|
||||||
|
|
||||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -107,9 +104,12 @@ struct RenderSpotLightData : RenderLocalLightData
|
|||||||
|
|
||||||
RenderSpotLightData()
|
RenderSpotLightData()
|
||||||
{
|
{
|
||||||
|
Platform::MemoryClear(this, sizeof(RenderSpotLightData));
|
||||||
IsSpotLight = 1;
|
IsSpotLight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POD_COPYABLE(RenderSpotLightData);
|
||||||
|
|
||||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -120,9 +120,12 @@ struct RenderPointLightData : RenderLocalLightData
|
|||||||
|
|
||||||
RenderPointLightData()
|
RenderPointLightData()
|
||||||
{
|
{
|
||||||
|
Platform::MemoryClear(this, sizeof(RenderPointLightData));
|
||||||
IsPointLight = 1;
|
IsPointLight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POD_COPYABLE(RenderPointLightData);
|
||||||
|
|
||||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -135,9 +138,12 @@ struct RenderSkyLightData : RenderLightData
|
|||||||
|
|
||||||
RenderSkyLightData()
|
RenderSkyLightData()
|
||||||
{
|
{
|
||||||
|
Platform::MemoryClear(this, sizeof(RenderSkyLightData));
|
||||||
IsSkyLight = 1;
|
IsSkyLight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POD_COPYABLE(RenderSkyLightData);
|
||||||
|
|
||||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ void MaterialGenerator::ProcessGroupTextures(Box* box, Node* node, Value& value)
|
|||||||
|
|
||||||
// Write operations
|
// Write operations
|
||||||
auto framesCount = writeLocal(VariantType::Float, String::Format(TEXT("{0}.x * {1}.y"), framesXY.Value, framesXY.Value), node);
|
auto framesCount = writeLocal(VariantType::Float, String::Format(TEXT("{0}.x * {1}.y"), framesXY.Value, framesXY.Value), node);
|
||||||
frame = writeLocal(VariantType::Float, String::Format(TEXT("fmod({0}, {1})"), frame.Value, framesCount.Value), node);
|
frame = writeLocal(VariantType::Float, String::Format(TEXT("fmod(floor({0}), {1})"), frame.Value, framesCount.Value), node);
|
||||||
auto framesXYInv = writeOperation2(node, Value::One.AsFloat2(), framesXY, '/');
|
auto framesXYInv = writeOperation2(node, Value::One.AsFloat2(), framesXY, '/');
|
||||||
auto frameY = writeLocal(VariantType::Float, String::Format(TEXT("abs({0} * {1}.y - (floor({2} * {3}.x) + {0} * 1))"), invertY.Value, framesXY.Value, frame.Value, framesXYInv.Value), node);
|
auto frameY = writeLocal(VariantType::Float, String::Format(TEXT("abs({0} * {1}.y - (floor({2} * {3}.x) + {0} * 1))"), invertY.Value, framesXY.Value, frame.Value, framesXYInv.Value), node);
|
||||||
auto frameX = writeLocal(VariantType::Float, String::Format(TEXT("abs({0} * {1}.x - (({2} - {1}.x * floor({2} * {3}.x)) + {0} * 1))"), invertX.Value, framesXY.Value, frame.Value, framesXYInv.Value), node);
|
auto frameX = writeLocal(VariantType::Float, String::Format(TEXT("abs({0} * {1}.x - (({2} - {1}.x * floor({2} * {3}.x)) + {0} * 1))"), invertX.Value, framesXY.Value, frame.Value, framesXYInv.Value), node);
|
||||||
|
|||||||
Reference in New Issue
Block a user