September 15, 2013, 5:14pm
I am working on a custom shader but I have one issue. I want to use two sets of texture coordinates, but I am unsure how to access the second set in my vertex shader.
The first set is defined using
attribute vec2 inTexCoord;, but I am unsure how to define the second set, my guess was
attribute vec2 inTexCoord2; but that does not seem to work…
Hope someone can help.
September 15, 2013, 6:14pm
How does it “not seem to work”? That’s the way to do it.
For example, Unshaded.j3md uses multiple texture coordinates and the JME source is on the web:
So maybe there was something else wrong. We would need to know what errors your saw.
September 15, 2013, 7:00pm
I can assure you it works.
Does your mesh actually have a TexCoord2 VertexBuffer?
If you loaded it from the blender importer it may not work, because this feature was implemented recently. From the ogre pipeline it works.
September 15, 2013, 7:55pm
Thank you for your replies.
You were right nehon, my TexCoord2 buffer was not correctly set. I had accidentally written into the TexCoord buffer twice…
And sorry, I wasnt more specific about the error. TexCoord2 was null, I just thought that was simply because the name was wrong.