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.

AppGameKit Classic Chat / line drawing - no precision in full screen mode

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 01:03
Line drawing works fine in windowed, but go full screen and it isn't accurate or it's rounded with the mag/min stuff.

Unfortunaly, can't set mag/min on lines...!!

Just try this at 1024,768 res, both full screen and windowed.



AgentSam
12
Years of Service
User Offline
Joined: 14th Mar 2012
Location: Virtual Space
Posted: 30th May 2013 02:29 Edited at: 30th May 2013 02:31
When using:

Main.agc:


Setup.agc:

All I get is three horizontal lines on top of each other, but I cannot see any of the rounding or blurring that I think you are referring to.

I tested the app in these modes on Windows:
1 - 1024x768 windowed mode (normal)
2 - 1024x768 windowed mode (maximized)
3 - 1024x768 full-screen

Same result every time: didn't get any blurring or rounding.

What does it look like on your screen? Screenshot?

Cheers,
AgentSam
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 02:46 Edited at: 30th May 2013 02:47
Hmm.. interesting!

Screenshot attached.. both line sequences are drawn 1 value apart on the Y axis.

I am using 1088

I edited the image as it was a screen shot at my desktop res, which is 1920x1080, although the code sets 1024x768

..and yea, there's another problem there with the colour used by the line command in the purple sequence..

Attachments

Login to view attachments
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 02:56 Edited at: 30th May 2013 02:57
Interestingly, if I draw at 0.5 pixel increments, it's fine..

(apart from the colour, which is a different issue again... see image..

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2013 18:14
Unfortunately lines are only a single pixel wide because of the OpenGL method we use to draw them. This means that even though your virtual resolution is still 1024x768, the full screen window has 1920x1080 pixels, so drawing one line at every virtual resolution increment misses out some pixels at the full screen size.

To draw a line at every pixel no matter what the actual resolution is you could use something like this


This will find the actual number of pixels between two virtual resolution coodinates, in this case Y=100 and Y=120 and draw the necessary number of lines to fill it.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 21:49
Well, I only want to draw lines to generate images at runtime, so a bit of extra processing won't hurt. Thanks for the tip.

One other thing: notice the grading on the purple lines? That doesn't look right - it shouldn't go brighter there.

These are the numbers feeding the colour:



Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2013 22:53
Your snippet only contains a single color value whilst purple is made up of red, green, and blue. How are you interpolating the other color values? You may want to look at Hue, Saturation, and Value conversion if you want the hue to remain the same but the saturation/brightness to decrease. You can do your calculations in HSV and then convert to RGB to draw the lines.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 23:19
the value for purple was equally applied to the RED and BLUE channels. as in:



If I was to draw the same lines using those values in a paint package they would be smooth. Actually, I'll load that image into paintshop and compare the colour sequence..

nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 23:28
There's definately something wrong.

Up until the brighter colour, the colours go:

250,0,250
243,0,243
..
198,0,198
192,0,192 <-last true purple (coincidence that it's a bit boundary?!)

as expected.

Next line (the brighter part) it goes:

181,0,245
175,0,239
170,0,234

When it recovers, it's back to:

127,0,127 <- coincidence? Strange that it's the top 4 bits...

The numbers in the list in my earlier post are debuged straight out as the value being passed to the line function in the R and B channels. I will try another colour / combo..

nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th May 2013 23:37
OK, I have isolated the issue to the blue channel.

See the attached for specifically the blue only and white line drawing.

Red, green and yellow are correct.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st May 2013 07:17
You are correct, there was a bug in the way the blue channel was handled. Fixed for the next version.
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 2nd Jun 2013 10:22
nice catch nz0.

A bug like that could have gone undetected for years.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 2nd Jun 2013 13:28
Thanks.
I had only just started looking into generating textures.

Nice that Paul fixed it straight away too.

Login to post a reply

Server time is: 2024-11-24 14:08:13
Your offset time is: 2024-11-24 14:08:13