Results 1 to 6 of 6

Thread: Hardware Transparent blit problem - UnDelphiX

  1. #1

    Hardware Transparent blit problem - UnDelphiX

    Hi all, first off a little background. Its a DJ software in delphi 2007 and UnDelphiX 1.0.8, also utilising Bass.

    This is an UnDelphiX query; I have a little problem I would appreciate some assistance with.

    I link to two images.

    http://www.everlastinggaze.co.uk/softspin.bmp


    The first one is a bitmap in a DXG file, with a transparency of (255,0,0) Red, clearly rendering cleanly. Do3D is set to false, so its all done in software, and the blit with red as transparent works great. Unfortunately I only get 40fps, and this is not acceptable as I want to provide both options, accelerated and not accelerated (for those with noisy GPU fans).


    http://www.everlastinggaze.co.uk/hardspin.bmp


    The second image has Do3D set to true, uses acceleration, and achieves 300 to 400 fps which is great. It has the great benefit of smoothing the image with anti-aliasing as well. But the process has clearly gone wrong.

    Both solutions use the original DelphiX DrawRotate.

    The acceleration chain appears to be anti-aliasing the image BEFORE it has performed transparency. In short, transparency is being ignored by the acceleration, and this is creating intermediary reds which are then blitted to the screen.

    Ideally I want it transparent, and anti-aliased; This could be quite complciated depending on the solution. It means poking the transparency into the 3d card's chain upstream of the alias somehow.

    Alternatively can anyone help me disable anti-aliasing which should also solve the problem...?

    I have considered using the new TDib functions but I think this would be far slower than the Do3D option off, although it would allow me to antialias the result, all in software. I have decided against this course of action.

    Any help would be great!


    Quick Update:

    I have managed to disable the 3d texture filter which fixes the transparency issue on the most part (unfortunately I now have no hardware filtering.) I now have pixels that shouldnt be there which are being generated by the hardware rotate/clip process, see image here:

    http://www.everlastinggaze.co.uk/hardspinnofilt.bmp

    this results in little black pixels popping up all over, and at 90 degree positions, a black line. Is this to do with the clipping algorithm?



    This is now offciailly driving me insane.

    I have hacked the source about a million ways; Added DX7 flags everywhere to try and fix it.

    I can't see whats wrong, its the same clipping algorithm in software and hardware mode, it works perfectly in software only mode.

    Can anyone tell me if they have ahd a asimiliar problem with DX7 + textures before?


    cheers

    Jon


  2. #2

    Re: Hardware Transparent blit problem - UnDelphiX

    I don't know how to help but maybe the guy who maintains unDelphiX can help?

    http://www.micrel.cz/Dx/

    email: unDelphiX@micrel.cz
    Wake up from the dream and live your life to the full

  3. #3

    Re: Hardware Transparent blit problem - UnDelphiX

    Thanks Wizard, I have emailed the guy (I cant find the fellow's name anywhere though!!)

    In case anyone is wondering I have checked and both issues are still present on my other computer, which has Vista on it, and a totally different graphics card.

    On the plus side, I just found out my code works just fine on Vista!!!

    not 100% sure why the frame rate is 70fps compared to 300fps though =D

  4. #4

    Re: Hardware Transparent blit problem - UnDelphiX

    Foundthe problem by and large- I changed the red background to black and the problem was completely solved with the filtering disabled.

    Enabling the filtering works _almost_ perfectly but left a ragged edge for some strange reason. Decided to stick with unfiltered rotation which looks very clean.

    I am so pleased.....

    And the moral of the story is - always use colour RGB 0,0,0 for yor translucency. Suits me ok, but perhaps would cause issus on most other games for example?

  5. #5

    Re: Hardware Transparent blit problem - UnDelphiX

    Glad you got it

    not 100% sure why the frame rate is 70fps compared to 300fps though =D
    See this thread about FPS in Vista with unDelphiX:

    http://www.pascalgamedevelopment.com...p?topic=5472.0
    Wake up from the dream and live your life to the full

  6. #6

    Re: Hardware Transparent blit problem - UnDelphiX

    Quote Originally Posted by Pensive
    And the moral of the story is - always use colour RGB 0,0,0 for yor translucency. Suits me ok, but perhaps would cause issus on most other games for example?
    No, black transparency is the best and there are no imaginable issues. If there is deep black in the original image they only should be recolored to rgb 3,3,3 or something, eye will not notice it and is very quickly done with mspaint using scissors tool.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •