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 Professional Discussion / Question on included 'Shader' example project

Author
Message
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 01:48 Edited at: 4th Oct 2010 01:51
First off, I just recently downloaded DarkBasic Pro and am completely knew to this. Sorry in advance for "noob" status.

Anyway...

Upon opening the 'Shader' example in DarkBasic Pro, the example seemed to be okay but then I noticed that after exactly 5 seconds the screen suddenly changed to this:



This happens every time I open this file.

Is this part of the demo or do I have a computer issue?

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Oct 2010 03:04 Edited at: 4th Oct 2010 03:06
I get the following image - and I got tired of waiting for it to change:



So it looks like a computer issue - or possibly a DBPro upgrade problem. I'm using the latest upgrade U7.5.

Attachments

Login to view attachments
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 03:29 Edited at: 4th Oct 2010 03:46
Thanks for the input, Green Gandalf.

Making a comparison of the two screens, I can see there is a bigger difference in what is supposed to be displayed and what I'm getting.

Possibly a monitor display issue?

I was hoping it wasn't my comp.

I don't think its an upgrade issue as I had the same problem occurring before I made the upgrade.

Seems like all the other example projects are running fine from what I've seen so far.

Thanks again for your input.

EDIT

Ok. I love this program.

Definitely a display issue.

Changed a few lines of code in screen size and everything looks exactly like yours although the screen still blips after 5 seconds.

Can't believe how simple this is...

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Oct 2010 12:40
Are you using a laptop? My laptop sometimes gives strange results with shaders - something to do with overheating I suspect.

Quote: "Can't believe how simple this is..."


It is.
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 15:02
Quote: "Are you using a laptop?"


No its a desktop.

I think it may have something to do with the fact that I have a 19" monitor (1400x900 display). I had a very distorted display when running FPS Creator on this monitor size.

No overheating either. My graphics card runs about 45 celsius idle, 60 when pushing graphics.

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Oct 2010 16:21
Could you take two screenshots, one before the "blip" and one after, so we know what the problem looks like? Zip the two images together without reducing their sizes as a download and I'll take a look.
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 17:37 Edited at: 4th Oct 2010 17:37
Here are the two screenshots, the second taken immediately after the "blip" occurs.

The display code is back to its original state as well.

Thanks for taking the time to look further into this!

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT

Attachments

Login to view attachments
Serial Velocity
15
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 4th Oct 2010 17:38 Edited at: 4th Oct 2010 17:38
It doesn't seem to be an issue with the monitor display as you can print screen and the problem still shows. Have you tried updating or reinstalling your graphics cards drivers?

Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 18:12 Edited at: 4th Oct 2010 18:42
Hey, Serial Velocity!

My graphics card driver is up to date but I will do a reinstall and post the results.

Thanks for the suggestion!

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 18:42
Did a complete uninstall/reinstall of the graphics card driver and still getting same results.

One thing about my particular card (that may have absolutely nothing to do with the issue) is that it uses 16 cores instead of 32 (which is why I cannot use the latest Physx release).

Would this make a difference?

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Oct 2010 20:29
I've just reproduced exactly your problem by making apparently minor changes to the screen and camera image settings used in the code. The default resolution on my machine is 1680x1050 and the problem appeared when I changed the settings to those. That should have improved the quality if anything - but didn't.

My guess is that there's a screen resolution hard coded in one of the full-screen shaders in that demo. I'll investigate and report back.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Oct 2010 21:33 Edited at: 4th Oct 2010 21:53
Interesting.

I can't see an obvious problem in the shaders yet.

I tested various display modes and the ones which give weird results after a short delay all have screen height/width ratios less than 0.75. The ones which seem to work all have ratios of 0.75 or 0.8 such as 1600x1200 (ratio=0.75) and 1280x1024 (ratio = 0.8). This suggests something in the code or a shader is making an assumption about the ratio.

Another clue is that the problem kicks in after a short delay. One thing which does that is the "cheapmotionblur" section of the dba code:



If you stop the controlling variable from changing then the problem goes away (see my comment in the above snippet).

So it looks like something to do with object 1 and shader 21. Perhaps someone else can take it from here? My brain hurts.

In short, I very much doubt there's a problem with your PC.

You could try different valid screen widths and heights in the following lines in the dba code (make sure they match):





I did it by replacing the values with variables sw and sh which I set in a convenient spot near the top of the code.

Edit There are at least two objects which seem to involve the ratio 0.75 - objects 1 and 8. There may be another somewhere. I'm sure a simple fix is possible - eventually.
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 4th Oct 2010 22:17
WOW!

Thank you so much for your thorough research into this, Green Gandalf!

I'm certainly relieved that my PC seems to be in the clear...whew!

Quote: "My brain hurts."


Mine hurts just from reading the explanation on the issue!

Again, thanks for your VERY much appreciated help on this!

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Oct 2010 01:39 Edited at: 5th Oct 2010 02:01
OK. I think I solved the problem. The attached code works correctly on all screen settings I've tried.

The main changes are to various make object box and position camera statements. I'll spare you the details unless you really need to know.

Near the top of the code I've put two lines for the screen width and height:



Just change those values to your preferred display setting. You could probably change those lines to detect the setting automatically as follows:



Let me know how you get on.

Edit Just tried both versions on my laptop. Neither work correctly. Oh well ...

Attachments

Login to view attachments
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 5th Oct 2010 16:14 Edited at: 5th Oct 2010 16:16
I believe you're on to something here.

I downloaded the file and replaced the existing one in the 'shader demo'.

The screen adjusted perfectly but I still have a 'blip' that happens 5 seconds into loading the project that changes the screen a bit (mostly, the red becomes brighter/over saturated and washes out the detail).

I've included before/after screenshots in a zip.

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Oct 2010 17:35 Edited at: 5th Oct 2010 17:35
It's supposed to do that.

The displayed scene changes after a fixed number of frames (about 400) when cheapmotionblur# exceeds 100 or so - look near the end of the code.

For some reason my laptop refuses to run some parts of the code correctly. I've looked at the code again and I can't see why it's doing it. I DO suspect a hardware problem this time.

The revised demo seems to run fine on my desktop with any 32 bit display mode.

The code does look rather convoluted to me and it isn't at all clear what you're supposed to be seeing.

Looks good though.

You'd probably be better off programming the dba code for the various screen effects yourself - and use the shaders (especially my one of course ).
Tombsville
13
Years of Service
User Offline
Joined: 10th May 2010
Location: Tombsville
Posted: 5th Oct 2010 18:36
Quote: "It's supposed to do that."


DOH!

PROBLEM SOLVED THEN!

Quote: "You'd probably be better off programming the dba code for the various screen effects yourself"


An added challenge I'm willing to take considering how easy the coding appears to be.

Quote: "and use the shaders (especially my one of course )"


NO DOUBT THERE!

THANKS AGAIN for taking the time to look into this and solve this issue!

Windows XP Home, AMD Athlon 64x2 Dual Core Processor @ 2.61 GHz, 3.00 GB RAM, NVIDIA GeForce 8500GT

Login to post a reply

Server time is: 2024-05-04 10:54:21
Your offset time is: 2024-05-04 10:54:21