0 registered members (),
1,089
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: Benni003]
#455151
10/11/15 16:38
10/11/15 16:38
|
Malice
Unregistered
|
Malice
Unregistered
|
@Benni003 remind me the current issues you face, please?
Kartoffel told us both that AA and shaders will have no effect. This is to be a 2d game correct? So then you should need lots of 2d assets. When you scale down the current quad you have 2 issues 1) an untextered black boarder 2) a jagged ugly texture quality.
My solution would be how they would do it in a real game. 1) never scale the quad, clear it, then repaint it with a different texture 2) if you have to zoom in %50, open you digital paint program and modify the %100 texture there. You can use the scaling filters of a 2d art program to create a second texture, or you can actual paint the second texture. 3) You will not be able to quad a giant area one, then move around it and zoom in and out. Not like loading a 3d world. Your world should be constructed of many textures that relate to a grid set-up. You will need to paint and repaint the textured quad(s) to move around on the world and zoom in and out.
You may question this advice, however there is a reason that Zelda and other games work how they do.
Thanks for the fun Mal
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: Benni003]
#455156
10/11/15 23:05
10/11/15 23:05
|
Malice
Unregistered
|
Malice
Unregistered
|
Exactly ! I would do it like a the logic of a lod system.
create 4 step graphics for %25, %50, % 75 and %100, then you could still do a bit of scaling also. But no more the %25(+- .25) before changing steps. So if you are at %0 zoom you can scale down the quad to atmost scale = .75. Then change to the next step graphic and scale it up top scale =1.25; . That step can be scale all the way down to scale = .75 before changing the next step image.
This gives you a smoother none stepping zoom and reduces the blur and jaggs
Mal
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: ]
#455157
10/11/15 23:07
10/11/15 23:07
|
Malice
Unregistered
|
Malice
Unregistered
|
As for Anno online, it is a 3d game and also if we could compete with UbiSoft we would be talk on this forum Now.
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: Benni003]
#455159
10/11/15 23:31
10/11/15 23:31
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Hi, you could 'draw_quad' the full map on a not visible bitmap at its pixel to pixel scale and use it as source map in a shader over a view or a 'bmap_process' inside a loop. It would let you use any scale on the visible bitmap with the proper samples. I am afraid anisotropic filter does not work on texture samples but linear interpolation is enough, I guess. It is pretty easy to develop. I can help.
Salud!
Last edited by txesmi; 10/11/15 23:40.
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: txesmi]
#455164
10/12/15 00:18
10/12/15 00:18
|
Malice
Unregistered
|
Malice
Unregistered
|
Mal says " listen to txesmi, he's got more brains in one finger than Mal has in his whole head" !!
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: ]
#455180
10/12/15 13:55
10/12/15 13:55
|
Joined: Aug 2008
Posts: 394 Germany
Benni003
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 394
Germany
|
@txesmi that sounds good, but I haven't the knowlege to do it I don't have a view, because I haven't any 3d Level, so I think to use bmap_process is better... Would be great, if you could give me an example for this.
Last edited by Benni003; 10/12/15 13:55.
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: Benni003]
#455195
10/12/15 22:32
10/12/15 22:32
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Here you go! main.c
#include <acknex.h>
// Material skills
#define skPosX skill5 // X coord relative to the center of the map in map coords (centered on the screen)
#define skPosY skill6 // Y coord
#define skScale skill7 // scale of the map
#define skScaleNext skill8 // needed a map scale smooth transition variable
void main ()
{
video_mode = 10;
mouse_mode = 4;
fps_max = 60;
wait(1);
BMAP *bmpMap = bmap_create ( "grid.tga" );
BMAP *bmpScreen = bmap_createblack ( screen_size.x, screen_size.y, 24 );
PANEL *panScreen = pan_create ( "flags=SHOW", 1 );
panScreen->bmap = bmpScreen;
MATERIAL *mtlCamMap = mtl_create ();
mtlCamMap->skPosX = 0;
mtlCamMap->skPosY = 0;
mtlCamMap->skScale = 1;
mtlCamMap->skScaleNext = mtlCamMap->skScale;
effect_load ( mtlCamMap, "display_map.fx" );
mtlCamMap->skill4 = floatd ( bmap_height(bmpScreen) * bmap_width(bmpMap), bmap_width(bmpScreen) * bmap_height(bmpMap) );
var nProp = bmap_width(bmpScreen) / bmap_width(bmpMap);
while ( !key_esc )
{
if ( mouse_left )
{
mtlCamMap->skPosX += mickey.x / mtlCamMap->skScale;
mtlCamMap->skPosY += mickey.y / mtlCamMap->skScale;
}
if ( mickey.z )
{
mtlCamMap->skScaleNext = clamp ( mtlCamMap->skScaleNext + sign(mickey.z), 1, 10 );
}
mtlCamMap->skScale += ( mtlCamMap->skScaleNext - mtlCamMap->skScale ) * time_step * 0.5;
mtlCamMap->skill1 = floatd ( mtlCamMap->skPosX, bmap_width(bmpMap) );
mtlCamMap->skill2 = floatd ( mtlCamMap->skPosY, bmap_height(bmpMap) );
mtlCamMap->skill3 = floatd ( nProp, mtlCamMap->skScale );
bmap_process ( bmpScreen, bmpMap, mtlCamMap );
wait(1);
}
mtl_remove ( mtlCamMap );
pan_remove ( panScreen );
bmap_remove ( bmpScreen );
bmap_remove ( bmpMap );
sys_exit ( NULL );
}
display_map.fx
float4 vecSkill1;
texture TargetMap;
sampler ColorSampler = sampler_state { Texture = <TargetMap>; MipFilter = Linear; MinFilter = Linear; MagFilter = Linear; AddressU = Clamp; AddressV = Clamp; };
float4 PS ( in float2 inTex: TEXCOORD0 ) : COLOR0
{
inTex.xy -= 0.5f;
inTex.xy *= vecSkill1.z;
inTex.y *= vecSkill1.w;
inTex.xy += 0.5f - vecSkill1.xy;
return tex2D ( ColorSampler, inTex );
}
technique
{
pass
{
VertexShader = null;
PixelShader = compile ps_2_0 PS();
}
}
Salud!
|
|
|
Re: Use draw_quad outside the window / render on bmap
[Re: Benni003]
#455215
10/13/15 15:13
10/13/15 15:13
|
Joined: Aug 2008
Posts: 394 Germany
Benni003
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 394
Germany
|
I have only one Problem. Zooming is good working, but to Have a good Quality I want to draw higher res. Pictures and then integrate a zoom-out function. But the Draw_quad function is not working outside the original Resolution size. If I soom out, the Pictures out of the original res. size are not drawn, even when the res. of bmpMap is higher...
bmap_rendertarget(bmpMap,0,1);
draw_quad(bmap_test,vecto(1,500,0),NULL,NULL,NULL,NULL,100,NULL);
draw_quad(bmap_test,vector(1000,500,0),NULL,NULL,NULL,NULL,100,NULL);
draw_quad(bmap_test,vector(2000,500,0),NULL,NULL,NULL,NULL,100,NULL);
bmap_rendertarget(NULL,0,0);
|
|
|
|