浏览代码

fix clip planes, color-scale-via-lighting

David Rose 20 年之前
父节点
当前提交
b1ed45ecb3
共有 2 个文件被更改,包括 2 次插入16 次删除
  1. 2 15
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx
  2. 0 1
      panda/src/dxgsg8/dxGraphicsStateGuardian8.h

+ 2 - 15
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

@@ -4661,7 +4661,7 @@ do_issue_material() {
     // Otherwise, the ambient color comes from the object color.
     // Otherwise, the ambient color comes from the object color.
     if (_has_material_force_color) {
     if (_has_material_force_color) {
       cur_material.Ambient = *(D3DCOLORVALUE *)_material_force_color.get_data();
       cur_material.Ambient = *(D3DCOLORVALUE *)_material_force_color.get_data();
-      _pD3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_MATERIAL);
+      _pD3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_MATERIAL);
     } else {
     } else {
       _pD3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_COLOR1);
       _pD3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_COLOR1);
     }
     }
@@ -4782,6 +4782,7 @@ enable_clip_plane(int plane_id, bool enable) {
   } else {
   } else {
     _clip_plane_bits &= ~((DWORD)1 << plane_id);
     _clip_plane_bits &= ~((DWORD)1 << plane_id);
   }
   }
+  _pD3DDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, _clip_plane_bits);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -4812,20 +4813,6 @@ bind_clip_plane(const NodePath &plane, int plane_id) {
   }
   }
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian8::end_bind_clip_planes
-//       Access: Protected, Virtual
-//  Description: Called after before bind_clip_plane() has been called one
-//               or more times (but before any geometry is issued or
-//               additional state is changed), this is intended to
-//               clean up any temporary changes to the state that may
-//               have been made by begin_bind_clip_planes().
-////////////////////////////////////////////////////////////////////
-void DXGraphicsStateGuardian8::
-end_bind_clip_planes() {
-  _pD3DDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, _clip_plane_bits);
-}
-
 void DXGraphicsStateGuardian8::
 void DXGraphicsStateGuardian8::
 issue_color_write(const ColorWriteAttrib *attrib) {
 issue_color_write(const ColorWriteAttrib *attrib) {
   _color_write_mode = attrib->get_mode();
   _color_write_mode = attrib->get_mode();

+ 0 - 1
panda/src/dxgsg8/dxGraphicsStateGuardian8.h

@@ -177,7 +177,6 @@ protected:
   virtual bool slot_new_clip_plane(int plane_id);
   virtual bool slot_new_clip_plane(int plane_id);
   virtual void enable_clip_plane(int plane_id, bool enable);
   virtual void enable_clip_plane(int plane_id, bool enable);
   virtual void bind_clip_plane(const NodePath &plane, int plane_id);
   virtual void bind_clip_plane(const NodePath &plane, int plane_id);
-  virtual void end_bind_clip_planes();
 
 
   virtual void set_blend_mode();
   virtual void set_blend_mode();