Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / windows 8.1 transparency bug

Author
Message
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 13th Jul 2014 12:21 Edited at: 13th Jul 2014 16:18
Hi

I use test my game project on my father's laptop sometimes.
Everything was OK under Windows 8 but since he upgraded to Windows 8.1 my game has a big problem:

All the objects that uses black in their texture for transparency displays an ugly blue where they should be transparent.

Ghosted objects are not affected but that cannot realy be a solution for all as for example I use a lot of "object plain" with texture of a tree and dont want them to be ghosted and making those trees as complex geometry to avoid using the transparency system would kill my framerate...

The "set object objnum,1,0,0" command is not the problem as if I set it to "set object objnum,1,1,0" black is displayed correctly.
It is just Windows 8.1 which displays solid blue instead of transparency... WTF

I did some research with commands like "set object ambiant" but didn't found a solution so I search for help here in the forum.

For information, the Windows 8.1 laptop is up to date as well as his graphic driver an again had not the problem under Windows 8.0

It looks like Microsoft did some changes as on first launch of the game windows prompted to install "direct play" as a legacy Windows
component...
Otherwise the game runs ok except for that transparency bug.


I haven't contacted Microsoft about that, guess guys at TGC are better placed than I am.

Thanks for your help if you can do something as I have been working on that project for years and beeing able to run under Windows 8.1 is major. I will consider going to DBpro if I must but it would be painfull and time consuming... and I hope the same problem doesn't occure in DBpro??

feel free to visit my web site
Latch
11
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Jul 2014 21:53 Edited at: 14th Jul 2014 21:54
Hello,

If it doesn't exist already, copy the following code block into a blank text file and save it as "setup.ini" in the same directory as the DB.exe - and the same directory as the main executable of any of your games (if the were made into exes).

The settings to note are

blitflipmode=1
and blitoverdraw=0

Try altering the values between 0 and 1 saving the file between each change and see if it makes a difference.



Enjoy your day.
Jeff Miller
13
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 16th Jul 2014 17:20
I would suggest adding "SET BITMAP FORMAT 21" at the top of your program. That has helped me on occasion when upgrading Windows.
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 18th Jul 2014 13:08
@latch: unfortunately your trick did not produced any changes

@jeff miller: I guess your command is designed for DBpro, it is not recognised by DBC

for a better understanding of the problem here are two images of a little test program I made showing the same frame both under windows xp to 8 and under windows 8.1

good:


bad:


I also provide a final.exe you can download so if someone could test it under another windows 8.1 computer that would help me figure out if it is a generic bug or related to my father's laptop.

thank you very much

feel free to visit my web site

Attachments

Login to view attachments
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 18th Jul 2014 18:55
hi,

click on my profile and check my blending/transparency demo. They also bug?

DirectX 9.0c (February 2010)/ DBClassic v1.20
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 18th Jul 2014 20:57
@silverman:

thank you, no your demos ain't affected as they use ghosted objects and your alpha mapping demo may bring a solution.

I don't realy understand yet how you achieve having a ghosted object to be opaque instead of half transparent that may be through ambiant and diffuse settings but I will study your code carefully ...

feel free to visit my web site
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 20th Jul 2014 18:02 Edited at: 20th Jul 2014 18:04
using the "backdrop off" command then doubling the object with one ghosted object and another with "ghost object on objnum,1" then diffuse and ambiant with good ambiant settings gave me a nice solution.

I hope it wont move depending on the light system as I havent checked that yet.

It means doubling the amount of objects but in the other hand gives a better "alpha channel like" with a wider range of blacks values up to something like rgb(10.10.10) or a little bit more...

backdrop off

+

make object plain 91,512,128
texture object 91,91
set object 91,1,0,1
set object ambient 91,rgb(96,96,96)
set object diffuse 91,rgb(255,255,255)
ghost object on 91

make object plain 92,512,128
texture object 92,91
set object 92,1,0,1
set object ambient 92,rgb(96,96,96)
set object diffuse 92,rgb(255,255,255)
ghost object on 92,1

feel free to visit my web site
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 21st Jul 2014 20:29 Edited at: 28th Jul 2014 19:56
you have fully understood.
I made a sophisticated demo: more easy to use because only ONE object to manipulate + improved image quality

enjoy!

EDIT : corrected two errors in the code

DirectX 9.0c (February 2010)/ DBClassic v1.20

Attachments

