[6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post bugreports for the Windows version here
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

[6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

sprite is black, image not drawed)

Code: Select all

If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
  MessageRequester("Error", "Can't open the sprite system", 0)
  End
EndIf

UsePNGImageDecoder()
UseJPEGImageDecoder()
wx = 800
wy = 800


If OpenWindow(0, 0, 0, wx, wy, "SpriteMaker", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If OpenWindowedScreen(WindowID(0), 0, 0, wx, wy, 0, 0, 0)
    
    file$ = OpenFileRequester("Select an image","", "Image |*.jpg;*.png;*.bmp",0)    
    imageID = LoadImage(#PB_Any, file$)
    Debug imageid 
    spriteID = CreateSprite(#PB_Any,ImageWidth(imageID),ImageHeight(imageID) , #PB_Sprite_AlphaBlending)
    If StartDrawing(SpriteOutput(spriteID))
      DrawAlphaImage(ImageID(imageID),0,0)
      StopDrawing()
    EndIf

    
      Repeat
      Event = WindowEvent()
      
      If Event <> 0 ; All events are treated, so we can display the coordinates of the mouse
        SetWindowTitle(0, "Position of the mouse on the window: " + Str(WindowMouseX(0)) + "," + Str(WindowMouseX(0))) 
      Else
      
      Delay(1) ; Without a FlipBuffers(), Delay() frees the CPU for the multitasking
    EndIf
        DisplaySprite(spriteID,SpriteWidth(spriteID), SpriteHeight(spriteID))
    Until Event = #PB_Event_CloseWindow
  EndIf
EndIf
Last edited by IceSoft on Wed Feb 01, 2023 3:58 pm, edited 1 time in total.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by STARGÅTE »

Incomplete code!
ClearScreen() and FlipBuffers() was missing. Further, DisplayTransparentSprite() should be used for Sprites with alpha channel.

Works fine here. I can't see the issue.
Image

Code: Select all

        ClearScreen($402000)
        DisplayTransparentSprite(spriteID,SpriteWidth(spriteID), SpriteHeight(spriteID))
        FlipBuffers()
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

Works not (also not with your changes) here

here the on board graphic informations

Code: Select all

Name	Intel(R) Iris(R) Xe Graphics
PNP Device ID	PCI\VEN_8086&DEV_9A49&SUBSYS_87ED103C&REV_01\3&11583659&0&10
Adapter Type	Intel(R) Iris(R) Xe Graphics Family, Intel Corporation compatible
Adapter Description	Intel(R) Iris(R) Xe Graphics
Adapter RAM	1.00 GB (1,073,741,824 bytes)
Installed Drivers	C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_bd06817067e305f4\igdumdim64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_bd06817067e305f4\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_bd06817067e305f4\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_bd06817067e305f4\igd12umd64.dll
Driver Version	30.0.101.1003
INF File	oem167.inf (iTGLD_w10_DS section)
Color Planes	Not Available
Color Table Entries	4294967296
Resolution	1920 x 1080 x 60 hertz
Bits/Pixel	32
Memory Address	0x1E000000-0x1EFFFFFF
Memory Address	0x0000-0xFFFFFFF
I/O Port	0x00003000-0x0000303F
IRQ Channel	IRQ 4294967243
Driver	C:\WINDOWS\SYSTEM32\DRIVERSTORE\FILEREPOSITORY\IIGD_DCH.INF_AMD64_BD06817067E305F4\IGDKMDN64.SYS (30.0.101.1003, 29.73 MB (31,178,328 bytes), 11/21/2022 10:29 AM)
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Fred
Administrator
Administrator
Posts: 16618
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by Fred »

Try to switch to directx9 or directx11 subsystem to see if it works
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

Fred wrote: Wed Feb 01, 2023 11:39 am Try to switch to directx9 or directx11 subsystem to see if it works
Direct9 works.
DirectX11 seems not installed (--------------------------- Error Can't open the sprite system)
OpenGL driver works also not with #PB_Sprite_AlphaBlending (see first entry)
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

IceSoft wrote: Wed Feb 01, 2023 12:11 pm
Fred wrote: Wed Feb 01, 2023 11:39 am Try to switch to directx9 or directx11 subsystem to see if it works
Direct9 works.
DirectX11 seems not installed (--------------------------- Error Can't open the sprite system)
OpenGL driver works also not with #PB_Sprite_AlphaBlending (see first entry)
@fred,
Mayby an addidional hint on the online help to "#PB_Sprite_AlphaBlending" is usefull?
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by STARGÅTE »

IceSoft wrote: Wed Feb 01, 2023 3:57 pm @fred,
Mayby an addidional hint on the online help to "#PB_Sprite_AlphaBlending" is usefull?
Hint for what?

Can you give more details?
  • Does it work if you load the sprite with LoadSprite() and #PB_Sprite_AlphaBlending?
  • Is the sprite not black when you use DrawImage()?
  • What is shown if you draw a Box() with the StartDrawing() block?
  • What is shown when you save the sprite with SaveSprite() as PNG?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

STARGÅTE wrote: Wed Feb 01, 2023 4:10 pm
IceSoft wrote: Wed Feb 01, 2023 3:57 pm @fred,
Mayby an addidional hint on the online help to "#PB_Sprite_AlphaBlending" is usefull?
Hint for what?

Can you give more details?
  • Does it work if you load the sprite with LoadSprite() and #PB_Sprite_AlphaBlending?
  • Is the sprite not black when you use DrawImage()?
  • What is shown if you draw a Box() with the StartDrawing() block?
  • What is shown when you save the sprite with SaveSprite() as PNG?
e.g this one on CreateSprite() docu

Code: Select all

#PB_Sprite_AlphaBlending : Sprite is created with per pixel alpha-channel support, needed for DisplayTransparentSprite().
OpenGL is the default subsystem: If the sprite with mode: "#PB_Sprite_AlphaBlending" not 
drawing try one of the other subsytem: Directx9 or Directx11
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by STARGÅTE »

It was not a hint given by fred to use directx9 or directx11. He (and also me) just wants to detect the origin of this possible bug. Usually bugs are not fixed by telling the user to try something else.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

STARGÅTE wrote: Wed Feb 01, 2023 4:32 pm It was not a hint given by fred to use directx9 or directx11. He (and also me) just wants to detect the origin of this possible bug. Usually bugs are not fixed by telling the user to try something else.
What should I say?
It works with subsystem Directx9
With OpenGL not.
And Directx11 isn't installed

I will answer your questions later.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Fred
Administrator
Administrator
Posts: 16618
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by Fred »

It might be the same issue than viewtopic.php?t=79720
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

Fred wrote: Wed Feb 01, 2023 4:48 pm It might be the same issue than viewtopic.php?t=79720
Yes it looks like this.
Directx9 works (all boxes red)
OpenGL the second box is black
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by IceSoft »

@Fred
Pease close this.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [6.01b2 Documentation] StartDrawing(SpriteOutput(spriteID)) works not with #PB_Sprite_AlphaBlending

Post by mk-soft »

Transparent sprites also work without #PB_Sprite_AlphaBlending with OpenGL. Probably because the sprite image is created without alpha blending and the transparent color from image is black by default.

See AnimatedGIFSprite
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply