Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  OpenGL Texturing issue  (Read 438 times)
0 Members and 1 Guest are viewing this topic.
Offline saucymeatman
« Posted 2014-02-21 19:05:35 »

I wrote my own .obj to mesh importer, and it is working ok, probably.
But with some meshes, some of the times with some quads, it appears to somehow "mess up" the texturing of the quad.
It would appear that the center of the quad is not being textured, but two of the edges have some texture on them. Which confuses me,
because if its using the texture on the quad, and no part of the texture is black, then none of the quad should be black right?

Here is an image where you can see so quads of the mesh being textured properly, everything looks exactly as it should. (ignoring the dirt on the left where the some of the texture is black.)


Here is a picture from the other side of the mesh where you can see the center of the texture is black, but if you look closely the bottom and top have a little texture :


Here is a closer look at the dirt quad that is black in the center :


I checked in my modeling program (Blender) and the normalized texture quardinates being used on the quads in the modeling program match the broken quads in my application.

Not sure whats going on here, but my hope is that one of you have seen somthing like this before.
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2014-02-21 19:16:08 »

I actually can't figure out the exact problem with the texture coordinates by looking at the images.

But just keep in mind that vertex / texture coordinate and normal indices start with '1' and not '0' (like the Array-indices) in .obj files.

Also, you might try to invert the texture coordinates (that means instead of
v
use
1.0f - v
)

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline saucymeatman
« Reply #2 - Posted 2014-02-21 19:42:30 »

Maybe this will help. These are the texture quardinates for the quad with the brick texture that is not being textured properly. (Image #2 in the original post)
(0.999937, 0.263838)
(0.640323, 0.394499)
(0.640323, 0.095902)
(1.001755, 6.3E-5)

But just keep in mind that vertex / texture coordinate and normal indices start with '1' and not '0' (like the Array-indices) in .obj files.
Im a little confused about what this means. So should the quardinates be this instead?
(1.999937, 1.263838)
(1.640323, 1.394499)
(1.640323, 1.095902)
(2.001755, 1.000065)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #3 - Posted 2014-02-21 21:12:18 »

But just keep in mind that vertex / texture coordinate and normal indices start with '1' and not '0' (like the Array-indices) in .obj files.
Im a little confused about what this means. So should the quardinates be this instead?
(1.999937, 1.263838)
(1.640323, 1.394499)
(1.640323, 1.095902)
(2.001755, 1.000065)

Uh, no.

I just wanted to say, when you have your face definitions (looking about like this):

f 2/24 5/34 29/13

the numbers represent the vertex indices:

f vi/vti vi/vti ...

where vi is supposed to mean vertex index and vti vertex texture index

The indices are the n-th vertex / vertex texture definition from the list of those:


v 0.14780 2.1908 4.14890 // this is vertex index 1 (!) (it doesn't start at 0, that was my point)
v 1.19 2.7852 3.3489 // this is vertex index 2
v ... // this is vertex index 3

vt 0.319 0.25 // this is vertex texture index 1 (!)
vt ... // and so on...


Hope, you get my point now Smiley

It could be that all the texture coords would be shifted, but it's unlikely... :/

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline saucymeatman
« Reply #4 - Posted 2014-02-21 21:14:33 »

I understand what you mean now, thanks. I dont think its the issue but Ill look into it anyway.
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #5 - Posted 2014-02-21 21:15:08 »

I understand what you mean now, thanks. I dont think its the issue but Ill look into it anyway.

Okay. I'm pretty much clueless otherwise :/

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline saucymeatman
« Reply #6 - Posted 2014-02-22 04:17:27 »

Ok, I've determined that the bug only happens when the texture is less than 1024 by 1024 resolution. It works perfectly when the image res is higher than that.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (20 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (32 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!