Welcome, Guest. Please login or register.

Author Topic: WritePixelArray VS Warp3d textures ?  (Read 5009 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #29 from previous page: February 11, 2006, 06:08:54 PM »
Ok, time to up warp3d talks ;) Thanks to karlos for lot of help, but i have new question: have warp3d4.2 somethink like 'color-key' in old directx ? I mean i want do somethink like this: i draw texture, but all color which i setup by somethink warp3d fuction just do not draw. For example i have black background with sprite. And want draw all, except black color.
it is possible by w3d 4.2 ?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: WritePixelArray VS Warp3d textures ?
« Reply #30 on: February 11, 2006, 09:28:32 PM »
Quote

kas1e wrote:
Ok, time to up warp3d talks ;) Thanks to karlos for lot of help, but i have new question: have warp3d4.2 somethink like 'color-key' in old directx ? I mean i want do somethink like this: i draw texture, but all color which i setup by somethink warp3d fuction just do not draw. For example i have black background with sprite. And want draw all, except black color.
it is possible by w3d 4.2 ?


See the docs / W3D_SetChromaTestBounds(W3D_Context* context, W3D_Texture* texture, ULONG lower, ULONG upper, ULONG mode)

This function allows you to set a range of colours (both defined as 32-bit ARGB values). If you set the lower range as 0x00010101 and the upper limit as 0xFFFFFFFF and the mode to W3D_CHROMATEST_INCLUSIVE, then any texel that isn't black will be rendered.

Of course, unless you are doing something complex already with alpha, the simplest thing to do would be to use the alpha channel of the texture to dictate which parts of your sprite are opaque.
int p; // A
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #31 on: February 12, 2006, 08:50:41 AM »
thanks ! i ask about color keys becouse i want to draw some text as textures, and want to use rgb565 mode, so no alpha.

edit: chromatest is works :)
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #32 on: February 24, 2006, 07:31:21 PM »
but agayn chip war, or i am just stoopid man :) So, in docs about cromatest said:

res = W3D_SetChromaTestBounds(context, texture, lower, upper, mode)
      lower   - lower bound. This is a 32 bit RGBA value.
      upper   - upper bound. This is a 32 bit RGBA value.
 mode    - chroma test mode
               The following values are possible:
               W3D_CHROMATEST_NONE         disable chroma testing
               W3D_CHROMATEST_INCLUSIVE    texels within the specified range pass
                                           the test (i.e. get drawn)
               W3D_CHROMATEST_EXCLUSIVE    only texels outside the specified range are drawn, others are rejected.

So, as i understand if i want _DO NOT DRAW_ black color, i must be just use :

W3D_SetChromaTestBounds(context, texture, 01010100, ffffffff, W3D_CHROMATEST_INCLUSIVE).

Before of course i must SetState of W3D_ChromaTest to enabled.

And i do it! And it's strange, but, for me on my a1200 with voodoo3 it works. for a1 with voodoo3 it works too. But for a1 with radeon, and for pegasos with voodoo3/radeon, i always have black color :) why ? maybe i missunderstude somethink ?
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #33 on: February 26, 2006, 11:32:02 AM »
Time to reply to myself.

So, if someone in interest, Color Keys feature works only on voodoo3 on classic and a1. Also color keys works on classic with bvision (and maybe cvision)

And do not works on:

totally not works on MOS. (it said man from mos dev. team, and i test it myself)
totally not works on WinUae wrapper (quarktex) (it sais author, and i test it myself)
totally not works on a1 with radeon cards (it sais Rogue, and i test it myself agayn)

So, if someone will do code over warp3d - do not use color keys never, if you want to do full compatibility stuff :)