Error with Mac APP

Previous topic - Next topic

Kyo

Quote from: MrTAToad on 2014-Aug-26
Could always subtract 0.5 from x1 and y1 - that works!

I test with this value:
Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 299.5
IF i = 3 THEN x = 599.5


and with this:

Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 300.5
IF i = 3 THEN x = 600.5


But if I scroll the BG (Left and Right arrow Keys) I see the black line!

Quote from: spacefractal on 2014-Aug-27
you could also convert it to integer to make sure its dosent get somewhere a float, which often seen the issue. This is was im do when im scaling my game to make sure you dont seen black lines.

can been done something like x=INTERGER(x)

I do not understand how it should work, but i test with:

Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600
x=INTEGER(x)
av_x =INTEGER(av_x)
z_drawstage( i,x + av_x,0)


But the line black remains.

Please test directly in my example, and post me the code!
I'm stuck on this problem for 3 days...  :rant:

MrTAToad

Try this :

Code (glbasic) Select
        x1=(x_offset+(x*xzoom)) * Scale# - 0.5
        x2=(sx*xzoom) * Scale#
        y1=(y_offset+(y*yzoom)) * Scale# - 0.5
        y2=(sy*yzoom) * Scale#

Kyo

Quote from: MrTAToad on 2014-Aug-27
Try this :

Code (glbasic) Select
        x1=(x_offset+(x*xzoom)) * Scale# - 0.5
        x2=(sx*xzoom) * Scale#
        y1=(y_offset+(y*yzoom)) * Scale# - 0.5
        y2=(sy*yzoom) * Scale#


If you test in my example, you'll see that in the beginning, it seems correct, but if you move the BG you can see the black line!

Please test with my example!  :nw:

Qedo

Tell a banality. Have you tried Power of Two image?
try with 256x256 image.
I can not verify because I have not a MAC.
Ciao

Kyo

Quote from: Qedo on 2014-Aug-27
Tell a banality. Have you tried Power of Two image?
try with 256x256 image.
I can not verify because I have not a MAC.
Ciao
It's possible to work but I have almost finished to make my game, and all my stages are not Px2 Sprites!
The only system to work without problem on a mac it's to inser this 2 lines of code directly in gl_b source code.

Please Kitty Hello (Gernot) insert in source code this 2 line:

Code (glbasic) Select

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\


I wait you for release my game!  :good:




MrTAToad

It will be hard to position due to scaling unfortunately.  It looks like STARTPOLY texture mapping system with glTexParameteri.

A power of two texture would help though

Kyo

Quote from: MrTAToad on 2014-Aug-27
It will be hard to position due to scaling unfortunately.  It looks like STARTPOLY texture mapping system with glTexParameteri.

A power of two texture would help though

It's impossible to change all sprites of my game ....
:rant: :rant: :rant: :rant: >:D >:D >:D >:D >:D :help: :help: :help:

MrTAToad

Use :

Code (glbasic) Select
WHILE TRUE
SMOOTHSHADING FALSE
IF KEY(203) THEN av_x = av_x + 3
IF KEY(205) THEN av_x = av_x - 3

FOR i = 1 TO 3
IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600

z_drawstage( i,x + av_x,0)
NEXT

SHOWSCREEN
WEND


That works fine with scrolling

Kyo

#23
Quote from: MrTAToad on 2014-Aug-27
Use :

Code (glbasic) Select
WHILE TRUE
SMOOTHSHADING FALSE
IF KEY(203) THEN av_x = av_x + 3
IF KEY(205) THEN av_x = av_x - 3

FOR i = 1 TO 3
IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600

z_drawstage( i,x + av_x,0)
NEXT

SHOWSCREEN
WEND


That works fine with scrolling


Work fine, the problem it's the gfx... are horrible ....  :'(

the pixels are shelled, ruined (I don't know how to explain)  ....

MrTAToad

Its mainly due to the anti-aliased text.  Unfortunately anti-aliasing is unpredictable with scaling.

If you really need anti-aliasing, then you may need to take into account the slight gap or see if Gernot adds in some clamping stuff.




Kyo

Quote from: MrTAToad on 2014-Aug-28
Its mainly due to the anti-aliased text.  Unfortunately anti-aliasing is unpredictable with scaling.

If you really need anti-aliasing, then you may need to take into account the slight gap or see if Gernot adds in some clamping stuff.

I send a private message to Kitty Hello .... and now I wait and I pray ....  :nw:

Kyo

Other problem in Mac
1) if ISMUSICPLAYING() = TRUE then STOPMUSIC  the music dosn't stop!
2) MUSICVOLUME  don't work!
3) PLAYSOUND(num%, pan#, volume#) with WAV don't work!

Shit Mac!  :whip:

Schranz0r

If i understand right you have a problem with youre textures... it's called "Texturebleeding" :blink:

GLB use on glTexParameteri for Texture2D GL_LINEAR, what you need is to change to GL_NEAREST !
Should solve youre problem...
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Moru

If I remember right, can't find the source right now:

Many old grafics-cards do not support images in arbitrary sizes, they only support SQUARE sizes at power of two. This means 64x64 is ok, 256x256 is also ok. However, 300x301 is not ok. To fix this, GLBasic will resize the working surface to 512x512 and fill the rest of the image with 0. When you use anti-alias to make your edges smooth, the grafics card will pick the average of the colors between your image and this black border.

There is methods for getting around this, one is to disable anti-alias. Not so sure of the others since I haven't been doing this for years but at one time I got around it by setting the texture pixel size 0.5 or 0.75 pixels smaller than the actual image with polyvectors. Not sure if this hack works in the newer versions of GLBasic.

Kyo

Quote from: Moru on 2014-Aug-28
If I remember right, can't find the source right now:

Many old grafics-cards do not support images in arbitrary sizes, they only support SQUARE sizes at power of two. This means 64x64 is ok, 256x256 is also ok. However, 300x301 is not ok. To fix this, GLBasic will resize the working surface to 512x512 and fill the rest of the image with 0. When you use anti-alias to make your edges smooth, the grafics card will pick the average of the colors between your image and this black border.

There is methods for getting around this, one is to disable anti-alias. Not so sure of the others since I haven't been doing this for years but at one time I got around it by setting the texture pixel size 0.5 or 0.75 pixels smaller than the actual image with polyvectors. Not sure if this hack works in the newer versions of GLBasic.

For old card you have right, but now the low card on PC it's HD4000, I don't think today it's a problem to clamp a texture on Polys!
How to setting the pixel 0.5 or 0.75?

Quote from: Schranz0r on 2014-Aug-28
If i understand right you have a problem with youre textures... it's called "Texturebleeding" :blink:

GLB use on glTexParameteri for Texture2D GL_LINEAR, what you need is to change to GL_NEAREST !
Should solve youre problem...

I think the command to change is GL_CLAMP_TO_EDGE, and I hope to possible to do (with a flag for on/off)!