filtering anisotropic point linear not working on d3d9/ATI

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

filtering anisotropic point linear not working on d3d9/ATI

Post by sparkprime »

Can anyone with an ATI card and windows verify this bug report, as I only have Nvidia.

The steps to reproduce are:

1) Install ogre demos (or use the repo samples)
2) edit Media/materials/scripts/Ogre.material
3) Find Ogre/Skin and add "filtering anisotropic point linear" without the quotes below the "texture GreenSkin.jpg" line
4) Run the Sample Browser, go to the Lighting demo, and move the camera really close to the ogre head
5) Check the texture is pixellated as it should be for point magnification filtering.

The fact it doesn't show in GL suggests it's Ogre rather than a driver bug, but can't be sure without a d3d9-level test case.

My users have seen this with trunk ogre and with the 1.7 version in the demos download on the site.

Thanks if anyone can try this.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

Downloading the demo, I'll try this right now.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

5) Check the texture is pixellated as it should be for point magnification filtering.
It don't seem to change at all.

I took a screenshot in windowed mode:
ogre_pixelate.jpg
ogre_pixelate.jpg (130.95 KiB) Viewed 5055 times
I have a ATI Mobility Radeon HD 4670.

I add a copy of the Ogre.material file in case I did something wrong:

Code: Select all

material Ogre/Earring
{
	technique
	{
		pass
		{
			ambient 0.7 0.7 0
			diffuse 0.7 0.7 0

			texture_unit
			{
				texture spheremap.png
				colour_op_ex add src_texture src_current
				colour_op_multipass_fallback one one
				env_map spherical
			}
		}
	}
}

material Ogre/Skin
{
	technique
	{
		pass
		{
			ambient 0.3 0.8 0.3

			texture_unit
			{
				texture GreenSkin.jpg
				filtering anisotropic point linear
				tex_address_mode mirror
			}
		}
	}
}

material Ogre/Tusks
{
	technique
	{
		pass
		{
			ambient 0.7 0.7 0.6

			texture_unit
			{
				texture tusk.jpg
				scale 0.2 0.2
			}
		}
	}
}

material Ogre/Eyes
{
	technique
	{
		pass
		{
			ambient 1 0.4 0.4
			diffuse 1 0.7 0
			emissive 0.3 0.1 0
		}
	}
}
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

To see what you were talking about i had to test with OGL and go closer. I do see the pixelization, and indeed it don't work in d3d9. I didn't check with more recent Ogre version yet, will do tomorrow if you want.

D3D9: http://postimg.org/image/f4n7fqlaf/
OGL: http://postimg.org/image/phaqd6bsz/
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: filtering anisotropic point linear not working on d3d9/A

Post by Kojack »

I do see the problem in the 1.7 samples, but the 1.9 samples do it correctly in dx9.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

Thanks for your help, looks like I'll just sync my trunk and this will go away :)
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

I had to fix this before I could compile the latest Ogre, but I can't work out how to submit it as a pull request...

https://bitbucket.org/sparkprime/grit_o ... 26b21f3c38
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: filtering anisotropic point linear not working on d3d9/A

Post by Kojack »

That's odd. What compiler are you using? Was it linking errors while building ogre or linking with your code?

If you want the latest ogre, make sure you get the v1-9 branch. Don't get default or v2-0, they may not be in a usable state. (Our default branch may be lagged behind, all actual development work goes directly into v1-9 then is occasionally merged into default).
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

Ah OK :)

This is gcc 4.6 with -O2 -finline-functions and above. (aside: I was using gcc 4.7 but it seems to have a problem compiling manual vertex animation code that causes segfaults so I dropped to 4.6)

I build static so the only linking is done in my app (and OgreXMLConverter).

After reading the code from this bug, it was clear the code was wrong, since implicit template instantiation is not required to generate a symbol in C++. My patch fixes it by making the instantiations explicit.
Last edited by sparkprime on Tue Apr 23, 2013 2:19 pm, edited 2 times in total.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