Login to view attachments
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 23rd Jul 2014 23:46
anyhow if one could run the test of my second post under windows 8.1 that would clarify if the problem is computer related or not...

thank you

feel free to visit my web site
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 2nd Aug 2014 00:22 Edited at: 2nd Aug 2014 00:28
I have exactly the same problem. And I am sorry that I can't help you but I can explain you how I experience this problem.

I have this problem with Windows 7 on a Lenovo Notebook using a Core i3 processor with integrated graphics. It's a HD4000 graphics card. The problem is the Intel graphics driver which is unable to display transparency correct. I have a game I wanted to publish using DarkBasic. It runs fine with Geforce and ATI graphics cards. It even runs fine on older HD3000 integrated graphics but the latest drivers from Intel are not able to display the correct transparency using DarkBasic. It's a pity because it ruined all my effort preventing me from working on with this game. So far... I canceled my project and if I got the time I'll try another software. DarkBasic Pro however is no solution for me because of the Fullscreen Windows-Key bug.

I have four computers here testing my code exactly the way you did. Geforce is displaying everything correct. Even Atom netbook shows no transparency errors but the latest Intel driver on my i3 notebook shows exactly the same problem.

It's a driver and or hardware problem but NOT a DarkBasic problem.

Rylex

Edit: Another problem is that Intel will not recognize this bug as a bug. I've contacted Intel support because of other major bugs in their graphics drivers which prevent notebooks from playing sound on a Windows machine if the notebook is not attached to a power cord. I've attached a complete report and explained that the latest driver needs to be removed because it renders the sound of the latest Lenovo notebooks useless if this driver is installed. The told me to use the Lenovo driver and not the Intel driver but refused to correct the errors. Well... they are just not interested in improving their drivers - so better give up!
highwind
9
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 5th Aug 2014 00:22
@ rylex:
thanks a lot for the info so the problem reported here is not related to windows 8.1 but to intel HD4000 graphics as my father's laptop's got HD4000 too....

From my side I have solutioned it using ghost and negative alpha blending according to nice diffuse and ambiant settings...

I have not met sound problems so far.

I will keap going like that unless driver for HD4000 get 0K before release time for my game.

feel free to visit my web site
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 12th Aug 2014 14:18
I wanted to keep you updated.

I've written a long email today to the Intel Customer Support because I already reported several bugs in their latest drivers.
I tried to explain the transparency problem and included screenshots and an example program so they could test out this issue.

I'll keep you updated if I get a reponse. So far I'm not sure if they will answer me... or if they really care about this problem. However, I've written them a complete report that's all I could do.

... let's wait and see...

Rylex
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 15th Aug 2014 12:41
After several emails and further explaing the problem, I've got the following reply today from the Intel Support Center:

=======
Thank you for contacting again Intel Customer Support.

At this point, we are going to pass this information to the engineering department, allow us time to get information from this department, we will contact you back.
=======

Good news so far
Latch
11
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Aug 2014 00:50
Quote: "All the objects that uses black in their texture for transparency displays an ugly blue where they should be transparent.
"


