fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

add skybox alpha, and add scripted functions for alpha and orientation

Open Goober5000 opened this issue 11 months ago • 1 comments

This allows the skybox orientation and alpha to be accessed and changed through Lua virtvars, and also adds a sexp to change the alpha.

Unfortunately, changing the alpha has no perceptible effect on the skybox. This will need the attention of a graphics coder to figure out what might need updating.

Goober5000 avatar Mar 22 '24 17:03 Goober5000

It looks like the line to set the alpha might have worked before Swifty's upgrades, but not since then. This is from c620372357afd79ac988b60112d40b99d7efed32:

@@ -2153,20 +2155,17 @@ void stars_draw_background()
        if (Nmodel_num < 0)
                return;

+       model_render_params render_info;
+
        if (Nmodel_bitmap >= 0) {
-               model_set_forced_texture(Nmodel_bitmap);
-               Nmodel_flags |= MR_FORCE_TEXTURE;
+               render_info.set_forced_bitmap(Nmodel_bitmap);
        }

        // draw the model at the player's eye with no z-buffering
-       model_set_alpha(1.0f);
+       render_info.set_alpha(1.0f);
+       render_info.set_flags(Nmodel_flags | MR_SKYBOX);

-       model_render(Nmodel_num, &Nmodel_orient, &Eye_position, Nmodel_flags, -1, -1, NULL, true);
-
-       if (Nmodel_bitmap >= 0) {
-               model_set_forced_texture(-1);
-               Nmodel_flags &= ~MR_FORCE_TEXTURE;
-       }
+       model_render_immediate(&render_info, Nmodel_num, &Nmodel_orient, &Eye_position, MODEL_RENDER_ALL);
 }

 // call this to set a specific model as the background model

Goober5000 avatar Mar 22 '24 17:03 Goober5000