Pass material shininess to the renderer (#217)

This commit is contained in:
Anders Jenbo 2025-06-02 02:09:17 +02:00 committed by GitHub
parent de8a7c2d91
commit 5375336b5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -229,11 +229,18 @@ HRESULT Direct3DRMViewportImpl::CollectSceneData()
D3DRMRENDERQUALITY quality = mesh->GetGroupQuality(gi);
IDirect3DRMTexture* texture = nullptr;
mesh->GetGroupTexture(gi, &texture);
IDirect3DRMMaterial* material = nullptr;
mesh->GetGroupMaterial(gi, &material);
Uint32 texId = NO_TEXTURE_ID;
if (texture) {
texId = m_renderer->GetTextureId(texture);
texture->Release();
}
float shininess = 0.0f;
if (material) {
shininess = material->GetPower();
material->Release();
}
for (DWORD fi = 0; fi < faceCount; ++fi) {
D3DVECTOR norm;
@ -299,6 +306,7 @@ HRESULT Direct3DRMViewportImpl::CollectSceneData()
vtx.g = (color >> 8) & 0xFF;
vtx.b = (color >> 0) & 0xFF;
vtx.a = (color >> 24) & 0xFF;
vtx.shininess = shininess;
vtx.texId = texId;
vtx.u = dv.tu;
vtx.v = dv.tv;

View File

@ -12,6 +12,7 @@ typedef struct PositionColorVertex {
Uint8 r, g, b, a;
Uint32 texId = NO_TEXTURE_ID;
float u, v;
float shininess;
} PositionColorVertex;
struct FColor {