Just a thought, what if you set the background color to black (I don't remember the command offhand)

BACKGROUND COLOR 0
BACKDROP COLOR 0

I can't really remember the command, but something like that. The blue in your example looks like the default background color for 3d.

Enjoy your day.
Attila
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 26th Aug 2014 14:49 Edited at: 26th Aug 2014 14:53
I tried this program on an INTEL-GPU/Chipset it worked well, maybe the format of the images you use is not OK.
Therefore the program generates the images by itself, assuring the proper format.

You can try the program to find out if its the GPU, the driver or your images that create the problem.



for testing the images are saved in the same directory, if they work you could test using the images in your program - if they work then I assume the problem ist in the format of your images.
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 9th Sep 2014 15:56
Your transparent sprite cursor works... however - this is not the problem I have experienced.

I have attached a little zip-file with 3 files included:
- envsg01.3DS (a little plane for seagrass)
- envsg01.png (seagrass texture)
- transparency.dba

Try to load the transparency.dba (the code is not long) and take a look at the transparency.

You can use Arrow keys (left, right) to rotate and (up, down) to scale. Press SPACE to activate/deactivate transparency.

I get the following result on a integrated Intel graphics card (like HD4000):



As you can see the transparency is not working.

When I use my Geforce graphics card on another machine, everything is OK:



You can try for yourself... please let me know, how it turned out.

Rylex

P.S. So far no news from Intel about this problem...

Attachments

Login to view attachments
Attila
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 14th Sep 2014 16:32 Edited at: 14th Sep 2014 17:01
Sorry Rylex I cannot reproduce your Problem on a INTEL-GPU (Intel HD Graphics Pentium) , sorry.

But you can - as work around - try to create instead PLAIN-Objects (see MAKE OBJECT PLAIN in the help files) and texture then with a .BMP-File (BMPs are pixel-exact and where always supported in DB).

Your object are not flat and when you texture them, a Copy of the texture is although displayed on the top making a "black" stripe. The other factor with "3d-objects" is that you must adjust the culling (see SET OBJECT ... in the help files). If you do not set the culling parts of your object overlapped by others will disappear.

A plain-object is basically 2d (Constructed by a flat mesh) and there need neither culling is needed nor can it texture the top-plane.
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 18th Sep 2014 01:08
Yeah, you probably have one of those chips that are not affected by this problem! I have a friend who has a SandyBridge-based notebook and everything works fine.

I have run this test on quite a lot of different systems and different OS as well. ATI cards, Geforce cards and some older Intel graphics work perfect. The "newer" Intel graphic solutions like my HD4000 show this ugly graphic error. So I really doubt it is a programming problem.

If you have a short test program for me with a very simple transparent texture where you simulate transparency (for example grass like above), I would agree to test it and prove you that this produces the same graphic errors as my problem above. You can take a look at my source code (it was attached above on the Download button)... I used "SET OBJECT..." and it works fine on the mentioned systems above.

I already tried a BMP texture and it didn't work, too.
The 3ds model I used for this test is the most simple object you could have. It even doesn't have a back-side. Only the front-side is visible and it gave me a better performance than plain objects.

I used thousands of different objects for my game which are placed on a random landscape in realtime but so far I canceled it because there are several graphic errors like the one mentioned above and it just ruins this game.

By the way, I'm using DarkBasic 1.13. The transparency problem is the same with version 1.21 or whatever the latest version is. DarkBasic 1.21 has problems with a German keyboard and uses other shadowing techniques which showed some problems with my 3ds models. Due to this fact, I'm still using version 1.13...

Here is one of the last screenshots of my last DarkBasic 1.13 project "The Boat":



But I have stopped programming with DarkBasic at the moment because you can't play this on the newest Intel chips. This screenshot was made on a working Geforce system.
Attila
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 18th Sep 2014 11:01
I made a small test program with plain-object grass and it works on my intel and my ati-card (in the desktop-machine). I hope it will work for you too. Its attached in the zip - including all media.

If not you could try to download the driver for an older intel-card (maybe on the webside of your hardware producer) my laptop is an acer and they kept the old drivers on the website. (Win 7/64bit: http://global-download.acer.com/GDFiles/Driver/VGA/VGA_Intel_8.15.10.2182_W7x86W7x64_A.zip?acerid=634460370128693280&Step1=NOTEBOOK&Step2=TRAVELMATE&Step3=TRAVELMATE%205742Z&OS=ALL&LC=en&BC=ACER&SC=PA_6). Maybe the driver will work for you too. As it looks (for me) you can try to install the acer-driver and if this does not work the original driver again. Which should not do any harm when trying. Sometimes the hardware manufacturers provide their own drivers which are better adapted to the chip sets and therefore work better.

If this does not work I'm running out of ideas - sorry!

kind regards

Attachments

Login to view attachments
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 18th Sep 2014 12:31 Edited at: 18th Sep 2014 13:18
At first I'd like to thank you very much for your patience and your help.
I've downloaded your program and ran it on my Intel HD4000 machine. The result is as predicted:



Not very nice, right?

I will try and install another graphics driver but I need to backup my whole system before I do that. So that might take a while. Everything else works OK on this system so I'm a bit unsure if I should try that.

Last time I installed another graphics driver my system was not usable because the sound didn't work anymore when the notebook was running on battery. That might be a problem with the Intel HDCP audio drivers which are integrated into the graphics driver.
However, even uninstalling the wrong driver and reinstalling the old one didn't help. Only a clean restore of a backup was able to solve the problem. Of course I informed Intel about this problem but (as always) they didn't care.

The most important problem is: Even if I install an older driver that works - everybody else who uses the latest drivers from Intel can't use my programs.
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 18th Sep 2014 17:28 Edited at: 20th Sep 2014 15:36
hi Rylex,

can you run the snippet(DBClassic 1.21), and tell me if you still see the bug?(post a screenshot please)

Edit : now, the functions are compatible with DBClassic v113

DirectX 9.0c (February 2010)/ DBClassic v1.20

Attachments

Login to view attachments
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 18th Sep 2014 17:48 Edited at: 18th Sep 2014 17:48
Hi Silverman,

Thank you very much for these test-files.
I have run your included EXE-file.

(I don't have DB Classic 1.21 installed on this machine. I'm still using 1.13 because of the German keyboard bug and problems with lightning for my 3ds models)

OK here are the results:





When rotating the objects, you can see that the left grass still has the wrong blue background. (see picture 2 above)

My Geforce systems showed no problems on the left side - everything was OK.

I would say this is a nice workarround although it's not working with DarkBasic Classic 1.13 and the code seems a bit longer than using standard techniques. But it seems to work.
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 20th Sep 2014 15:40
I thought it was the filtering that cause bug.

the function "add_alpha_to_object" is easy to adapt to DBClassic v113:


DirectX 9.0c (February 2010)/ DBClassic v1.20
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 22nd Sep 2014 12:53
Thank you very much for your help!

I tried to include this function into my test-program (linked above)
http://forumfiles.thegamecreators.com/download/2533233

Probably I did something wrong. Do I need an extra alpha image for this code to work? I just used the normal image (just like your example download from above) and loaded it as number 11. Then I needed to load it (manual) again as number 32778 (because you add +32767 to the image number).

When everything loaded I even got graphics errors on my Geforce system because the objects were black and not transparent. So perhaps it doesn't work on DBC 1.13 or I screwed it up.

Original Code here WITHOUT your function and extra image load number 32778:
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 22nd Sep 2014 17:41
try tis:


DirectX 9.0c (February 2010)/ DBClassic v1.20
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 22nd Sep 2014 18:23
Thank you very, very much for your help and patience!

Yes this really works with DarkBasic Classic 1.13!
The alpha state makes the object not 100% solid but a little bit transparent but it is a very good compromise. Better than everything else I've tested so far.



See on the picture: The more grass the brighter the colors but it's great it works on both systems!
Thanks!
Rylex
15
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 30th Oct 2014 19:23 Edited at: 30th Oct 2014 19:24
Update:

I really have received news from the Intel support today.

The first step they've recommended me to do a BIOS update if I don't have the latest BIOS... but...

They've created a new graphics driver and told me this might fix the problem. The old driver needs to be uninstalled completely. Then reboot the system.
Intel has told me that just installing the new diver might cause problems - so please first uninstall the old driver AND REBOOT(!!)

The file can be located at:

IntelĀ® HD Graphics Driver for Windows* 7/8/8.1 32-bit, Version: 15.33.30.3958
https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=24346

You may use the win32_153330.exe file

If anybody could test this on his or her system, we could find out if this really changed something when using the old DB code.

Best wishes

Rylex

HAPPY TESTING!! and don't forget the feedback!
Latch
11
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Jan 2015 03:13
Hello, I'm seeing this same issue with an HD 4000 card. All of my old DBC stuff with transparency inherits the backdrop color for those areas that are supposed to be see through. In the OPs examples above, their planes had the default blue backdrop color. If you change the backdrop color, the transparent color on those will change as well.

I've updated my HD 4000 drives to no avail. This is a compatibility/driver issue most likely with directx versions earilier than DX 9 and it may be specific to laptops. I doubt there will be a fix for this graphics card as it's not in intels interest to be backward compatible with Direct X 7 and 8 which is what DBC is built on.

You can get around it to some extent by disabling the zdepth of objects : DISABLE OBJECT ZDEPTH number

but then you have to be careful as to which objects are supposed to be in front of other objects.

Enjoy your day.
Latch
11
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jan 2015 00:06 Edited at: 20th Jan 2015 19:41
Here is a work around for the transparency bug. I'm not sure if Silverman's is the same. This version uses two identical objects, has them both set to transparency, then opposite ghosts each one. This allows the transparency to function and retains the full colors of the non transparent areas effectively making them solid.

Use spacebar to toggle regular transparency vs transparency + alpha (ghost). Move mouse left and right to rotate object.



Enjoy your day.
Silverman
11
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 20th Jan 2015 13:28
Yes, I do the same approach, then I glue objects together.
The subroutine "blood_splatter" is very interesting.

DirectX 9.0c (February 2010)/ DBClassic v1.20

Login to post a reply

Server time is: 2018-04-27 05:18:20
Your offset time is: 2018-04-27 05:18:20