Pages: 1
  Print  
Author Topic: Interpolate Colors Between Pixels  (Read 1686 times)
Offline (Male) Goombert
Posted on: September 07, 2013, 09:17:59 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
This is the fucked up most god damn son of a bitch of an option ever.

Quote
Interpolate Colors Between Pixels - Turns on interpolation, which basically "smooths" pixels. for crisp pixel graphics, it should be off, but if you have nice alpha blends and smoothed edge graphics it is better left on.

So basically, it is the equivalent of texture_set_interpolation(true); and is used to smoothly scale sprites and shit, but *ahem* can cause things to look blurry. Basically anyone who would say that doesn't understand the actual operation the sampler performs.

At any rate, this is where the texture options for sprites and backgrounds come into play in Studio, the Tile: Vertically/Horizontally options control UV wrapping but not W.
Basically that lets you use texture_set_interpolation(true); on a draw_sprite(); call without the problem of the sampler interpolation nearby pixels from other textures causing planar edge artifacts.

Quote
Force Software Vertex Processing - This forces GameMaker:Studio to use the CPU for all graphics and is only recommended if there are compatibility issues with older machines.

I will implement that, but I am also going to implement the function, that option is specific to Direct3D under the Windows tab in Studio.
« Last Edit: September 07, 2013, 09:46:14 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) DaSpirit
Reply #1 Posted on: September 07, 2013, 09:21:42 PM

Member
Location: New York City
Joined: Mar 2013
Posts: 124

View Profile
Why on earth do you have to create a thread about this?
Logged
Offline (Male) Goombert
Reply #2 Posted on: September 07, 2013, 09:26:31 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
I do this from time to time for other developers such as Harri, forthevin and others to be aware of things, and also to remind myself to tell Josh.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #3 Posted on: September 08, 2013, 07:09:04 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
Basically that lets you use texture_set_interpolation(true); on a draw_sprite(); call without the problem of the sampler interpolation nearby pixels from other textures causing planar edge artifacts.
I am pretty sure they had the same problem as long time ago in YYG blog they posted on how to get rid of those artifacts (had to put 1pixel border around different sprites). We are having the same problem even without a sampler (without interpolation turned on). For text, I still haven't tried to set 1 pixel boarder around glyphs, but I guess that will be needed as not text looks bad.

Quote
Why on earth do you have to create a thread about this?
I was not for you apparently.
Logged
Offline (Male) Goombert
Reply #4 Posted on: September 08, 2013, 12:05:51 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
Well, Harri, to expand on this further, they added 3 checkboxes to sprites and backgrounds, and they are...

Tile Horizontally: [ ]
Tile Vertically : [ ]
Used for 3D: [ ]

My intention is to completely disregard all of this. Anytime draw_sprite() draw_background() draw_text() or other 2D functions are called they are batched into your global VBO which automatically forces clamping, as I have added in this commit.

https://github.com/enigma-dev/enigma-dev/pull/384

Because it was causing a green 1 px border around the gun sprite in the FPS tutorial. All I do is memorize the state of texture repetition and then restore it afterwards, I added the same code for Direct3D but I don't think its needed because I believe their sprite batcher I am using also forces texture clamping. I am not about to go clusterfucking the IDE with useless options, if somebody wants texture repetition for 2D they'd have to use draw_primitive() anyway.

But at any rate Harri, everything is good for OpenGL 3 and Direct3D 9, to fix it in OpenGL 1, the solution is simple, and what I would prefer, I would like you to move your 2D batcher over there and switch it to use Vertex Arrays instead since they are OGL 1.1 and polygonz can at least use them. I don't want anything of the immediate mode glBegin()/End() stuff in our code.

But yes, I am not sure if the 1px padding of font glyphs should be done by ENIGMA or the IDE, what do you think Harri?
« Last Edit: September 08, 2013, 12:20:15 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #5 Posted on: September 08, 2013, 12:36:48 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
The font texture is created by the compiler as far as I know, so it's not possible to be added in the IDE. I think it should be trivial with the Josh's glyph packer. Just add 1 to width and height (maybe 2).
Logged
Pages: 1
  Print