If I want to be using the D3D11 and Gl3 rendersystems at some point (perhaps soon), which branch do I want for that?
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

OK with the branch I updated to, the original reporter has said the bug is still present. I am going to rebuild with 1-9 and we'll try that.

However I also asked him to try the 1-9 demos from http://sourceforge.net/projects/ogre/fi ... e/download

He said the bug still occurs there.

Kojack: is that the download you used?

Can anyone else confirm or deny that 1.9 works correctly?

thanks
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: filtering anisotropic point linear not working on d3d9/A

Post by Kojack »

Kojack: is that the download you used?
That demos package is 7 months old, there's been a lot of bug fixes since then. I used the 1.9 rc1 sdks that just came out a few days ago.
Although I just downloaded that demos package, adding the filter line makes it correctly use point mode in dx9.

What hardware is the reporter using?
There are dx9 cap bits for each filtering mode. The point setting as the second parameter requires the D3DPTFILTERCAPS_MAGFPOINT to be true. You can check if it's supported by opening the directx caps viewer and going to Direct3D9 Devices / Your GFX card name / D3D Device Types / HAL / Caps / TextureFilterCaps.
It would be odd to not support point mode though, that would usually be the fallback mode. But it's a possibility I guess.

Also, is the reporter zooming in enough? The ogrehead isn't the best model to test because the pixels have little variation in colour and are tiny, you have to get in really close to see the pixelation.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: filtering anisotropic point linear not working on d3d9/A

Post by Kojack »

Wait a sec, how did I miss the ATI thing in the title and first post? (probably because the following posts cut off the TI part). I'm on nvidia right now (my ati pc is in pieces).
But even so, I did see the bug in ogre 1.7, so at least back then it wasn't brand specific.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

Hehe :)

I never saw any problems with Nvidia, not even on 1.7.

I had 2 users reporting the problem with 1.7 ATI D3D9, one of those also reported with 1.9 ATI D3D9 (the other hasn't tried it)

The user who reported for 1.9 has the following hardware http://pastebin.com/ceCy3Xek
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

Ok so I'll take a look tomorrow with 1.9 last revision (it's too late right now) as I will be able to confirm on an ATI.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

Tested 1.9 ra16668556243 :
- DX9: NO PIXELS - so it's confirmed it don't work in 1.9;
- OGL: there is apparently a missing shadows.glsl file - can't test;
- DX11: got an exception about not being able to create gpu programs for render state;
- OGL3+: there is apparently a missing shadows.glsl file - can't test;
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

Thanks, I guess we now need to find out if this is an ATI driver bug or not? :)
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

It says my driver is up to date but keep in mind that it's not the most recent hardware.
Here are the info about the driver:

Driver Packaging Version 8.97.100.3-120703a-145534C-ATI
Catalyst Version 12.6
Provider Advanced Micro Devices, Inc.
2D Driver Version 8.01.01.1248
2D Driver File Path /REGISTRY/MACHINE/SYSTEM/ControlSet001/Control/CLASS/{4D36E968-E325-11CE-BFC1-08002BE10318}/0000
Direct3D Version 7.14.10.0911
OpenGL Version 6.14.10.11653
Catalyst Pro Control Center Version 2012.0704.122.388
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

Would be good to know if the bug exists in D3D11, perhaps there is another sample that works?
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by sparkprime »

D3D caps as requested

Image
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

sparkprime wrote:Would be good to know if the bug exists in D3D11, perhaps there is another sample that works?
No all the errors I got where at SampleBrowser startup.
I have no idea how to fix the DX11 problem.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: filtering anisotropic point linear not working on d3d9/A

Post by Klaim »

sparkprime wrote:D3D caps as requested

Image

Here is mine: http://imageshack.us/photo/my-images/811/dx9caps.jpg/
Post Reply