Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

WritePixelArray VS Warp3d textures ?
« on: March 05, 2005, 06:33:48 AM »
Hi 2 all. I want to draw part of my picture as texture.  But i want to do it as 1:1, without any intropalation/etc.I tryed to disable all warp3d states (dithering,gouraud,etc), but in any case i do not have 1:1 color scheme. Here is a 2 screenshoots.

1. It is original picture, and WritePixelArray do it good (but too slow of course).

2. It is the same picture, but draw as texture (fast, but ugly).


Well, i want to draw this pict as texture, but in original format (as WritePixelArray). It is possible i hope ? If yes, plz, explain me what states i must be enable/disable.


Thanks all for advance answers.
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #1 on: March 07, 2005, 01:23:12 PM »
Yes, here is voodoo3 3000.. So, only way is creating 16bit picts and using W3D_A4R4G4B4 in W3D_AllocTexObj fucntion ?
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #2 on: March 08, 2005, 08:10:53 AM »
to Karlos
i tryed use W3D_HINT, and played with all params, but here is no any good result. Maybe do you know some software for convert 32bit pict to 16bit for A4R4G4B4 ?
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #3 on: March 08, 2005, 10:48:38 AM »
well, how i can exactly do it ?:) i trying to found any mode for 4bit per pixel, but only 8bite minimum is here. And if i saved any pict as tiff, png, etc, in any case i have 8bit per pixel.
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #4 on: March 08, 2005, 02:59:34 PM »
Alpha channel need it for me.. Actually, my problem is it:
i want to do alpha fade/out with 24bit picture. If i can't
to do it directly on voodoo3, maybe here is way like:

1. creating 'black screen as textures'
2. draw picture by WritePixelArray.
3. draw black screen with alpha 0, and change alpha in loop
   to 1. and we have alpha fade out.

but what about alpha fade in ? i mean it must be like this:

user run programm, and watch black screen. And 24bit picture fade in. Some delay, and picture fade out.

any idea ?:)
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #5 on: March 08, 2005, 04:09:34 PM »
"Let's assume you can get a nice RGB565 format texture made in an art package"

what name of art package which can allow to me create R5G6B5 picts ?


btw, if i will using OS function (WritePixelArray) to draw pict on screen, i will see as slow draw my pict. So, for fade-out is ok, but not for fade-in ..
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #6 on: November 08, 2005, 10:25:41 PM »
Hi all agayn :) I try to write some stuff with bvision and voodoo3 support, and have some problems with it .. On bvision i _CAN'T_ do
Code: [Select]

W3D_SetBlendMode(context, W3D_SRC_ALPHA, W3D_DST_ALPHA);

I check all W3D_QUEREs and ENV_BLEND for bvision do not work, as MIPMAPPING. But mipmapping is not problem, but ENV_BLEND it is big problem ..

Under voodoo3 it works fine. So..I do not have bvision for tests, and do not know where is a problem and how i can do it the same as on voodoo3 .. So, i must write here and talk about it with peoples, and try to write virtual stuff :)


Btw, maybe here is any way for emulate by warp3d library unsupported blend_modes states ? I mean use hardware drivers, use all states which can be doit by hardware driver, and for unsupported states use software driver ?



 
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #7 on: November 08, 2005, 11:37:07 PM »
Thanks Karlos, will try to rewrite all with W3D_SRC_ALPHA, W3D_ONE_MINUS_SRC_ALPHA.
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #8 on: November 09, 2005, 03:52:30 AM »
@Karlos
I am already rewrite my little code with only 2 poor scenes with W3D_SRC_ALPHA, W3D_ONE_MINUS_SRC_ALPHA, for first scene (fade in/out of picture) it just work as for my voodoo3 settings, so 2 minuts of change, for second scene i was little tired with photoshop, but in end i create normal bitmap with no colors in background and can use one_minus_src_alpha. Also i remove mipmapping seetings . Well, will try to test it today/tommorow, hope no more new differens :)
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #9 on: November 09, 2005, 05:33:01 PM »
hi karlos.

tests give to me strange result :) i handled all return values of all w3d funcs (except drawtriangles and lock/unlock hardware), and .. all is good. All states setup correctly, textures loading is good too. But! I have only this:

15 bit = black screen, music (but here is 2 scene)
16/24 = black color of my textures!

Well .. maybe bvision do not support A8R8G8B8 texture modes ?
Or work bad with auto_tex mapping ? Or must be set mipmapping
option to 0xffff (but bvision can't mipmapping as i know).
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #10 on: November 09, 2005, 06:24:19 PM »
Hm .. i little fear about 'black polygon'. I hope black screen it is only black screen, and alpha will work with it too ? And yes, i use W3D_SetTexEnv(context, tex, W3D_MODULATE, NULL)..
So, my steps is it:

1. I fill screen with black color by ClearDrawRegion.
2. I set MODULATE and BLEND(with mode).
3. Try to draw pict .. and .. it's sad but i think bvision think that black color of screen it is black texture and just can't blend with it ? but why ?

Anyway, i send code to you, check it plz, maybe you can found somethink here .. Thanks.

edit: hm, it works on voodoo3 without MODULATE too. Maybe W3D_DECAL best way ? or just unused W3D_SetTexEnv .. (it is not very need it for me anyway, and i think mostly stuff can be done without it).

edit2: btw, if i disable GOURAUD state, i have on voodoo3 the same as for bvision (but with gouraud and modulate) - black color of textures.

edit3: i remove MODULATE from code, and test on bvision agayn. BLACK COLOR AGAYN :))
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #11 on: November 26, 2005, 10:13:34 AM »
Ok, Karlos already help me with this problems. Problems is little buggy permedia2 driver (?). But, anyway, i want to up old question about dithering on voodoo3.

So (Rogue,EntilZha do you here?), voodoo3 chip can only 16bit targets/textures. But, it is possible to use Dithering. So, fitst question:

What ditherting method is used in warp3d 4.2 drivers ?
Average dithering ? Floyd-Steinberg dithering ? ordered dithering or random dithering ?  or somethink other ?

Second question:

What do it warp3d voodoo3 driver with 32bit data to convert it to 16bit ? Just drop older 4 bits or what ?

And third, and also very interesting question:

Why, if i enable W3D_Dithering state in my programm, nothink happened, and image draw with the same ugly color artefacts as with no enabled W3d_dithering state ? Fuction just do not work or i must setup somethink more ?

Thanks all for answers.
 

Offline kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #12 on: 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 kas1eTopic starter

Re: WritePixelArray VS Warp3d textures ?
« Reply #13 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 #14 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 ?