View Single Post
Old 12th January 2007, 05:33   #5  |  Link
Liisachan
李姗倩 Lǐ Shān Qiàn
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,340
Thank you very much jfs! You guys are REALLY great. I'm not yet good enough to understand what you did in the patch, but it should be something amazing.

While this VSFilter is working very well, I have to report that even with this patch, VSFilter's result is not as good as the result by Textsub.vdf. Simply draw 2 yellow (0x00ffff) areas, without border without shadow. Textsub .vdf makes it 00ffff, but this VSFilter degrades it down to 0x00fefe. I suppose this is actually related to some intrinsic bugs in VSFilter, because not same but similar problems do exist in Textsub.vdf too.

(1) Simple- No border, No shadow.

Code:
Style: TestStyle,Verdana,80,&H0000ffff,&H0,&Hffffffff,&Hffffffff,-1,0,0,0,100,100,0,0.00,1,3,0,7,0,0,0,0

Dialogue: 51,0:00:00.00,0:00:05.00,TestStyle,,0000,0000,0000,,{\clip(m 0 0 l 130 0 90 80 0 80)}Test
Dialogue: 52,0:00:00.00,0:00:05.00,TestStyle,,0000,0000,0000,,{\clip(m 130 0 l 260 0 220 80 90 80)}Test
With .vdf, everything is ok. Face color is 00ffff as specified.


With the patched VSFilter, the face color is degraded to 00fefe


Maybe the eyes don't see any difference, as ffff and fefe are very close, but slight color difference can be a serious problem when doing something complicated. Anyway, this shows that .vdf and the patched VSFilter are different, and there's something wrong in the VSFilter.

(2) Enable the border, and the face is damaged (00fefe) even with the .vdf, and you'll see a diagonal line along the clipping border. This line shouldn't be there.
Code:
Style: TestStyle,Verdana,80,&H0000ffff,&H0,&H00000000,&Hffffffff,-1,0,0,0,100,100,0,0.00,1,3,0,7,0,0,0,0


*This problem exists both in the patched VSFilter and old .vdf. So I'm gessing everything is basically a bug by gabest.

(3) Quick and strange workaround: Set the secondary alpha = 0xff, we are not karaoke'ing at all, but this will fix the pb. Fushigi da ne.

Code:
Style: TestStyle,Verdana,80,&H0000ffff,&Hff000000,&H00000000,&Hffffffff,-1,0,0,0,100,100,0,0.00,1,3,0,7,0,0,0,0
This hack works 100% for .vdf.


For the patched VSFilter, the diagonal line is removed by this, but the face is still 00fefe.


(4) Now let's enable the shadow.
Code:
Style: TestStyle,Verdana,80,&H0000ffff,&Hff000000,&H00000000,&H80000000,-1,0,0,0,100,100,0,0.00,1,3,3,7,0,0,0,0
Again, the color was degraded to 00fefe, and we are seeing the annoying diagonal line.


* This problem happens both with the old .vdf and the patched vsfilter.

(5) So, how about drawing the normal line first, and then Clip1 and Clip2 on top of that?
Code:
Style: BaseStyle,Verdana,80,&H0000ffff,&Hff000000,&H00000000,&H80000000,-1,0,0,0,100,100,0,0.00,1,3,3,7,0,0,0,0
Style: TestStyle,Verdana,80,&H0000ffff,&Hff000000,&Hff000000,&Hff000000,-1,0,0,0,100,100,0,0.00,1,3,3,7,0,0,0,0

Dialogue: 10,0:00:00.00,0:00:05.00,BaseStyle,,0000,0000,0000,,Test

Dialogue: 51,0:00:00.00,0:00:05.00,TestStyle,,0000,0000,0000,,{\clip(m 0 0 l 130 0 90 80 0 80)}Test
Dialogue: 52,0:00:00.00,0:00:05.00,TestStyle,,0000,0000,0000,,{\clip(m 130 0 l 260 0 220 80 90 80)}Test


This seems to be working well, but the face color is degraded to 00fefe, not 00ffff. This problem exists in the both too.

EDIT
In order for the method (5) to work, BaseStyle must have the same face color with the pixel by the diagonal line (in this case yellow). For instance, if you have yellow and blue by the diagonal line, like the following picture, the BaseStyle must be yellow or blue.

Otherwise, the diagonal line will be dirty like this.

This means, if you want to use 3 or more colors, (5) doesn't work. For instance, if you have yellow, pink, blue, and you use yellow for the Base, the yellow-pink border will be OK, but pink-blue border will be not clear. Like this.


If you need to use 3 or more colors this way, the following code (-1 px for the 1st and 7th params) may produce a better result. (this method is usable for 2 colors too)
Code:
Dialogue: 1000000,0:00:00.00,0:00:05.00,TestStyle,,0000,0000,0000,,{\clip(m -1 0 l 80 0 0 80 -81 80)}Test
Dialogue: 1000010,0:00:00.00,0:00:05.00,TestStyle1,,0000,0000,0000,,{\clip(m 79 0 l 160 0 80 80 -1 80)}Test
Dialogue: 1000020,0:00:00.00,0:00:05.00,TestStyle2,,0000,0000,0000,,{\clip(m 159 0 l 240 0 160 80 79 80)}Test
Result:


As you can see, if you use -1 px, borders are "antialiased"

Last edited by Liisachan; 12th January 2007 at 11:22.
Liisachan is offline   Reply With Quote