Hello
i need to convince something first. i do not creating a game in unreal engine. But in visual studio. That said
mine code do not work as it should. When i implemented light and with material. I get a problem with material. I do get null on the constanbuffer_material and i do not understand why.
are there something that i am missing or something i misplaces. Are there any more information that you want please not hesitate and tell me
bool material(ID3D11Device* device, ID3D11Buffer*& constentBuffer_matreal) {
ML MATREAL;
MATREAL.Diffuse[0] = 0.0f;
MATREAL.Diffuse[1] = 0.0f;
MATREAL.Diffuse[2] = 0.0f;
MATREAL.Diffuse[3] = 0.0f;
MATREAL.Ambient[0] = 0.0f;
MATREAL.Ambient[1] = 0.0f;
MATREAL.Ambient[2] = 0.0f;
MATREAL.Ambient[3] = 0.0f;
MATREAL.Specular[0] = 0.0f;
MATREAL.Specular[1] = 0.0f;
MATREAL.Specular[2] = 0.0f;
MATREAL.Specular[3] = 0.0f;
MATREAL.Emissive[0] = 0.0f;
MATREAL.Emissive[1] = 0.0f;
MATREAL.Emissive[2] = 0.0f;
MATREAL.Emissive[3] = 0.0f;
MATREAL.Power = 1.0f;
D3D11_BUFFER_DESC BufferDesc_matrix;
BufferDesc_matrix.ByteWidth = sizeof(ML);
BufferDesc_matrix.Usage = D3D11_USAGE_IMMUTABLE;
BufferDesc_matrix.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
BufferDesc_matrix.CPUAccessFlags = 0;
BufferDesc_matrix.MiscFlags = 0;
BufferDesc_matrix.StructureByteStride = 0;
D3D11_SUBRESOURCE_DATA data_1;
data_1.pSysMem = &MATREAL;
data_1.SysMemPitch = 0;
data_1.SysMemSlicePitch = 0;
HRESULT hr = device->CreateBuffer(&BufferDesc_matrix, &data_1, &constentBuffer_matreal);
return !FAILED(hr);
}