Hi everyone
I making a terrain loader, it's works well for loading.
In order to better performance, that pack all the textures in one.
But now i have a question, all tile textures are displayed the line on the edges.
It seems because of wrong texture filtering option, But it just still edges when i change all the texture filtering.
How i can fix it?
Thanks.
I mean that line on the edges is like:
This is the packed texture:
[Solved]Texture filtering question
[Solved]Texture filtering question
Last edited by xarple on Sun May 27, 2012 6:41 am, edited 1 time in total.
Re: Texture filtering question
You have to add a small padding to the textures in the atlas, and, if posible, you should generate as much mipmap levels as needed so your textures don't start to mix between them on the lower mipmap resolutions.
or perhaps you could use a shader so you always read the proper mipmap level, so it never reached the last level, in HLSL you can use the tex2dlod(), in GLSL i can't tell :/
or perhaps you could use a shader so you always read the proper mipmap level, so it never reached the last level, in HLSL you can use the tex2dlod(), in GLSL i can't tell :/
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Texture filtering question
very nice texture. try with a power of 2 image. (1024,1024 or 2048, 2048.. you can try also rectangular to save some memory 2048,1024)
(if changin background color from black to red don't change color of seams to RED, than probably your problem is that).
At a first look it seems that seams are between polygons but a closer look (on the first foreground mountain on left) shows that there are black seam even when behind there is some white, so probably is the nPOT2 image, but that could be a Zwrite problem using with Alpha channel
EDIT: probably removing alpha channel will help you too. replace transparency with your snow grey
(if changin background color from black to red don't change color of seams to RED, than probably your problem is that).
At a first look it seems that seams are between polygons but a closer look (on the first foreground mountain on left) shows that there are black seam even when behind there is some white, so probably is the nPOT2 image, but that could be a Zwrite problem using with Alpha channel
EDIT: probably removing alpha channel will help you too. replace transparency with your snow grey
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
-
- Posts: 48
- Joined: Sun Apr 22, 2012 11:55 pm
- Location: Vienna
- Contact:
Re: Texture filtering question
I had the same problem and kind of fixed it with the methode Mel suggests. But the problem is, that you have to use a larger border for every mipmap level, so the best solution is doing this with a shader I guess.
By the way, the corresponding GLSL function would be textureLod().
By the way, the corresponding GLSL function would be textureLod().
Re: Texture filtering question
Thanks for the reply
First I try to change the texture background color to RED, that display the line in RED color, and when I try to use power of 2 texture, it just same display.
Next I use a shader with tex2Dlod and set the filtering:
Shader:
But it just still display the edges line
Then I change it without padding space, it seems works fine:
Used texture:
But in the other terrain that edges line are still displayed!
Used texture:
First I suspect the problem is texcoord wrong, but the implement tell me not.
And the line thickness always not seem like a 'pixel width':
Are someone have any ideas?
Thanks a lot!
EDIT:
Only point filtering and no anti-aliasing can display correctly.
But it's not my want, anti-aliasing can simulate it use shader, but I want to enable the Anisotropic Filtering.
First I try to change the texture background color to RED, that display the line in RED color, and when I try to use power of 2 texture, it just same display.
Next I use a shader with tex2Dlod and set the filtering:
Code: Select all
Mat.setFlag( irr::video::EMF_BILINEAR_FILTER, false );
Mat.setFlag( irr::video::EMF_TRILINEAR_FILTER, false );
Mat.setFlag( irr::video::EMF_ANISOTROPIC_FILTER, false );
Code: Select all
PS_OUTPUT pixelMain( float2 TexCoord : TEXCOORD0,
float4 Position : POSITION,
float4 Diffuse : COLOR0 )
{
PS_OUTPUT Output;
float4 LOD;
LOD.xy = TexCoord;
LOD.z = 0;
LOD.w = 0;
Output.RGBColor = tex2Dlod( tex0, LOD ) * Diffuse;
return Output;
}
Then I change it without padding space, it seems works fine:
Used texture:
But in the other terrain that edges line are still displayed!
Used texture:
First I suspect the problem is texcoord wrong, but the implement tell me not.
And the line thickness always not seem like a 'pixel width':
Are someone have any ideas?
Thanks a lot!
EDIT:
Only point filtering and no anti-aliasing can display correctly.
But it's not my want, anti-aliasing can simulate it use shader, but I want to enable the Anisotropic Filtering.
Re: Texture filtering question
How were you able to extract the image files? It looks alot like ragnarok, and I think it be fun to look into custom map generation for the dozens of private servers they have. Do you have a way to repack them for use? Or were you just inspired by that game to create your own?
Re: Texture filtering question
Solved,
I use this guy's ideas:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61602
@alanacial
You are right, this is actually RO's map.
There have a few tools can able to edit the map, eg BrowEDIT, you can found it from google.
I use this guy's ideas:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61602
@alanacial
You are right, this is actually RO's map.
There have a few tools can able to edit the map, eg BrowEDIT, you can found it from google.