Browse Source

enable/disable specular highlights appropriately

David Rose 20 years ago
parent
commit
23ea377b13
1 changed files with 7 additions and 1 deletions
  1. 7 1
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

+ 7 - 1
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

@@ -2183,13 +2183,19 @@ do_issue_material() {
     }
     }
   }
   }
 
 
-  _d3d_device->SetMaterial(&cur_material);
+  if (material->has_specular()) {
+    _d3d_device->SetRenderState(D3DRS_SPECULARENABLE, TRUE);
+  } else {
+    _d3d_device->SetRenderState(D3DRS_SPECULARENABLE, FALSE);
+  }
 
 
   if (material->get_local()) {
   if (material->get_local()) {
     _d3d_device->SetRenderState(D3DRS_LOCALVIEWER, TRUE);
     _d3d_device->SetRenderState(D3DRS_LOCALVIEWER, TRUE);
   } else {
   } else {
     _d3d_device->SetRenderState(D3DRS_LOCALVIEWER, FALSE);
     _d3d_device->SetRenderState(D3DRS_LOCALVIEWER, FALSE);
   }
   }
+
+  _d3d_device->SetMaterial(&cur_material);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////