Minor fixes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Current materials shader version.
|
||||
/// </summary>
|
||||
#define MATERIAL_GRAPH_VERSION 163
|
||||
#define MATERIAL_GRAPH_VERSION 164
|
||||
|
||||
class Material;
|
||||
class GPUShader;
|
||||
|
||||
@@ -59,12 +59,6 @@ struct RenderLightData
|
||||
float ShadowsUpdateRate;
|
||||
float ShadowsUpdateRateAtDistance;
|
||||
|
||||
RenderLightData()
|
||||
{
|
||||
Platform::MemoryClear(this, sizeof(RenderLightData));
|
||||
}
|
||||
|
||||
POD_COPYABLE(RenderLightData);
|
||||
bool CanRenderShadow(const RenderView& view) const;
|
||||
};
|
||||
|
||||
@@ -80,9 +74,12 @@ struct RenderDirectionalLightData : RenderLightData
|
||||
|
||||
RenderDirectionalLightData()
|
||||
{
|
||||
Platform::MemoryClear(this, sizeof(RenderDirectionalLightData));
|
||||
IsDirectionalLight = 1;
|
||||
}
|
||||
|
||||
POD_COPYABLE(RenderDirectionalLightData);
|
||||
|
||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||
};
|
||||
|
||||
@@ -107,9 +104,12 @@ struct RenderSpotLightData : RenderLocalLightData
|
||||
|
||||
RenderSpotLightData()
|
||||
{
|
||||
Platform::MemoryClear(this, sizeof(RenderSpotLightData));
|
||||
IsSpotLight = 1;
|
||||
}
|
||||
|
||||
POD_COPYABLE(RenderSpotLightData);
|
||||
|
||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||
};
|
||||
|
||||
@@ -120,9 +120,12 @@ struct RenderPointLightData : RenderLocalLightData
|
||||
|
||||
RenderPointLightData()
|
||||
{
|
||||
Platform::MemoryClear(this, sizeof(RenderPointLightData));
|
||||
IsPointLight = 1;
|
||||
}
|
||||
|
||||
POD_COPYABLE(RenderPointLightData);
|
||||
|
||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||
};
|
||||
|
||||
@@ -135,9 +138,12 @@ struct RenderSkyLightData : RenderLightData
|
||||
|
||||
RenderSkyLightData()
|
||||
{
|
||||
Platform::MemoryClear(this, sizeof(RenderSkyLightData));
|
||||
IsSkyLight = 1;
|
||||
}
|
||||
|
||||
POD_COPYABLE(RenderSkyLightData);
|
||||
|
||||
void SetShaderData(ShaderLightData& data, bool useShadow) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -653,7 +653,7 @@ void MaterialGenerator::ProcessGroupTextures(Box* box, Node* node, Value& value)
|
||||
|
||||
// Write operations
|
||||
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 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);
|
||||
|
||||
Reference in New Issue
Block a user