I'm currently having an issue when I'm memcpying the data from a derived class. The result is way off. In the screenshot you can see the data when it's uploaded to the GPU.
class Light
{
private:
virtual void Fill() = 0;
public:
int id = -1;
Vector3 color;
float strenght = 1;
Light() = default;
};
class PointLight : public Light
{
private:
virtual void Fill() override {};
public:
PointLight()
:Light() {};
Vector4 position;
};
Won't the PointLight class and its data match this struct on the GPU in the HLSL shader?
struct PointLight
{
int id;
float3 color;
float strenght;
float4 position;
};