TintScreen inconsistency between DX5 and D3D modes

Started by Pumaman, Sun 26/07/2009 17:31:54

Previous topic - Next topic

Pumaman

So, I've had a problem reported whereby the results of TintScreen are different in DX5 and D3D modes.

In DX5 mode (and this is the way AGS has always done it), it applies a 50%-transparent "film" over the screen, tinted to the specified colour.

In D3D mode it re-colourises the entire screen to the colour you specify.

This means that the results look different, significantly so in many cases.

So, my question is -- how many people actually use TintScreen? And which of these results is the "correct" look that you're trying to accomplish?

Dualnames

I recall from the manual that you say that Tint might malfunction. In fact, it shows weird on a scrolling room, therefore I did a workaround with a red GUI, as if I said i had such a
problem it would be suggested to me. However I feel Tint is a really unstable and slow command. At least it was on 3.1.2 SP 1 version.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Mr Flibble

I made a quick comparison image to illustrate the difference as an aid to the discussion. Tinted at 50 red, 50 green and 100 blue.



D3D on the left and DX5 on the right.

Personally I always considered the DX5 version to be the "correct" behaviour for the command... but that's why I never used it. The D3D one looks much better to me.  I noticed a slight lag when opening the game with D3D but I don't know how that affects actual performance.
Ah! There is no emoticon for what I'm feeling!

Privateer Puddin'

Quote from: Mr Flibble on Sun 26/07/2009 18:56:42
Personally I always considered the DX5 version to be the "correct" behaviour for the command... but that's why I never used it. The D3D one looks much better to me.

Ditto.

Misj'

Quote from: Pumaman on Sun 26/07/2009 17:31:54So, my question is -- how many people actually use TintScreen? And which of these results is the "correct" look that you're trying to accomplish?

Quote from: Mr Flibble on Sun 26/07/2009 18:56:42Personally I always considered the DX5 version to be the "correct" behaviour for the command... but that's why I never used it. The D3D one looks much better to me. 

While I never used it, the D3D method is the one that I would have expected as a user (and also consider as being the correct interpretation)...while the DX5 approach would hardly ever be an effect I would thrive for. When I thint my images in a graphics program, the left image in Mr Fibble's post would be my goal.

Pumaman

Yeah, I'd agree that D3D is more what you'd expect.

I think the problem here is performance, and trying to accomplish that in software mode with DX5 slowed the game to such a ridiculous extent that the "transparent film" effect was implemented instead as something that at least ran at a half-decent speed.

Therefore I'm not really sure what the best way forward is. If indeed the D3D effect is just too slow to manage in software mode, then I suppose the alternative is changing D3D so that it looks like DX5 -- it might be a rubbish effect but at least it would be consistent. Anyone got any further thoughts?

Mr Flibble

I think consistency would be preferable even if it does look a bit naff, particularly if people start being a bit clever with their filters and tints and so on, having it display differently could ruin their effect.

But having said that the DX5 effect looks so poor I can't imagine ever wanting to use it. I'd say trying to emulate the D3D effect in DX5 would be the ideal course of action.
Ah! There is no emoticon for what I'm feeling!

GarageGothic

Could the DX5 tinting possibly be implemented differently to speed things up - I assume currently the tint is applied to the full screen every game loop? For instance storing the background as a DynamicSprite and only applying the tint to it whenever TintScreen is called, and having the tint value work as a modifier to the Character.Tint, Object.Tint and ambient tint rendering? Of course this would create some problems with animated backgrounds (since you would need up to 5 full-screen temporary sprites) or when developers use DrawingSurface routines to draw to the background.

Pumaman

Well, I tried changing TintScreen in DX5 so that it looks like D3D mode, but it slowed the game down to 12 FPS on my machine, which is unacceptably slow.

GarageGothic, yes it would probably be possible to improve this given enough time and effort, but it would probably be quite an involved process; and I'm not sure whether it's worth it for a feature like this.

However, I don't really want to leave the current behaviour as-is, because it leads to quite radically different results depending on which graphics driver is in use. Hmm.

Shane 'ProgZmax' Stevens

I'm curious:  why are you still using DirectX v 5?  I ask because I've programmed with Directx 7.1 extensively (I go back to it for strictly 2d rendering) and you've simply got to see some performance gains if you updated the renderer.  If you're keeping dx 5 purely for backwards compatibility I understand, but I'm sure 90% of people today or more with pc's have dx 8 or above.  I also agree that the D3D method 'looks' better, primarily because it doesn't appear like a transparent layer highlighting everything. 

You could take the complicated approach to it and tweak the tint manually so it doesn't affect RGB(0,0,0) for a start.  That would more or less resolve the black areas of the image but would still leave users with the highlighted blue look on the rest of the image.  After that it would be a matter of mixing the remaining colors a bit differently so their values overall are lower (darker).  I'm sure you know this already and are looking for more elegant solutions, though.

Mr Flibble

Sorry to drag this up but I had an idea.

How about a command which only tints the characters and objects? Since that's such a small area it shouldn't be as computer crunchingly intensive as tinting the whole screen in D3D-style.

I thought of this because I was considering implementing a room with strobing lights and whilst it wouldn't be too much bother to manually tint the background and change the frame, the idea of tinting all of my characters animations and changing the views every few seconds seemed like avoidable work. (Although this IS how I intend to do it, this suggestion notwithstanding.)
Ah! There is no emoticon for what I'm feeling!

GarageGothic

You mean like SetAmbientTint(int red, int green, int blue, int saturation, int luminance)?

Mr Flibble

Haha, I'm not wholly read up on my screen functions as you can see. What kind of effect does that give though? Tintscreen D3D or DX5? But yeah that's exactly what I was suggesting  :)
Ah! There is no emoticon for what I'm feeling!

GarageGothic


subspark

To be honest I don't know one single soal working with Direct X 5 today. I agree with ProgZMax's suggestion that perhaps its time that the old meets the new.
Effects are an important part of many games and just like in film, a day for night filter MUST live up to its name. The DX5 method does not.

Cheers,
Sparky.

Dusk

Quote from: Pumaman on Mon 27/07/2009 18:00:01

Therefore I'm not really sure what the best way forward is. If indeed the D3D effect is just too slow to manage in software mode, then I suppose the alternative is changing D3D so that it looks like DX5 -- it might be a rubbish effect but at least it would be consistent. Anyone got any further thoughts?


I agree, consistency comes first.
And I'm saying this also because I used TintScreen (DX5) for some effects and hope they won't be broken :D

Maybe you could add an optional parameter that enables the current D3D behaviour, adding a warning in the manual "hey, it might slow down the game a lot in DX5 mode".

subspark

That sounds user-friendlier :)

Supporting both methods would keep both sides of the community happy. Now why didn't I think of that.

Cheers,
Sparky.

Pumaman

Ok, 3.2 RC 1 includes an update to change the D3D driver so that its TintScreen should look the same as what DX5 has always done.

subspark


SMF spam blocked by CleanTalk