Skip to content

implement PNG brightmaps#1921

Draft
rfomin wants to merge 2 commits intofabiangreffrath:masterfrom
rfomin:brightmaps
Draft

implement PNG brightmaps#1921
rfomin wants to merge 2 commits intofabiangreffrath:masterfrom
rfomin:brightmaps

Conversation

@rfomin
Copy link
Copy Markdown
Collaborator

@rfomin rfomin commented Sep 23, 2024

So far, only the sprites are working.

Brightmaps for test: brightmaps.zip (taken from https://github.com/NightFright2k19/gzdoom_brightmaps). Just run woof -file brighmaps.zip

It seems GZDoom brightmaps are too subtle.

Comment thread src/r_things.c
else if (fixedcolormap)
vis->colormap[0] = vis->colormap[1] = fixedcolormap; // fixed map
else if (thing->frame & FF_FULLBRIGHT)
else if (thing->frame & FF_FULLBRIGHT && !brightmaps) // TODO
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've disabled FF_FULLBRIGHT for now, it looks like we need some kind of config file for brightmaps, like this: https://github.com/NightFright2k19/gzdoom_brightmaps/blob/master/bmplus_vanilla/brightmaps/sprites/doom2.bm

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FF_FULLBRIGHT is just a flag that we can remove or set at will, depending on the presence of a brightmap for the sprite. However, we should keep a copy if we want to allow in-game toggle. 🤔

So far, only the sprites are working.
Comment thread src/r_brightmaps.c

boolean brightmaps;

static patch_t *spr_brightmaps[NUMSPRITES][MAX_FRAMES][MAX_ROTATIONS];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's 261 pointers per sprite, even if no brightmaps are ever loaded. Should we turn this into dynamic allocation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this is temporary, for simplification. By the way, I'm not sure if the frames/rotations are working correctly.

Comment thread src/r_brightmaps.c Outdated
Comment thread src/v_fmt.c
// 0x37, 0x37, 0x37, 0x2F, 0x2F, 0x2F, 0x27, 0x27, 0x27, 0x23, 0x23, 0x23
};

static byte GetGrayscaleColor(int r, int g, int b)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I don't quite get this part. If we transform brightmap PNGs to grayscale, why do we need a lookup table for this?

Copy link
Copy Markdown
Collaborator Author

@rfomin rfomin Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We map brightmap colors to "light levels". The grayscale table corresponds to colormaps.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Maybe that's worth a comment here. 😉

@NightFright2k19
Copy link
Copy Markdown

Since I made (or, to some degree, collected) these brightmaps: If you guys need any help or adjustments for this from my side, feel free to poke me.

Also: If you think it sucks to have monsters with glowing eyes (which kinda gives them away in dark areas and therefore sort of affects gameplay), I may find new motivation to create an alternate version.

@rfomin
Copy link
Copy Markdown
Collaborator Author

rfomin commented Oct 9, 2024

Since I made (or, to some degree, collected) these brightmaps: If you guys need any help or adjustments for this from my side, feel free to poke me.

Thanks. We are currently planning to convert Woof's existing brightmaps to PNG format, as we know who made them and they are minimalist, so there won't be any copyright issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants