1 registered members (henrybane),
1,246
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
What does d3d_anisotropy do?
#405118
07/24/12 00:09
07/24/12 00:09
|
Joined: Mar 2009
Posts: 186
Valdsator
OP
Member
|
OP
Member
Joined: Mar 2009
Posts: 186
|
As I understand it, anisotropic texture filtering (which d3d_anisotropy controls according to the manual) is supposed to make textures farther away appear less blurry by using non-square low resolution textures when needed (looking at something from an angle). But, when I turn on anisotropic texture filtering in 3DGS, it doesn't appear to really do anything like that. ![](http://img803.imageshack.us/img803/2020/anisotropy.png) In fact, the only thing it does is fix an odd clipping issue. Does it do something else? Am I not activating it correctly? d3d_anisotropy is set to 7 (I've tried other numbers as well) before loading a level, and I assume on the first frame (if the main function runs on the first frame... which I would think it does). I've also tried changing d3d_mipmapping in case it affected anisotropic filtering, but it still doesn't work.
Last edited by Valdsator; 07/24/12 09:07.
|
|
|
Re: What does d3d_anisotropy do?
[Re: MasterQ32]
#405125
07/24/12 09:29
07/24/12 09:29
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
I had the same problem since A7 in this thread, but in german. In my experience, d3d_anisotropy acts as a switch and nothing more. In the meantime, I found a shader solution: mips_aniso.wmb
#include <default.c>
FONT* A24bi = "Arial#24bi";
var vAniso = 8.0;
MATERIAL* mtl_anisotropic =
{
effect = "
bool AUTORELOAD;
float vAniso_var;
texture entSkin1;
sampler sAnisotropic = sampler_state {
Texture = <entSkin1>;
MipFilter = Linear;
MinFilter = Anisotropic;
MagFilter = Linear;
MaxAnisotropy = vAniso_var;
AddressU = Wrap;
Addressv = Wrap;
};
technique anisotropic {
pass one {
sampler[0] = (sAnisotropic);
}
}";
}
VIEW* camera1 = {size_x = 400; size_y = 800; flags = SHOW;}
VIEW* camera2 = {pos_x = 400; size_x = 400; size_y = 800; flags = SHOW;}
function main()
{
vec_set(sky_color,COLOR_BLACK);
video_window(NULL,NULL,2,NULL);
video_set(800, 800, 32, 2);
//if (d3d_caps & 2) { d3d_mipmapping = 4; d3d_anisotropy = 16; printf("d3d_anisotropy active");}
mouse_mode = 4;
mip_levels = 10;
d3d_anisotropy = 7;
d3d_mipmapping = 4;
level_load("mips_aniso.wmb");
camera.flags &= ~SHOW;
vec_set(camera1.x,vector(0,0,150));
vec_set(camera1.pan,vector(0,-30,0));
vec_set(camera2.x,vector(15000,0,-350));
vec_set(camera2.pan,vector(0,-30,0));
PANEL* pAniso = pan_create(NULL,0);
pan_setdigits(pAniso,0,10,60,"Anisotropy Level = %.f", A24bi, 1, vAniso);
pan_setstring(pAniso,0,300, 0,A24bi,str_create("mip_levels = 10;"));
pan_setstring(pAniso,0, 10, 90,A24bi,str_create("Anisotropy Enabled"));
pan_setstring(pAniso,0,500, 60,A24bi,str_create("d3d_mipmapping = 4;"));
pan_setstring(pAniso,0,500, 90,A24bi,str_create("d3d_anisotropy = 7;"));
pan_setstring(pAniso,0,500,120,A24bi,str_create("Anisotropy Disabled"));
pan_setslider(pAniso,0,250,60,bmap_fill(bmap_createblack(100,1,32),COLOR_GREY,100),bmap_fill(bmap_createblack(12,32,32),COLOR_RED,100),0,16,vAniso);
set(pAniso, SHOW);
vec_fill(mtl_anisotropic.ambient_blue, 20);
/*while(1)
{
camera1.pan += .1*time_step;
camera2.pan -= .1*time_step;
wait(1);
}*/
}
|
|
|
Re: What does d3d_anisotropy do?
[Re: rojart]
#405133
07/24/12 11:16
07/24/12 11:16
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
You also have to set d3d_mipmapping to 4 in order to activate anisotropic filtering. Did you keep that in mind?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: What does d3d_anisotropy do?
[Re: Uhrwerk]
#405135
07/24/12 11:54
07/24/12 11:54
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
You also have to set d3d_mipmapping to 4 in order to activate anisotropic filtering. Did you keep that in mind? Of course, like code above. But really, this is not needed, when I use my aniso shader workaround.
|
|
|
Re: What does d3d_anisotropy do?
[Re: rojart]
#405146
07/24/12 17:03
07/24/12 17:03
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Yeah, sure, I saw that in your code. My comment was meant for Valdsator. You already seem to have put a some effort in that issue. It's strange. Anisotropy always worked for me right out of the box.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|