3D Grid blurring

Advanced game related topics
Arcturus
User
User
Posts: 14
Joined: Tue Jan 26, 2010 11:23 am
Location: Australia
Contact:

3D Grid blurring

Post by Arcturus »

I have noticed that when a grid-like texture is applied to a plane the lines blur insanely in the distance with visible bands at various intervals. An example can be seen in the PB examples including CameraTrack.pb and ThirdPerson.pb. I would prefer crisp lines rather than burring to nothing, however the only way I have managed to do so is seting the filtering mode to "None" instead of "Bi/Trilinear" which results in poor quality.

I would like to know if there is any way to make these grid patterns look crisp and not so blurred in the distance.
Give a man fire and he's warm for a day; set a man on fire and he's warm for the rest of his life
Zach
Addict
Addict
Posts: 1677
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: 3D Grid blurring

Post by Zach »

Anti-Aliasing and Anisotropic Filtering ?
Arcturus
User
User
Posts: 14
Joined: Tue Jan 26, 2010 11:23 am
Location: Australia
Contact:

Re: 3D Grid blurring

Post by Arcturus »

I've tried changing the Anti-Aliasing settings, but it makes no difference. Can you tell me more about anisotropic filtering?
Give a man fire and he's warm for a day; set a man on fire and he's warm for the rest of his life
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: 3D Grid blurring

Post by IdeasVacuum »

Can you tell me more about anisotropic filtering?
..... it's a difficult word to pronounce :mrgreen: (sorry, couldn't resist)

anisotropic filtering
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Arcturus
User
User
Posts: 14
Joined: Tue Jan 26, 2010 11:23 am
Location: Australia
Contact:

Re: 3D Grid blurring

Post by Arcturus »

I should have worded that better :P

What I meant to ask, is if it can be done in Ogre (and if so, some advice on how to do so)
Give a man fire and he's warm for a day; set a man on fire and he's warm for the rest of his life
Zach
Addict
Addict
Posts: 1677
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: 3D Grid blurring

Post by Zach »

I honestly don't know anything about Ogre, nor especially the version used by PB.
Sorry.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: 3D Grid blurring

Post by Comtois »

You can use a script material

Code: Select all

material Examples/anisotropic
{
	technique
	{
		pass
		{
			texture_unit
			{
				texture drawline.png
				max_anisotropy 8
				filtering anisotropic

			}
		}
	}
}
Please correct my english
http://purebasic.developpez.com/
Arcturus
User
User
Posts: 14
Joined: Tue Jan 26, 2010 11:23 am
Location: Australia
Contact:

Re: 3D Grid blurring

Post by Arcturus »

Comtois wrote:You can use a script material
Thanks, I'll do a bit of research on this and test it out.
Give a man fire and he's warm for a day; set a man on fire and he's warm for the rest of his life
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: 3D Grid blurring

Post by Comtois »

here are my modification in CameraTrack.pb

Code: Select all

    Add3DArchive("Data/textures"        , #PB_3DArchive_FileSystem)
    Add3DArchive("Data/models"          , #PB_3DArchive_FileSystem)
    Add3DArchive("Data/GUI"             , #PB_3DArchive_FileSystem)
    Add3DArchive("Data/Scripts"         , #PB_3DArchive_FileSystem)
    Add3DArchive("Data/Packs/desert.zip", #PB_3DArchive_Zip)
    Parse3DScripts()
    
    WorldShadows(#PB_Shadow_Modulative)
    
    CreateImage(1, 256, 256)
    StartDrawing(ImageOutput(1))
    Box(0, 0, 256, 256, $002255)
    DrawingMode(#PB_2DDrawing_Outlined)
    Box(0, 0, 256, 256, $FFFFFF)
    Box(10, 10, 236, 236, $FFFF)
    StopDrawing()
    UsePNGImageEncoder()
    SaveImage(1, "Data/textures/drawline.png",  #PB_ImagePlugin_PNG) 
    
    CreateMaterial(0, LoadTexture(0, "r2skin.jpg"))
    GetScriptMaterial(1, "Examples/anisotropic")

    ;robot
And then you copy the script material in the file 'examples.material' or create a new file (folder Data/Scripts)
Please correct my english
http://purebasic.developpez.com/
Post Reply