El Newto Posted January 6, 2015 Share Posted January 6, 2015 Hi, I'm new to GLSL coding so I hope this isn't a silly question. I am trying to use a second UV map for a diffuse detail texture on models imported from blender. I made a modified version of the diffuse+normal+specular shader by adding the extra code: //Extra code added to vertex shader //Attributes in vec2 vertex_texcoords1; //Outputs out vec2 ex_texcoords1; void main() { ex_texcoords1 = vertex_texcoords1; } //Extra code added to fragment shader //Uniforms uniform sampler2D texture4; //detail map //Inputs in vec2 ex_texcoords1; void main(void) { outcolor += texture(texture4,ex_texcoords1); } This does not appear to work, this may be because the code is wrong or because the model does not get imported into leadwerks with more than one UV map. If someone could enlighten me I would be very grateful. Thanks, El Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 6, 2015 Share Posted January 6, 2015 That will work, assuming your model have 2 uv-maps and texture4 holds a texture. You can use these to test your shader : http://www.leadwerks.com/werkspace/topic/8439-fbx-converter-and-second-uv-channel/#entry65740 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
El Newto Posted January 6, 2015 Author Share Posted January 6, 2015 Excellent, thank you shadmar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.