www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on February 28, 2014, 01:13:08 am

Title: odd texture error causing wrap around?
Post by: lawless_c on February 28, 2014, 01:13:08 am
I've run into this odd quirk with a texture i loaded, to demonstrate it i have replaced the texture with one a bit more simple. when i view the textures in an editor they look fine, however loading them into jpct causes the a chunk of the left side to be cut of and moved to the right side.

Here is the texture (http://i.imgur.com/pHVGDsY.png)

Here it is being rendered.
(http://i.imgur.com/Vvc0sKW.png)


If you are wondering about the fuzziness it's because i haven't got shaders set up entirely correctly yet.
Title: Re: odd texture error causing wrap around?
Post by: EgonOlsen on February 28, 2014, 07:36:20 am
What am i seeing there? What is this texture being used for in the final image? Is it a kind of backdrop? About the fuzziness...looks like as if the texture coordinates are perturbed by some shader...does your shader apply an offset to coordinates?`That would also explain the shift to the left.
Title: Re: odd texture error causing wrap around?
Post by: lawless_c on February 28, 2014, 09:55:30 am
It's the shader from this demo.

http://www.youtube.com/watch?v=5Zgn1OCDIus
Title: Re: odd texture error causing wrap around?
Post by: lawless_c on February 28, 2014, 10:30:32 am
final text is intended to be planet ring, however i swapped it out with the red and white one to make it easier to perceive the problem.
Title: Re: odd texture error causing wrap around?
Post by: EgonOlsen on February 28, 2014, 08:41:44 pm
It's the shader from this demo.
And that's the reason...that shader modifies the texture coordinates based on a normal and a height map. If it's a planet ring, i see no point in using this shader for it at all. I wouldn't use any special shader for it and rely on the default shaders and it should be fine.
Title: Re: odd texture error causing wrap around?
Post by: lawless_c on March 02, 2014, 06:26:24 pm
Yup, that was it, functions perfectly now.