mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-19 05:41:17 +00: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);
|
D3DRMRENDERQUALITY quality = mesh->GetGroupQuality(gi);
|
||||||
IDirect3DRMTexture* texture = nullptr;
|
IDirect3DRMTexture* texture = nullptr;
|
||||||
mesh->GetGroupTexture(gi, &texture);
|
mesh->GetGroupTexture(gi, &texture);
|
||||||
|
IDirect3DRMMaterial* material = nullptr;
|
||||||
|
mesh->GetGroupMaterial(gi, &material);
|
||||||
Uint32 texId = NO_TEXTURE_ID;
|
Uint32 texId = NO_TEXTURE_ID;
|
||||||
if (texture) {
|
if (texture) {
|
||||||
texId = m_renderer->GetTextureId(texture);
|
texId = m_renderer->GetTextureId(texture);
|
||||||
texture->Release();
|
texture->Release();
|
||||||
}
|
}
|
||||||
|
float shininess = 0.0f;
|
||||||
|
if (material) {
|
||||||
|
shininess = material->GetPower();
|
||||||
|
material->Release();
|
||||||
|
}
|
||||||
|
|
||||||
for (DWORD fi = 0; fi < faceCount; ++fi) {
|
for (DWORD fi = 0; fi < faceCount; ++fi) {
|
||||||
D3DVECTOR norm;
|
D3DVECTOR norm;
|
||||||
@ -299,6 +306,7 @@ HRESULT Direct3DRMViewportImpl::CollectSceneData()
|
|||||||
vtx.g = (color >> 8) & 0xFF;
|
vtx.g = (color >> 8) & 0xFF;
|
||||||
vtx.b = (color >> 0) & 0xFF;
|
vtx.b = (color >> 0) & 0xFF;
|
||||||
vtx.a = (color >> 24) & 0xFF;
|
vtx.a = (color >> 24) & 0xFF;
|
||||||
|
vtx.shininess = shininess;
|
||||||
vtx.texId = texId;
|
vtx.texId = texId;
|
||||||
vtx.u = dv.tu;
|
vtx.u = dv.tu;
|
||||||
vtx.v = dv.tv;
|
vtx.v = dv.tv;
|
||||||
|
|||||||
@ -12,6 +12,7 @@ typedef struct PositionColorVertex {
|
|||||||
Uint8 r, g, b, a;
|
Uint8 r, g, b, a;
|
||||||
Uint32 texId = NO_TEXTURE_ID;
|
Uint32 texId = NO_TEXTURE_ID;
|
||||||
float u, v;
|
float u, v;
|
||||||
|
float shininess;
|
||||||
} PositionColorVertex;
|
} PositionColorVertex;
|
||||||
|
|
||||||
struct FColor {
|
struct FColor {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user