Skip to content

Commit

Permalink
Model Renderer|Definitions: Weapon opacity and fullbright mode
Browse files Browse the repository at this point in the history
Added model definition variables "opacityFromWeapon" and "fullbrightFromWeapon" that work with psprites to modify the model appearance.

IssueID #2343
  • Loading branch information
skyjake committed Nov 5, 2019
1 parent 7fa136f commit 55b487d
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 125 deletions.
2 changes: 2 additions & 0 deletions doomsday/apps/client/include/render/model.h
Expand Up @@ -62,6 +62,8 @@ struct Model : public de::ModelDrawable
enum Flag
{
AutoscaleToThingHeight = 0x1,
ThingOpacityAsAmbientLightAlpha = 0x2,
ThingFullBrightAsAmbientLight = 0x4,
DefaultFlags = AutoscaleToThingHeight
};
Q_DECLARE_FLAGS(Flags, Flag)
Expand Down
59 changes: 27 additions & 32 deletions doomsday/apps/client/include/render/vissprite.h
Expand Up @@ -98,6 +98,7 @@ struct VisEntityLighting
{
de::Vector4f ambientColor;
de::duint vLightListIdx = 0;
bool isFullBright = false;

VisEntityLighting() = default;

Expand Down Expand Up @@ -160,45 +161,39 @@ enum vispspritetype_t
/// @ingroup render
struct vispsprite_t
{
vispspritetype_t type;
ddpsprite_t *psp;
de::Vector3d origin;
world::BspLeaf const *bspLeaf;
VisEntityLighting light;
vispspritetype_t type;
ddpsprite_t * psp;
de::Vector3d origin;
const world::BspLeaf *bspLeaf;
VisEntityLighting light;
float alpha; // overall opacity

union vispsprite_data_u {
struct vispsprite_sprite_s {
de::dfloat alpha;
dd_bool isFullBright;
} sprite;
struct vispsprite_model_s {
coord_t topZ; ///< global top for silhouette clipping
de::dint flags; ///< for color translation and shadow draw
de::duint id;
de::dint selector;
de::dint pClass; ///< player class (used in translation)
coord_t floorClip;
dd_bool stateFullBright;
dd_bool viewAligned; ///< @c true= Align to view plane.
coord_t secFloor;
coord_t secCeil;
de::dfloat alpha;
de::ddouble visOff[3]; ///< Last-minute offset to coords.
dd_bool floorAdjust; ///< Allow moving sprite to match visible floor.

FrameModelDef *mf;
FrameModelDef *nextMF;
de::dfloat yaw;
de::dfloat pitch;
de::dfloat pitchAngleOffset;
de::dfloat yawAngleOffset;
de::dfloat inter; ///< Frame interpolation, 0..1
coord_t topZ; ///< global top for silhouette clipping
int flags; ///< for color translation and shadow draw
unsigned int id;
int selector;
int pClass; ///< player class (used in translation)
coord_t floorClip;
bool viewAligned; ///< @c true= Align to view plane.
coord_t secFloor;
coord_t secCeil;
double visOff[3]; ///< Last-minute offset to coords.
bool floorAdjust; ///< Allow moving sprite to match visible floor.
float yaw;
float pitch;
float pitchAngleOffset;
float yawAngleOffset;
float inter; ///< Frame interpolation, 0..1
} model;
struct vispsprite_model2_s {
render::Model const *model;
render::StateAnimator const *animator;
de::dfloat pitchAngleOffset;
de::dfloat yawAngleOffset;
const render::Model *model;
const render::StateAnimator *animator;
float pitchAngleOffset;
float yawAngleOffset;
} model2;
} data;
};
Expand Down

0 comments on commit 55b487d

Please sign in to comment.