[5/5] wined3d: change colorkey fixup for stage 0 alphaop / alphaarg

Alexander Dorofeyev alexd4 at inbox.lv
Wed Jan 2 23:20:26 CST 2008


Stefan Dösinger wrote:
> Am Mittwoch, 2. Januar 2008 12:44:24 schrieb Stefan Dösinger:
>> Am Mittwoch, 2. Januar 2008 13:38:57 schrieb Alexander Dorofeyev:
>>> In case of colorkey emulation for a texture, if the application wants to
>>> select alpha from diffuse color at stage 0, a fixup to modulate with
>>> texture alpha more closely matches what the application wants than fixup
>>> to just select alpha from texture.
> I tested pop3d and Moto Racer 2. Pop3d still works as expected, but moto racer 
> 2 has some missing geometry. It draws some opaque parts of the scene with 
> color keying on, and a diffuse alpha of 0.0, so the alpha test kicks in and 
> the geometry is missing.
Oh now I see this case I haven't thought about. For some reason, or maybe no
reason at all, Moto racer sets alphaop to selectarg1 and alphaarg1 to current
(diffuse)! That looks kind of strange (if it then gives vertices with diffuse
alpha = 0), but maybe it's just "optimizing" by setting states it will need
later. And it expects it to work despite diffuse alpha is 0 because it disables
alpha blending and alpha test. In wine though the latter state is overriden by
colorkey emulation so the result is bad. But I think this can be sorted out by
checking ALPHABLENDENABLE, because it's probably a reasonable indicator for
telling whether the app is going to give something meaningful in diffuse alpha
or not. Do you think something along the lines of attached patch can be an
acceptable solution? With it, AVP1 game works properly and it also seems to
bring back geometry in moto racer, at least as far as I can tell.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: colorkey_fixup2.diff.txt
Url: http://www.winehq.org/pipermail/wine-devel/attachments/20080102/92394f5d/attachment.txt 


More information about the wine-devel mailing list