but both are megablurry :0
thx for replyeis btw
but both are megablurry :0
thx for replyeis btw
That shouldn't be the case... There was time when different graphics cards drew with a little different coordinates but i think modern cards know better to do it from 0,0.
If you draw a quad that fills the screen the coordinates are:
0,0-Width,Height
Do you see why it's not Width-1, Height-1? The same reason that if you want to draw a quad that fills 1 pixel only.
To show a pixel at 5,5 use quad coordinates 5,5 - 6,6. (Or use GL_POINTS at 5.5, 5.5)
But if you want to draw a GL_LINE on right edge:
(width-0.5, 0.5) - (width-0.5, height-0.5)
Because center of pixel is 0.5, 0.5.
A sprite for example wants to utilize the whole pixel so it starts from 0,0.
I got it from the OpenGL red-book... And I quote :
"An optimum compromise that allows all primitives to be specified at integer positions, while still ensuring predictable rasterization, is to translate x and y by 0.375, as shown in the following code fragment. Such a translation keeps polygon and pixel image edges safely away from the centers of pixels, while moving line vertices close enough to the pixel centers."
But if you want to add 0.5, on the CPU, to both components of every coordinate you send, to the GPU, be my guest
I'm no longer using immediate mode, will post if I find any problems getting unfiltered, pixel aligned fonts working under GL3 Core. (I may go down the vector font route if I can't figure out an elegant way to render bitmap fonts using shaders)
Last edited by phibermon; 18-10-2010 at 09:36 PM.
When the moon hits your eye like a big pizza pie - that's an extinction level impact event.
but waht is this JUI thing? ;0
Maybe if you tell us what all these images are for we may be able to help a bit better I think. I'm guessing it's a tiled engine? That may account for the "1200 16x16 images" in which case I must ask what your game's screen resolution with 16x16 sized sprites. So what are the 1200 alpha blended images?
It almost seems like you are trying to swallow a whale without knowing how to... well... "fish" *ahem* pardon the expression. So lets start with what type of game it is and what gameplay features are you trying to put into it?
I'd go down the OpenGL path if I were you.
So, can you provide use with a screenshot of your app. We would like to see what you are trying to do and how blurry the output actually is.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
What function specifically are you using in andorra? (do you mean additive blending?)
I can do the above with an average of 300 FPS. I think it may be your computer or drivers, unless you consider 300 fps too slow...Code:for i := 0 to 2400 do begin gui[1].DrawAdd(AdDraw,AdRect(0,0,16,16),1,250); end;
heres the code i tested with andorra
its a tile based game yes, and it draws first all the tiles, then bllack boxes with various alpha levels to create shadowsCode://cam stuff cx := camx div 16; cy := camy div 16; cxl := cx+blockw; cyl := cy+blockh; //update grass updGrass := updGrass+1; if updGrass > 60*2 then begin updGrass := 0; updateGrass(false); end; //draw blocks for y := cy to cyl do begin for x := cx to cxl do begin if not(blocks[x,y,0] = 0) then begin images.Items[1].Draw(dxdraw, (x*16)-camx, (y*16)-camy, blocks[x,y,0]-1); blockRect.Left := (x*16)-camx; blockRect.Top := (y*16)-camy; blockRect.Right := blockRect.Left+16; blockRect.Bottom := blockRect.Top+16; images.Items[5].DrawAlpha(dxdraw, blockRect, 0, blocks[x,y,1]); end; end; end;
i got a solution to some of my problems, i kinda cached all the blocks in an array with 15 diffrent light values instead of drawing alpha blended images over them. but i still need to alpha blend the sky, becus the dude will be walking there and i want him to be dark and also there will be water so i definatly need it
and here screenshot of my game (this is done in delphix)
Bookmarks