mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix DirectX lighting some more
This commit is contained in:
parent
7d8cbc7a10
commit
856a53bd5c
@ -4060,14 +4060,19 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
|
|||||||
alight.dvRange = D3DLIGHT_RANGE_MAX;
|
alight.dvRange = D3DLIGHT_RANGE_MAX;
|
||||||
alight.dvFalloff = 1.0f;
|
alight.dvFalloff = 1.0f;
|
||||||
alight.dvTheta = 0.0f;
|
alight.dvTheta = 0.0f;
|
||||||
alight.dvPhi = lens->get_hfov();
|
alight.dvPhi = deg_2_rad(lens->get_hfov());
|
||||||
|
|
||||||
const LVecBase3f &att = light_obj->get_attenuation();
|
const LVecBase3f &att = light_obj->get_attenuation();
|
||||||
alight.dvAttenuation0 = (D3DVALUE)att[0];
|
alight.dvAttenuation0 = (D3DVALUE)att[0];
|
||||||
alight.dvAttenuation1 = (D3DVALUE)att[1];
|
alight.dvAttenuation1 = (D3DVALUE)att[1];
|
||||||
alight.dvAttenuation2 = (D3DVALUE)att[2];
|
alight.dvAttenuation2 = (D3DVALUE)att[2];
|
||||||
|
|
||||||
HRESULT res = _pScrn->pD3DDevice->SetLight(light_id, &alight);
|
HRESULT hr = _pScrn->pD3DDevice->SetLight(light_id, &alight);
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
wdxdisplay7_cat.warning()
|
||||||
|
<< "Could not set light properties for " << light
|
||||||
|
<< " to id " << light_id << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -4328,7 +4328,7 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
|
|||||||
alight.Range = __D3DLIGHT_RANGE_MAX;
|
alight.Range = __D3DLIGHT_RANGE_MAX;
|
||||||
alight.Falloff = 1.0f;
|
alight.Falloff = 1.0f;
|
||||||
alight.Theta = 0.0f;
|
alight.Theta = 0.0f;
|
||||||
alight.Phi = lens->get_hfov();
|
alight.Phi = deg_2_rad(lens->get_hfov());
|
||||||
|
|
||||||
const LVecBase3f &att = light_obj->get_attenuation();
|
const LVecBase3f &att = light_obj->get_attenuation();
|
||||||
alight.Attenuation0 = att[0];
|
alight.Attenuation0 = att[0];
|
||||||
@ -4667,7 +4667,7 @@ do_auto_rescale_normal() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool DXGraphicsStateGuardian8::
|
bool DXGraphicsStateGuardian8::
|
||||||
slot_new_light(int light_id) {
|
slot_new_light(int light_id) {
|
||||||
return (light_id < _max_lights);
|
return ((unsigned int)light_id < _max_lights);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -4734,7 +4734,7 @@ enable_light(int light_id, bool enable) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool DXGraphicsStateGuardian8::
|
bool DXGraphicsStateGuardian8::
|
||||||
slot_new_clip_plane(int plane_id) {
|
slot_new_clip_plane(int plane_id) {
|
||||||
return (plane_id < _max_clip_planes);
|
return ((unsigned int)plane_id < _max_clip_planes);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -307,8 +307,8 @@ protected:
|
|||||||
D3DBLEND _blend_source_func;
|
D3DBLEND _blend_source_func;
|
||||||
D3DBLEND _blend_dest_func;
|
D3DBLEND _blend_dest_func;
|
||||||
|
|
||||||
int _max_lights;
|
unsigned int _max_lights;
|
||||||
int _max_clip_planes;
|
unsigned int _max_clip_planes;
|
||||||
|
|
||||||
bool _line_smooth_enabled;
|
bool _line_smooth_enabled;
|
||||||
bool _color_material_enabled;
|
bool _color_material_enabled;
|
||||||
|
@ -3500,7 +3500,7 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
|
|||||||
alight.Range = __D3DLIGHT_RANGE_MAX;
|
alight.Range = __D3DLIGHT_RANGE_MAX;
|
||||||
alight.Falloff = 1.0f;
|
alight.Falloff = 1.0f;
|
||||||
alight.Theta = 0.0f;
|
alight.Theta = 0.0f;
|
||||||
alight.Phi = lens->get_hfov();
|
alight.Phi = deg_2_rad(lens->get_hfov());
|
||||||
|
|
||||||
const LVecBase3f &att = light_obj->get_attenuation();
|
const LVecBase3f &att = light_obj->get_attenuation();
|
||||||
alight.Attenuation0 = att[0];
|
alight.Attenuation0 = att[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user