www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: toyswarm on May 23, 2012, 09:27:13 pm

Title: Distance quality? Lines (or wireframe?) problem? [solved]
Post by: toyswarm on May 23, 2012, 09:27:13 pm
Hi guys, I've a problem... well, I really don't know if this is a really problem...
and I don't even know how to explain the problem... for this I give you a link:

http://imageshack.us/photo/my-images/820/immaginehon.png/

how can I remove that lines like wireframe?
In the place near to camera that lines disappear... but when the camera is far... here they are.
Anyone can help me?
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 23, 2012, 10:17:03 pm
Looks like a mip-mapping artifact. Which graphics hardware are you using?
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 24, 2012, 06:35:51 pm
I've a ATI Mobility Radeon HD 4300 Series and I don't have any problem like that! XD
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 24, 2012, 08:53:01 pm
...well, obviously you have. Try to disable mip-mapping for the texture if see if the problem goes away.
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 25, 2012, 11:53:42 am
I Meant that with this hardware, I never had problems like this with other projects.  :D
Anyway, I tried "Config.glMipmap = false;", "Config.mipmap = false;" and "texture.setMipmap(false);" but the problem persists.   :'(

link: http://imageshack.us/photo/my-images/341/immagineuyt.png/
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 25, 2012, 12:14:21 pm
But the screenshot cleary shows that it happens when the first mip-map level kicks in. You can see this in the filtering of the textures and the banding. Have you tried to use textures with a higher resolution? These looks pretty small. Also try to enable clamping on the textures.
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 26, 2012, 06:41:42 pm
If I understand, jpct comes by lwjgl library and it don't have any problem to use textures with a lower resolution.  :-[

Do you meant enableGLClamping() ?
With it I get a problem on textures:
http://imageshack.us/photo/my-images/210/immaginezlf.png/
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 26, 2012, 09:43:57 pm
I have no control about what the driver or the hardware thinks about how to apply the mip-maps. Just try higher res textures and see what happens. What resolution have your current ones?
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 28, 2012, 04:47:45 pm
I tried an hight resolution texture, but I had the same result...  :-[
http://imageshack.us/f/338/immaginelow.png/
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 28, 2012, 08:47:25 pm
How are your textures organized? Individual textures or all merged in one?
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 29, 2012, 03:28:35 pm
All merged in one.
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: EgonOlsen on May 29, 2012, 03:54:59 pm
Well...then it's no wonder that you get these artifacts. The bilinear filter has no idea that it has to stop at the column/row where the (sub-)texture ends and blends it with the next texture's pixels. You could either separate the textures (that's what i would do), try to use smaller uv-coordinates (so that the filter doesn't bleed into another texture) or disable filtering and get this blocky Minecraft-look.
Title: Re: Distance quality? Lines (or wireframe?) problem?
Post by: toyswarm on May 29, 2012, 07:25:50 pm
I had excluded this eventuality because i had just addressed this problem:
I had create a variable that had subtracted this error but...
you're right it's this is the error...

Now I want to paste one little part of program:
private static float[] texCoordsByIDs(int id) {
      return new float[]
            {
               id*offset+ccorr,            (id/16)*offset+ccorr,         (id+1)*offset-ccorr, (id/16)*offset+ccorr,
               (id+1)*offset-ccorr, ((id/16)+1)*offset-ccorr, id*offset+ccorr,         ((id/16)+1)*offset-ccorr
            };
   }

'ccorr' this restrict the area of texture to correct that problem;

here a graphic example:
(I exaggerated the value to show what the correction do)
http://imageshack.us/photo/my-images/88/immagineoua.png/

EgonOlsen, thanks for the patience that you showed me.  :D