Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot recolor sprites using legacy API on OpenJK client. #910

Closed
DaloLorn opened this issue Feb 22, 2017 · 3 comments
Closed

Cannot recolor sprites using legacy API on OpenJK client. #910

DaloLorn opened this issue Feb 22, 2017 · 3 comments

Comments

@DaloLorn
Copy link

Operating system: Windows 10 Home 64-bit, latest version.

Client type: Multiplayer, but might occur in singleplayer.

Description:

Using the trap_R_SetColor function on 2D sprites (tested with mAutomapPlayerIcon and radarShader) prior to drawing them with trap_R_DrawPic or trap_R_DrawRotatePic2 will fail to change the sprite's color. I'm not experienced enough to track down the core issue, but I'm told that the same function works just fine on procedurally generated icons. (Citation: MB2's block/bodyhit indicators work fine, and those are apparently procedurally generated.)

Initially, I believed it to be an issue with how MB2's code interacted with the OJK client, because I had only witnessed it in MB2 - but last night it occurred to me to test it with base files. Allied players in vanilla JKA should be tinted green (citation: tested on JAMP moments after testing on MB2 and OJK clients). They are as orange as the player himself.

Steps:

  1. Run OJK multiplayer client. (Or MB2 client - they're virtually identical anyway.) Use a mod built with the legacy API - I've tested with "MBII" and "base".

  2. Start a multiplayer game with more than one player. Bots or dual logging may or may not be required.

  3. Get sense 3. (This is perhaps a moot point, as I was unable to sense hostile bots and didn't seem to need sense to see allies.)

  4. When another player/bot appears on the minimap, they will be the same color as you.

What was supposed to happen: When another player/bot appears on the minimap, they should be red or green depending on their team.

@ensiform
Copy link
Member

Pictures?

What is the rgbgen set for the shaders mentioned from MB2?

@DaloLorn
Copy link
Author

http://imgur.com/a/kF1XK - MB2 OJK client. (There is also a secondary issue in that screenshot, with a missing background picture. I've figured that one out and corrected it.)

https://gitlab.com/MBIIDevTeam/moviebattles/uploads/71544cf6650e0550619efafa2410998c/shot0001.jpg - MB2 JAMP client. (Not sure if you have access to that, though... I may have to reupload it.)

The difference is clear - allies are supposed to be green, they're white. (Base JKA acts the same way, except it's orange because the untinted image there is orange.)

I'll put up the base comparisons later today.

@DaloLorn
Copy link
Author

DaloLorn commented Feb 23, 2017

Shader from JKA - as far as I know, the only modification MB2 makes is to the image itself.

File: base/assets1.pk3/shaders/mp.shader

gfx/menus/radar/arrow_w
{
	nopicmip
	notc
	q3map_nolightmap
    {
        map gfx/menus/radar/arrow_w
        blendFunc GL_ONE GL_ONE
        rgbGen identity
    }
}

eternalcodes pushed a commit to eternalcodes/EternalJK that referenced this issue Aug 21, 2018
This bug was unintentionally introduced during the fixing of RB_RotatePic similar to the bug previously introduced with rocket lock wedges. The arrow for players on the radar contain `rgbGen identity` which does not work with setting 2d color (trap->SetColor) but due to how the code previously worked, it rendered correctly.

Fixes JACoders#910
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

No branches or pull requests

2 participants