TransparentSpriteColor problem in Sprite3D on Riva TNT2
TransparentSpriteColor problem in Sprite3D on Riva TNT2
I selected different colors of a transparency,
but all of them are drawn together with sprite.
However in 16 bit a mode all OK.
Tested on pb3.94 and pb3.90
In 2D sprite all OK in all mode.
I think it serious BUG.: (
but all of them are drawn together with sprite.
However in 16 bit a mode all OK.
Tested on pb3.94 and pb3.90
In 2D sprite all OK in all mode.
I think it serious BUG.: (
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Is the sprite size a multiple of 2? eg 32*32, etc?
Last edited by netmaestro on Tue Feb 21, 2006 7:04 pm, edited 2 times in total.
BERESHEIT
I checked on two different computers with different drivers.Fred wrote:Probably a driver issue then.
In any case even if business in Driver.
I shall make game and at someone with driver the problem will be same. It is bad.: (
I wish to notice that has put in PureBasic, so-as I started much casual (shareware) games (2d with 3d sprites), there all ok.
p.s. It is an old problem, I am simple again with it have collided on computer sister (with riva tnt2).
@newart
A few GFXCards don't support colorkeying for 3D-Sprites. With this code you can test if your Hardware supports it:
[Edit]
NOTE: The test was wrong
[/Edit]
regrads
Stefan
A few GFXCards don't support colorkeying for 3D-Sprites. With this code you can test if your Hardware supports it:
Code: Select all
Structure D3DPrimCaps
dwSize.l
dwMiscCaps.l
dwRasterCaps.l
dwZCmpCaps.l
dwSrcBlendCaps.l
dwDestBlendCaps.l
dwAlphaCmpCaps.l
dwShadeCaps.l
dwTextureCaps.l
dwTextureFilterCaps.l
dwTextureBlendCaps.l
dwTextureAddressCaps.l
dwStippleWidth.l
dwStippleHeight.l
EndStructure
Structure D3DDeviceDesc7
dwDevCaps.l
dpcLineCaps.D3DPrimCaps
dpcTriCaps.D3DPrimCaps
dwDeviceRenderBitDepth.l
dwDeviceZBufferBitDepth.l
dwMinTextureWidth.l
dwMinTextureHeight.l
dwMaxTextureWidth.l
dwMaxTextureHeight.l
dwMaxTextureRepeat.l
dwMaxTextureAspectRatio.l
dwMaxAnisotropy.l
dvGuardBandLeft.f
dvGuardBandTop.f
dvGuardBandRight.f
dvGuardBandBottom.f
dvExtentsAdjust.f
dwStencilCaps.l
dwFVFCaps.l
dwTextureOpCaps.l
wMaxTextureBlendStages.w
wMaxSimultaneousTextures.w
dwMaxActiveLights.l
dvMaxVertexW.f
GUIDdeviceGUID.guid
wMaxUserClipPlanes.w
wMaxVertexBlendMatrices.w
dwVertexProcessingCaps.l
dwReserved1.l
dwReserved2.l
dwReserved3.l
dwReserved4.l
EndStructure
#D3DDEVCAPS_DRAWPRIMTLVERTEX=1024
Procedure GetD3DDevice7()
!extrn _PB_Direct3D_Device
!MOV EAX,[_PB_Direct3D_Device]
ProcedureReturn
EndProcedure
InitSprite()
InitSprite3D()
OpenWindow(1,0,0,320,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Test")
OpenWindowedScreen(WindowID(),0,0,320,240,0,0,0)
Start3D()
*Dev.IDirect3DDevice7=GetD3DDevice7()
*Dev\GetCaps(caps.D3DDeviceDesc7)
If caps\dwDevCaps&#D3DDEVCAPS_DRAWPRIMTLVERTEX=0
MessageRequester("Info","Transparent 3DSprites are NOT supported by your 3D-accelerated !",#MB_ICONWARNING)
Else
MessageRequester("Info","Transparent 3DSprites are supported by your 3D-accelerated !",#MB_ICONINFORMATION)
EndIf
Stop3D()
CloseScreen()
NOTE: The test was wrong

[/Edit]
regrads
Stefan
Last edited by S.M. on Sat Jan 28, 2006 11:19 pm, edited 3 times in total.
Also, I've seen transparent "3d sprites" (polygons with textures) on this card but not made in PureBasic, with the current driver, using DirectX 8.---------------------------
Info
---------------------------
Transparent 3DSprites are supported by your 3D-accelerated !
---------------------------
OK
---------------------------
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Another common issue is that of compression. If you are making transparent sprites, you can not use jpegs. Only bmps have the needed quality for transparency to work correctly. Here is an example that shows the problem:
http://www.networkmaestro.com/geebee3.bmp
http://www.networkmaestro.com/geebee3.jpg
PS I cleaned the garbage from around the edges of Fred's geebee2.bmp and so the resulting geebee3.bmp doesn't have the pink border. Little side note: when making images for display with transparency, antialias is not your friend.
Code: Select all
InitSprite()
UseJPEGImageDecoder()
OpenWindow(0,0,0,320,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"")
OpenWindowedScreen(WindowID(0),0,0,320,240,0,0,0)
LoadSprite(0,"geebee3.bmp")
LoadSprite(1,"geebee3.jpg")
TransparentSpriteColor(0,RGB(255,0,255))
TransparentSpriteColor(1,RGB(255,0,255))
DisplayTransparentSprite(0,30,50)
DisplayTransparentSprite(1,180,50)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
http://www.networkmaestro.com/geebee3.jpg
PS I cleaned the garbage from around the edges of Fred's geebee2.bmp and so the resulting geebee3.bmp doesn't have the pink border. Little side note: when making images for display with transparency, antialias is not your friend.
Last edited by netmaestro on Tue Feb 21, 2006 7:08 pm, edited 8 times in total.
BERESHEIT
[quote="S.M."]@newart
A few GFXCards don't support colorkeying for 3D-Sprites. With this code you can test if your Hardware supports it:
Tested OK.
I have tested many games, there on mine Riva TNT2 there are no problems! Also there are no problems and PureBasic in 16bit mode.
A few GFXCards don't support colorkeying for 3D-Sprites. With this code you can test if your Hardware supports it:
Code: Select all
Structure D3DPrimCaps
EndIf
Stop3D()
CloseScreen()
I have tested many games, there on mine Riva TNT2 there are no problems! Also there are no problems and PureBasic in 16bit mode.
So has got used to use pink (*FF00FF) color key, that has not guessed to check up Black.
With Black all work with in 16 and 32 bit mode.
But there is one more bug.
Original sprite has the size 16x16.
And at resize 32x32, it is drawn on a miscellaneous in 16bit and 32bit mode.
16bit it correctly.
16bit:

32bit:

original (16x16):


With Black all work with in 16 and 32 bit mode.

But there is one more bug.

Original sprite has the size 16x16.
And at resize 32x32, it is drawn on a miscellaneous in 16bit and 32bit mode.
16bit it correctly.
16bit:

32bit:

original (16x16):

I know all this.PS I cleaned the garbage from around the edges of Fred's geebee2.bmp and so the resulting geebee3.bmp doesn't have the pink border. Little side note: when making images for display with transparency, antialias is not your friend.

Therefore very much I wait PureBasic 4 with Alpha channel.

- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
If it's not size or compression, I'm at a loss. Fred's probably right, a driver issue.
Last edited by netmaestro on Tue Feb 21, 2006 7:10 pm, edited 3 times in total.
BERESHEIT
The example file that comes with purebasic, which I have already checked for this problem, does still not have transparency. Also I tried with black instead of pink (changed the source of course) and the black wasn't transparent either.netmaestro wrote:Another common issue is that of compression. If you are making transparent sprites, you can not use jpegs. Only bmps have the needed quality for transparency to work correctly. Here is an example that shows the problem
What you gfx cart?Trond wrote:The example file that comes with purebasic, which I have already checked for this problem, does still not have transparency. Also I tried with black instead of pink (changed the source of course) and the black wasn't transparent either.netmaestro wrote:Another common issue is that of compression. If you are making transparent sprites, you can not use jpegs. Only bmps have the needed quality for transparency to work correctly. Here is an example that shows the problem