Pitch + Angle Based Sprite Masking

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Pitch + Angle Based Sprite Masking

Re: Pitch + Angle Based Sprite Masking

by Edward-san » Sat Sep 24, 2016 3:04 pm

You don't, indeed.

Re: Pitch + Angle Based Sprite Masking

by Major Cooke » Sat Sep 24, 2016 3:01 pm

So I don't need to worry about it then?

Re: Pitch + Angle Based Sprite Masking

by Edward-san » Sat Sep 24, 2016 3:00 pm

Your buggy version of AActor::IsInsideVisibleAngles managed to trigger an llvm backend internal error when trying to compile release mode with clang, then it stopped with your latest fixes. :shrug:

Re: Pitch + Angle Based Sprite Masking

by Major Cooke » Sat Sep 24, 2016 9:38 am

Got it all fixed for ya. You actually don't need to do anything else, it appears.

Yeah I meant to say that first PR was just for seeing how I was doing, and I had run into a little snag. However, I figured out how to fix it all and I even tested it with Arookas' map.

Re: Pitch + Angle Based Sprite Masking

by Graf Zahl » Sat Sep 24, 2016 9:16 am

I'm sorry but that's still not correct. You have to be very careful here with portals. There is no guarantee that your calculations end up in the same portal group. I had a quick look and it seems that the needed info is currently not stored globally. I'll have to think about it a bit.

Re: [Needs Dev Reviewing]Pitch + Angle Based Sprite Masking

by Major Cooke » Sat Sep 24, 2016 8:54 am

Couple other bug fixes I'll need to put in too which were slightly overlooked. I'll host them in a new bug thread.

Re: Pitch + Angle Based Sprite Masking

by Graf Zahl » Sat Sep 24, 2016 1:45 am

So what's the reason for this:

Code: Select all

	player_t* pPlayer = players[consoleplayer].camera->player;

	if (pPlayer && pPlayer->mo)
You are essentially disabling the feature for non-player cameras entirely. You alre also not comparing the angle toward the actual camera but to the player actor attached to the camera, which is not necessarily the same. Why do you require

players[consoleplayer].camera->player->mo

and not just

players[consoleplayer].camera

?

Last but not least - this does not consider chasecam etc. Since this is a RENDERER feature you cannot do comparisons against PLAYSIM values, you have to use the renderer's ViewPos to determine where the camera is, not the camera actor's position.
Too bad I only noticed this after committing, it should be easy to fix, though.

Re: Pitch + Angle Based Sprite Masking

by Graf Zahl » Sat Sep 24, 2016 12:58 am

One note about the pull request: Unless you change the handler for some property you should not bump savegame versions anymore, i.e. only change it if you need to add some 'if (SaveVersion >/< xxx)' to implement it.

Re: Pitch + Angle Based Sprite Masking

by Graf Zahl » Sat Sep 24, 2016 12:02 am

No idea. As you may see I have been extremely busy the last week so I haven't taken a closer look at this code.

Re: Pitch + Angle Based Sprite Masking

by Major Cooke » Fri Sep 23, 2016 6:30 pm

Updated once again for the latest series of changes.

Is there anything else?

Re: Pitch + Angle Based Sprite Masking

by Major Cooke » Fri Sep 23, 2016 8:22 am

Done. New pull request issued due to merge conflict, so that's fixed as well.

Code: Select all

VisibleAngles 0, 90
VisiblePitch 0, -20
Anything else, or still waiting on more feedback?

Re: Pitch + Angle Based Sprite Masking

by Graf Zahl » Fri Sep 23, 2016 1:00 am

Agreed.

Re: Pitch + Angle Based Sprite Masking

by ZzZombo » Thu Sep 22, 2016 6:01 pm

Code: Select all

VisibleStartPitch 0
VisibleEndPitch -90
Something like "RenderPitchLimit 0,-90" instead of two separate properties make more sense and are more concise.

Re: Pitch + Angle Based Sprite Masking

by Major Cooke » Thu Sep 22, 2016 5:51 pm

Added GZDoom PR.

Re: [Needs Dev Reviewing]Pitch + Angle Based Sprite Masking

by Major Cooke » Thu Sep 22, 2016 12:47 pm

Graf Zahl wrote:Thanks. That's the kind of feedback I was asking for. To make it clear: I have no real problems with the feature as-is, but sometimes a second opinion is necessary before going on.
Ah, I see, you wanted opinion on the concept.
Gez wrote:On the other hand, there's no such feature for pitch and roll, so it's easier for me to understand the use case for pitch (I think the issue of a blood splat on the ground displayed with a flat sprite and viewed from below would still be a question of pitch, not angle, right?). And I suppose once you have this feature for pitch, then there's no reason not to have it for angle.
You are correct.

Code: Select all

VisibleStartPitch 0
VisibleEndPitch -90
And the sprite will be completely invisible on the underside.

I did not include roll because I don't think there's any such use for it at this time. I could try, but I'll make it a new PR for it after this is merged, if anyone can think of what it would be good for.
dpJudas wrote:I can see some logic in wanting to only show a sprite for certain angles where the graphics itself relies on an illusion that the sprite is more than it appears. The alternative solution suggested by Gez (use a 1x1 transparent image) seems a bit hacky, so if that's the only way of doing it today I think the patch makes sense. So I guess it comes down to whether there's a better way of doing this?
It would be nice to find a way for defining a sprite set to replace the images at certain pitch levels... but if that was done, then people might start asking for things like adjustable angle positions and it just might get into a snowball effect. Plus that doesn't exactly address if, say, the actor is capable of looking up at the target from below and it changes all around.

Yeah that'll get really sticky.

Top