Problem with blurred texture

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Problem with blurred texture

Post by Asimov »

Hi all,

Getting along nicely with the game, even though I am having problems learning as I go.
I am going to replace this board with an English board later, and once I have learned how to put a menu on the game it may give you options of different boards.

The problem is this. I am using quite a high resolution board. It 2048x2048 but I am getting some blurred lettering. I can understand that it might blur a little towards the back of the board, but it seems blurred towards the front in places as well.

Is there a setting for better texture quality?
Image
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Problem with blurred texture

Post by Asimov »

Hi all,

I have been told that this might be due to the anistropic effect, but I am not sure if there is a command to make this better?
tasulife
Posts: 20
Joined: Sat Sep 21, 2013 8:09 pm

Re: Problem with blurred texture

Post by tasulife »

when you make the texture, you can set up trilinear filtering, and set up a lod bias. try experimeting with those two things.
tasulife
Posts: 20
Joined: Sat Sep 21, 2013 8:09 pm

Re: Problem with blurred texture

Post by tasulife »

Do you know how to search the developer reference? You can just use the search bar to llook up anisotropic and trilinear. Then look for enums and setter functions that apply those enumerated. Let me know if you cNt find it and I'll look it up for you
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Problem with blurred texture

Post by Asimov »

Hi tasulife,

I get lost in the developer reference to be honest. Sometimes I find things quicker in google search. Or the search at the top of this forum. However I have only found 2 posts on this subject.

Sorry I am new at this.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Problem with blurred texture

Post by Mel »

The setting of the lod bias to remove the texture blurring is on the SMaterialLayer structure.
http://irrlicht.sourceforge.net/docu/cl ... eefd102b53

To access these material layers, you have to access the materials which have these in an array.
http://irrlicht.sourceforge.net/docu/cl ... 785a409890

The materials are accessed from the scene nodes, so you would change the texture lod bias somewhat like this:

Code: Select all

 
node->getMaterial(i).textureLayer[j].LODBias = n; //where n is a signed 8bit integer.
 
The anisotropic filtering helps a lot, and if it is not available, the trilinear still behaves very well. Other way could be accessing the mip levels using a shader in which you chose on your own the detail you desired.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Problem with blurred texture

Post by Asimov »

Hi Mel,

Thanks I will see if I can get this working tomorrow.

As for shaders they are out of my league at the moment. Obviously I will be wanting to learn them later, but still getting to grips with the engine.
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Problem with blurred texture

Post by Asimov »

Hi Mel,

I had a look at those links you sent me and it went over my head in a blur LOL.
However I tried out the line of code you gave me. At first it didn't work at all and kept giving me errors, until I realise it should have a capital T in TextureLayer heh heh.

Anyway I kept on trying values at random, and I found that -4 made it clearer, however the anti-aliasing is a bit rubbish.

Code: Select all

node->getMaterial(2).TextureLayer[0].LODBias = -4;
I found my board texture by loading a horrible blue colour in until my board turned blue and then I knew it was material 2.
By the way I haven't mapped this board properly yet. That is why it hasn't got black borders yet, but I have designed it from scratch in illustrator, and I am using a 4k map.
Wasn't sure if irrlicht could handle a 4k map but I am happy it can.

Image
Post Reply