mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-24 04:26:55 -04:00
Pass material shininess to the renderer (#217)
This commit is contained in:
parent
de8a7c2d91
commit
5375336b5a
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user