Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,393 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What does d3d_anisotropy do? #405118
07/24/12 00:09
07/24/12 00:09
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

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.



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: Valdsator] #405119
07/24/12 06:49
07/24/12 06:49
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
afaik it removes the flickering effect if you got high-resolution textures viewing from long distances
according to the manual you have to set d3d_mipmapping to 4 or higher to activate the feature
i think your texture is far to lowres and to linear to get really good visible results, try some 1024² Gras Texture with low scale
results should be much more visible


Visit my site: www.masterq32.de
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 Offline
User
rojart  Offline
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

Code:
#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);
	}*/
}




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
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 Offline
Expert
Uhrwerk  Offline
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 Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: Uhrwerk
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.


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
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 Offline
Expert
Uhrwerk  Offline
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...
Re: What does d3d_anisotropy do? [Re: Uhrwerk] #405150
07/24/12 18:19
07/24/12 18:19
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Yes I did try to change d3d_mipmapping to 4 (and other values) in many different places, just in case that mattered.

Honestly I'm just looking for all the options a player might want to change in the game, so if it doesn't work, it's not exactly required. It is strange, though.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1