Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 04:58:56 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Bad Texture rendering quality
Pages: [1]
Print
Author Topic: Bad Texture rendering quality  (Read 311 times)
Ashbad
Just dropped in

Offline Offline

Posts: 5


I would know -- I'm a 2 bit gray Witchdoctor


View Profile WWW Email
« on: 05. March 2011, 10:47:16 pm »

Hello again,

I figured out how to use textures!  but one problem -- for a 10.0f x 10.0f x 10.0f cube, I get the attached result of quality of my 32x32 PNG file -- really stretched out and ugly Tongue (click on it to enlarge, I think it was scaled down for size -- but you have to admit that is blurry O.O)

is there any way of countering this?  would lowering the size of the cube help at all?  or is it something to do with rendering options?

Also, another somewhat-random question:  if in my netbeans project folder called 'Trio and Niko' I have a folder called 'pictures' with a subfolder called 'tiles', how can I package the game in a way so it'll recognize this path?

Thanks in advance!

Adam
Logged

ahealingman
Just dropped in

Offline Offline

Posts: 14


View Profile Email
« Reply #1 on: 06. March 2011, 01:56:16 pm »

Hello again,

I figured out how to use textures!  but one problem -- for a 10.0f x 10.0f x 10.0f cube, I get the attached result of quality of my 32x32 PNG file -- really stretched out and ugly Tongue (click on it to enlarge, I think it was scaled down for size -- but you have to admit that is blurry O.O)

is there any way of countering this?  would lowering the size of the cube help at all?  or is it something to do with rendering options?

It sounds like you just have to let your texture repeat. The texture you are using is stretching to fill the entire face. I believe the default is to repeat the texture so just set your texture coordinates smaller then the face its covering.

You could also make the texture bigger, probably not what you would want to do but its an option.

Quote

Also, another somewhat-random question:  if in my netbeans project folder called 'Trio and Niko' I have a folder called 'pictures' with a subfolder called 'tiles', how can I package the game in a way so it'll recognize this path?

Thanks in advance!

Adam
I haven't used netbeans for a few years but I believe Clean & Build will automatically add all the files under your src folder to a jar for any standard project as long as you haven't manually modified the build script. I'm not sure if it works if you just copy any file using your OS, I know it will automatically be added to the build script if you use netbeans to add the file into your application
Logged
Ashbad
Just dropped in

Offline Offline

Posts: 5


I would know -- I'm a 2 bit gray Witchdoctor


View Profile WWW Email
« Reply #2 on: 06. March 2011, 03:39:12 pm »

hmm, I could quadruple the size of the texture, that could help -- it would be annoying to do it to all of them, but it's better than a blur Tongue

also, what do you mean by repeats?
Logged

ahealingman
Just dropped in

Offline Offline

Posts: 14


View Profile Email
« Reply #3 on: 07. March 2011, 12:34:22 pm »

When you learned about textures they probably explained about texture coordinates. It sounds like you have your texture set to cover the entire face when you want the texture to repeat across the face. I don't know how you created your cube but if each face is 4 vertexes then your coordinates are probably set to 0,1 - 0,0 - 1,0 - 1,1, change it to something else like 0,5 - 0,0 - 5,0 - 5,5 to make the texture repeat 5 times both top/bottom and left/right
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #4 on: 07. March 2011, 06:41:01 pm »

You are going to want to do two things:

1. Set the boundary mode using Texture.setBoundaryModes() to set the S & T modes to TextureBoundaryMode.WRAP to enable the tiling of the texture.

2. You may then need to use TextureMode.setTextureTransform() to use a uniform scale of 2 or 4 to increase the repetition of the texture on the surface (this is a node attribute, I believe).

Haven't tried it, but this seems correct.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic