View Issue Details

IDProjectCategoryView StatusLast Update
0001889FSSCPgraphicspublic2010-12-20 07:46
ReporterEchelon9 Assigned ToEchelon9  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.9 
Fixed in Version3.6.13 
Summary0001889: HUD target box doesn't render lighting correctly
DescriptionThe HUD target box in the lower left corner of the screen displays a miniature model of the currently targeted object.

FS2Open does not render lighting on this model, while the rest of the engine does.

Furthermore, a key command (default Shift-Alt-Q) lets you change between 'standard', 'wireframe only' and 'wireframe with textures' rendering in the HUD target box.

In code/hud/hudtargetbox.cpp
----------------------------

    //0==standard
    //1==wireframe only
    //2==wireframe with textures
    Targetbox_wire++;
        if (Targetbox_wire==3)
            Targetbox_wire=0;

----------------------------

This does not work correctly, and I have real doubts as to what "wireframe with textures" would actually look like.
TagsNo tags attached.

Activities

2009-02-25 13:40

 

hudtarget-method_mantis-1889.patch (3,028 bytes)   
Index: code/hud/hudtargetbox.cpp
===================================================================
--- code/hud/hudtargetbox.cpp	(revision 5068)
+++ code/hud/hudtargetbox.cpp	(working copy)
@@ -743,7 +743,7 @@
 {
 	//0==standard
 	//1==wireframe only
-	//2==wireframe with textures
+	//2==standard without lighting
 	Targetbox_wire++;
 		if (Targetbox_wire==3)
 			Targetbox_wire=0;
@@ -1123,7 +1123,10 @@
 				flags |=MR_NO_POLYS;
 		}
 
-		model_render(Asteroid_info[asteroidp->asteroid_type].model_num[pof], &target_objp->orient, &obj_pos, flags |MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_NO_FOGGING );
+		if (Cmdline_nohtl || Targetbox_wire==2)
+			flags |=MR_NO_LIGHTING;
+		
+		model_render(Asteroid_info[asteroidp->asteroid_type].model_num[pof], &target_objp->orient, &obj_pos, flags | MR_LOCK_DETAIL | MR_NO_FOGGING );
 		hud_render_target_close();
 	}
 
@@ -1598,12 +1601,15 @@
 		if (target_sip->hud_target_lod >= 0) {
 			model_set_detail_level(target_sip->hud_target_lod);
 		}
+		
+		if (Cmdline_nohtl || Targetbox_wire==2)
+			flags |=MR_NO_LIGHTING;
 
 		// maybe render a special hud-target-only model
 		if(target_sip->model_num_hud >= 0){
-			model_render( target_sip->model_num_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING);
+			model_render( target_sip->model_num_hud, &target_objp->orient, &obj_pos, flags | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING);
 		} else {
-			model_render( target_sip->model_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING, -1, -1, target_shipp->ship_replacement_textures);
+			model_render( target_sip->model_num, &target_objp->orient, &obj_pos, flags | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING, -1, -1, target_shipp->ship_replacement_textures);
 		}
 		ship_model_stop( target_objp );
 
@@ -1692,9 +1698,12 @@
 		}
 		hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
 		model_clear_instance(debrisp->model_num);
+		
+		if (Cmdline_nohtl || Targetbox_wire==2)
+			flags |=MR_NO_LIGHTING;
 
 		// This calls the colour that doesnt get reset
-		submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_NO_FOGGING );
+		submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_LOCK_DETAIL | MR_NO_FOGGING );
 		hud_render_target_close();
 	}
 
@@ -1804,8 +1813,11 @@
 		if (hud_target_lod >= 0) {
 			model_set_detail_level(hud_target_lod);
 		}
+		
+		if (Cmdline_nohtl || Targetbox_wire==2)
+			flags |=MR_NO_LIGHTING;
 
-		model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_IS_MISSILE | MR_NO_FOGGING, -1, -1, replacement_textures);
+		model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_IS_MISSILE | MR_NO_FOGGING, -1, -1, replacement_textures);
 		hud_render_target_close();
 	}
 

Echelon9

2009-02-25 13:40

developer   ~0010689

Suggested patch has been attached.

taylor

2009-02-25 14:12

administrator   ~0010690

It was never supposed to use lighting in the targetbox, so that's not a bug. :) I think it has been brought up in the forums before and is always dismissed as a design decision or something, I can't remember exactly.

The wireframe with textures thing is something that I worked on at one point but never could get it working properly with HTL mode. It is basically just outline mode. However, since line drawing HTL models is insanely slow, and the feature is only available as a (non-default) option for the targetbox and in FRED, I quickly gave up on trying to get it working since it just wasn't worth the effort.

Woolie Wool

2009-02-25 15:56

reporter   ~0010691

Target box miniatures are likely fullbright so the player can see the entire form of the targeted ship in the box instead of just the parts that are lit.

Echelon9

2009-03-20 03:28

developer   ~0010753

I'll be leaving this dormant until 3.6.10 is out. I still think it's a good improvement (while not affecting the option to use the current approach), but as a feature it will have to wait until after the code freeze is lifted.

KeldorKatarn

2010-01-28 18:19

reporter   ~0011594

Last edited: 2010-01-28 18:20

This is working as designed. A fully lit version could be added as a 4th option in the target box mode. The standard is also used because fully lit means a lot of render time.

"wireframe with textures" currently doesn't work.

Echelon9

2010-12-20 07:46

developer   ~0012566

Resolved / feature in r6870.

The third unused hud target box rendering style has been enable to provide a standard render with proper lighting.

Issue History

Date Modified Username Field Change
2009-02-25 13:39 Echelon9 New Issue
2009-02-25 13:40 Echelon9 File Added: hudtarget-method_mantis-1889.patch
2009-02-25 13:40 Echelon9 Status new => assigned
2009-02-25 13:40 Echelon9 Assigned To => Echelon9
2009-02-25 13:40 Echelon9 Note Added: 0010689
2009-02-25 14:12 taylor Note Added: 0010690
2009-02-25 15:56 Woolie Wool Note Added: 0010691
2009-03-20 03:28 Echelon9 Note Added: 0010753
2009-03-20 03:29 Echelon9 Resolution open => suspended
2009-06-04 14:13 Echelon9 Status assigned => feedback
2010-01-27 05:10 Echelon9 Severity tweak => feature
2010-01-28 18:19 KeldorKatarn Note Added: 0011594
2010-01-28 18:20 KeldorKatarn Note Edited: 0011594
2010-12-20 07:46 Echelon9 Note Added: 0012566
2010-12-20 07:46 Echelon9 Status feedback => resolved
2010-12-20 07:46 Echelon9 Fixed in Version => 3.6.13
2010-12-20 07:46 Echelon9 Resolution suspended => fixed